Skip to content

Commit

Permalink
add oauth scope for each service
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifosmin Simon committed Oct 21, 2024
1 parent af8ec05 commit f486efa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/providers/bigquery/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewBigQueryClient(projectID string, credentialsJSON []byte, opts ...option.
var oauthClient func(name string) *http.Client
if credentialsJSON != nil {
var err error
creds, err = google.CredentialsFromJSON(ctx, credentialsJSON, cloudresourcemanager.CloudPlatformScope)
creds, err = google.CredentialsFromJSON(ctx, credentialsJSON, cloudresourcemanager.CloudPlatformScope, bqApi.BigqueryScope, iam.CloudPlatformScope)
if err != nil {
return nil, fmt.Errorf("failed to obtain credentials: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/providers/gcloudiam/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type iamClient struct {

func newIamClient(credentialsJSON []byte, resourceName string) (*iamClient, error) {
ctx := context.Background()
creds, err := google.CredentialsFromJSON(ctx, credentialsJSON)
creds, err := google.CredentialsFromJSON(ctx, credentialsJSON, cloudresourcemanager.CloudPlatformScope, iam.CloudPlatformScope)
if err != nil {
return nil, fmt.Errorf("failed to obtain credentials: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/providers/gcs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type gcsClient struct {
}

func newGCSClient(ctx context.Context, projectID string, credentialsJSON []byte) (*gcsClient, error) {
creds, err := google.CredentialsFromJSON(ctx, credentialsJSON)
creds, err := google.CredentialsFromJSON(ctx, credentialsJSON, "https://www.googleapis.com/auth/devstorage.full_control")
if err != nil {
return nil, fmt.Errorf("failed to obtain credentials: %w", err)
}
Expand Down

0 comments on commit f486efa

Please sign in to comment.