Skip to content

Commit

Permalink
GCS: adds scope to fix bug introduced in HTTPConfig support (#109)
Browse files Browse the repository at this point in the history
GCS: adds scope to fix bug introduced in #86
Issue was reported in #106 (comment)

Signed-off-by: Joao Marcal <[email protected]>
  • Loading branch information
JoaoBraveCoding authored Mar 9, 2024
1 parent ab7ba39 commit e8336a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func NewBucketWithConfig(ctx context.Context, logger log.Logger, gc Config, comp
}
}

// GCS uses some defaults when "options.WithHTTPClient" is not used that are important when we call
// htransport.NewTransport namely the scopes that are then used for OAth authentication. So to build our own
// http client we need to se those defaults
opts = append(opts, option.WithScopes(storage.ScopeFullControl, "https://www.googleapis.com/auth/cloud-platform"))
gRT, err := htransport.NewTransport(context.Background(), rt, opts...)
if err != nil {
return nil, err
Expand Down

0 comments on commit e8336a5

Please sign in to comment.