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

fix: panic due to potentially uncomparable wrapped fn in express_resolve #2500

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changelog/4160aee8b3204fc5bb030e0f5b068f5c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "4160aee8-b320-4fc5-bb03-0e0f5b068f5c",
"type": "bugfix",
"description": "Prevent potential panic caused by invalid comparison of credentials.",
"modules": [
"service/s3"
]
}
9 changes: 2 additions & 7 deletions service/s3/express_resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ func finalizeExpressCredentials(o *Options, c *Client) {
}

// Operation config finalizer: update the sigv4 credentials on the default
// express provider if it changed to ensure different cache keys
// express provider in case it changed to ensure different cache keys
func finalizeOperationExpressCredentials(o *Options, c Client) {
p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider)
if !ok {
return
}

if c.options.Credentials != o.Credentials {
if p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider); ok {
o.ExpressCredentials = p.CloneWithBaseCredentials(o.Credentials)
}
}
Expand Down