Skip to content

Add scope to oauth token for gcs backup storage client#4433

Merged
derekperkins merged 1 commit intovitessio:masterfrom
Santiclause:gcs-backup-scope
Dec 8, 2018
Merged

Add scope to oauth token for gcs backup storage client#4433
derekperkins merged 1 commit intovitessio:masterfrom
Santiclause:gcs-backup-scope

Conversation

@Santiclause
Copy link
Copy Markdown
Contributor

storage.ScopeFullControl is the default scope for storage.NewClient, but the option.WithHTTPClient option appears to get rid of that, as we experience an "Empty or missing scope not allowed." error when attempting to use service account credentials.

The error is reproducible thusly: https://gist.github.com/Santiclause/52029d7cbc9e8e0236fb023c3945ac40

Using GOOGLE_APPLICATION_CREDENTIALS=creds.json ./bucket-test <bucket> yields the same error, and this fix fixes it.

It's possible that just removing the WithHTTPClient option is preferable, but I don't know enough about the decision to include it to chime in one way or the other.

Other possibility that merits figuring out: whether this option would somehow break using an oauth token as GOOGLE_APPLICATION_CREDENTIALS instead of service account creds.

Signed-off-by: Michael Hebelka <michael.hebelka@sharpspring.com>
@Santiclause Santiclause requested a review from sougou as a code owner December 7, 2018 23:55
@sougou sougou requested a review from derekperkins December 8, 2018 00:14
Copy link
Copy Markdown
Member

@derekperkins derekperkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'd really like to see the cloud.google.com/go libraries updated since they're two years old at this point, but we can handle that in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants