Explicitly disable signing for public buckets. (#8263)

This commit is contained in:
Chris Lu
2026-02-09 11:28:07 -08:00
committed by GitHub
parent 88b1768814
commit ccf35459be
2 changed files with 60 additions and 0 deletions

View File

@@ -44,6 +44,9 @@ func (s s3RemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.R
}
if conf.S3AccessKey != "" && conf.S3SecretKey != "" {
config.Credentials = credentials.NewStaticCredentials(conf.S3AccessKey, conf.S3SecretKey, "")
} else if conf.S3AccessKey == "" && conf.S3SecretKey == "" {
// Explicitly disable signing for public buckets.
config.Credentials = credentials.AnonymousCredentials
}
sess, err := session.NewSession(config)