Skip to content

Commit

Permalink
compare incoming url to signed url
Browse files Browse the repository at this point in the history
  • Loading branch information
ddowker committed May 22, 2024
1 parent 1fd4cd6 commit a59ada2
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions broker/fragment/store_gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ func (s *gcsBackend) Provider() string {
}

func (s *gcsBackend) SignGet(ep *url.URL, fragment pb.Fragment, d time.Duration) (string, error) {
log.WithFields(log.Fields{"ep": ep.String(), "fragment": fragment.ContentPath()}).Info("*** DJD SignGet() called")
return "", nil
/*
cfg, client, opts, err := s.gcsClient(ep)
if err != nil {
return "", err
}
opts.Method = "GET"
opts.Expires = time.Now().Add(d)
log.WithFields(log.Fields{"ep": ep.String(), "fragment": fragment.ContentPath()}).Info("*** DJD1 SignGet() called")

// test start
cfg, client, opts, err := s.gcsClient(ep)
if err != nil {
return "", err
}
opts.Method = "GET"
opts.Expires = time.Now().Add(d)

url, err := client.Bucket(cfg.bucket).SignedURL(cfg.rewritePath(cfg.prefix, fragment.ContentPath()), &opts)
log.WithFields(log.Fields{"url": url}).Info("*** DJD2 SignGet()")
// test end

return client.Bucket(cfg.bucket).SignedURL(cfg.rewritePath(cfg.prefix, fragment.ContentPath()), &opts)
*/
return ep.String(), nil
}

func (s *gcsBackend) Exists(ctx context.Context, ep *url.URL, fragment pb.Fragment) (exists bool, err error) {
Expand Down

0 comments on commit a59ada2

Please sign in to comment.