mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
fix default s3 credentials set as anonymous (#1789)
This commit is contained in:
@@ -36,6 +36,9 @@ func New(s3Conf *config.S3Config, timeout time.Duration, options ...func(*aws.Co
|
||||
const op errors.Op = "s3.New"
|
||||
|
||||
awsConfig := defaults.Config()
|
||||
// remove anonymous credentials from the default config so that
|
||||
// session.NewSession can auto-resolve credentials from role, profile, env etc.
|
||||
awsConfig.Credentials = nil
|
||||
awsConfig.Region = aws.String(s3Conf.Region)
|
||||
for _, o := range options {
|
||||
o(awsConfig)
|
||||
|
||||
Reference in New Issue
Block a user