Skip to content

Commit

Permalink
add token to support AWS temporary credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-l committed Jul 14, 2022
1 parent c5e1b60 commit 21e7a90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sigv4/sigv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewSigV4RoundTripper(cfg *SigV4Config, next http.RoundTripper) (http.RoundT
next = http.DefaultTransport
}

creds := credentials.NewStaticCredentials(cfg.AccessKey, string(cfg.SecretKey), "")
creds := credentials.NewStaticCredentials(cfg.AccessKey, string(cfg.SecretKey), cfg.Token)
if cfg.AccessKey == "" && cfg.SecretKey == "" {
creds = nil
}
Expand Down
1 change: 1 addition & 0 deletions sigv4/sigv4_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type SigV4Config struct {
SecretKey config.Secret `yaml:"secret_key,omitempty"`
Profile string `yaml:"profile,omitempty"`
RoleARN string `yaml:"role_arn,omitempty"`
Token string `yaml:"token,omitempty"`
}

func (c *SigV4Config) Validate() error {
Expand Down
1 change: 1 addition & 0 deletions sigv4/testdata/sigv4_good.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
region: us-east-2
access_key: AccessKey
secret_key: SecretKey
token: token
profile: profile
role_arn: blah:role/arn

0 comments on commit 21e7a90

Please sign in to comment.