Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blob/gcsblob: anonymous bucket access follow up to #3302 #3315

Closed
calebbrown opened this issue Sep 6, 2023 · 1 comment
Closed

blob/gcsblob: anonymous bucket access follow up to #3302 #3315

calebbrown opened this issue Sep 6, 2023 · 1 comment

Comments

@calebbrown
Copy link
Contributor

calebbrown commented Sep 6, 2023

From #3302:

I finally got around to testing #3306. Unfortunately it doesn't work.

I suspect the issue is the creds used when there is no ADC is empty:

creds = &google.Credentials{}

So creds.TokenSource is not set and the API requests fail.

One possibility for solving this is using something like the following to generate a valid creds instance:

creds, _ = google.CredentialsFromJSON(ctx, []byte(`{"type": "service_account"}`))

Or use golang.org/x/oauth2/jwt to create the token source:

creds.TokenSource = &jwt.Config{
		Scopes:       []string{"https://www.googleapis.com/auth/cloud-platform"},
		TokenURL:     google.JWTTokenURL,
	}.TokenSource(ctx)
@calebbrown
Copy link
Contributor Author

#3317 fixes this issue.

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

No branches or pull requests

1 participant