Skip to content

Commit

Permalink
GCS: adds scope to fix bug introduced in thanos-io#86
Browse files Browse the repository at this point in the history
Issue was reported in thanos-io#106 (comment)
  • Loading branch information
JoaoBraveCoding committed Mar 4, 2024
1 parent c3ccc5d commit 688d47c
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 688d47c

Please sign in to comment.