-
Notifications
You must be signed in to change notification settings - Fork 697
Remove credential config of GetBucketRegion by default #3081
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
Conversation
clientOptionFns[0] = func(options *s3.Options) { | ||
options.APIOptions = append(options.APIOptions, captureBucketRegion.RegisterMiddleware) | ||
} | ||
copy(clientOptionFns[1:], optFns) | ||
clientOptionFns[1] = func(options *s3.Options) { | ||
options.Credentials = nil | ||
} | ||
copy(clientOptionFns[2:], optFns) |
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.
Thanks for fixing the bug!
Out of curiosity, is there a reason why we don't just set options.Credentials = nil
directly in clientOptionFns[0]
?
clientOptionFns[0] = func(options *s3.Options) { | |
options.APIOptions = append(options.APIOptions, captureBucketRegion.RegisterMiddleware) | |
} | |
copy(clientOptionFns[1:], optFns) | |
clientOptionFns[1] = func(options *s3.Options) { | |
options.Credentials = nil | |
} | |
copy(clientOptionFns[2:], optFns) | |
clientOptionFns[0] = func(options *s3.Options) { | |
options.APIOptions = append(options.APIOptions, captureBucketRegion.RegisterMiddleware) | |
options.Credentials = nil | |
} | |
copy(clientOptionFns[1:], optFns) |
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.
It's just a idioms when I want to add a new functional config
@lucix-aws this broke things for private buckets in It works as expected in I can work around this by explicitly using the client's credentials for the call:
But this worked with defaults prior to |
The s3 transfer manager helper func
GetBucketRegion
is ported from go v1 but missed default anonymous credential config, this PR patches the config back so user could get a public bucket's region without credentials.Fixes #3077