forked from TrueCloudLab/restic
s3: check for EnvAWS credentials before Static credentials
EnvAWS considers more environment variables, including AWS_SESSION_TOKEN and thus should be checked first.
This commit is contained in:
parent
5ffb536aae
commit
20cf4777cb
1 changed files with 1 additions and 1 deletions
|
@ -107,13 +107,13 @@ func getCredentials(cfg Config) (*credentials.Credentials, error) {
|
||||||
// call to a pre-defined endpoint, only valid inside
|
// call to a pre-defined endpoint, only valid inside
|
||||||
// configured ec2 instances)
|
// configured ec2 instances)
|
||||||
creds := credentials.NewChainCredentials([]credentials.Provider{
|
creds := credentials.NewChainCredentials([]credentials.Provider{
|
||||||
|
&credentials.EnvAWS{},
|
||||||
&credentials.Static{
|
&credentials.Static{
|
||||||
Value: credentials.Value{
|
Value: credentials.Value{
|
||||||
AccessKeyID: cfg.KeyID,
|
AccessKeyID: cfg.KeyID,
|
||||||
SecretAccessKey: cfg.Secret.Unwrap(),
|
SecretAccessKey: cfg.Secret.Unwrap(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&credentials.EnvAWS{},
|
|
||||||
&credentials.EnvMinio{},
|
&credentials.EnvMinio{},
|
||||||
&credentials.FileAWSCredentials{},
|
&credentials.FileAWSCredentials{},
|
||||||
&credentials.FileMinioClient{},
|
&credentials.FileMinioClient{},
|
||||||
|
|
Loading…
Reference in a new issue