Skip to content

Commit

Permalink
S3 SignatureV4 Without Config File Credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Campbell committed Jan 15, 2019
1 parent 4e20faf commit 0541427
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/objstore/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B
if err := validate(config); err != nil {
return nil, err
}
if config.AccessKey != "" {
signature := credentials.SignatureV4
if config.SignatureV2 {
signature = credentials.SignatureV2
}

signature := credentials.SignatureV4
if config.SignatureV2 {
signature = credentials.SignatureV2
}

if config.AccessKey != "" {
chain = []credentials.Provider{&credentials.Static{
Value: credentials.Value{
AccessKeyID: config.AccessKey,
Expand All @@ -106,7 +107,7 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B
} else {
chain = []credentials.Provider{
&credentials.EnvAWS{},
&credentials.FileAWSCredentials{},
&credentials.FileAWSCredentials{},
&credentials.IAM{
Client: &http.Client{
Transport: http.DefaultTransport,
Expand Down

0 comments on commit 0541427

Please sign in to comment.