Skip to content

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

Closed
@calebbrown

Description

@calebbrown

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions