-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(storage): migrate oauth2/google usages to cloud.google.com/go/auth #11191
base: main
Are you sure you want to change the base?
Conversation
cbc450e
to
2f8457f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good, thank you for the changes. Just a note on making sure tests pass with old auth creds sent in by users.
func (c Client) credsJSON() []byte { | ||
if c.creds != nil && len(c.creds.JSON()) > 0 { | ||
return c.creds.JSON() | ||
} | ||
return []byte{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be nicer returning the creds and a bool so that callers can check creds, ok := credsJSON()
func (c Client) credsJSON() []byte { | |
if c.creds != nil && len(c.creds.JSON()) > 0 { | |
return c.creds.JSON() | |
} | |
return []byte{} | |
func (c Client) credsJSON() ([]byte, bool) { | |
if c.creds != nil && len(c.creds.JSON()) > 0 { | |
return c.creds.JSON(), true | |
} | |
return []byte{}, false |
@@ -5728,7 +5751,7 @@ func TestIntegration_PostPolicyV4_WithCreds(t *testing.T) { | |||
} | |||
}) | |||
} | |||
}, option.WithCredentials(creds)) | |||
}, option.WithAuthCredentials(creds)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try running the integration tests without changes? I would like to make sure they pass even using the old auth before switching them over.
Signed URL stuff in particular, do you think it would be useful to test with both the old and new auth paths?
creds, err := credentials.DetectDefault(&credentials.DetectOptions{ | ||
CredentialsJSON: jsonBytes, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to get auth credentials here without this function?
No description provided.