Skip to content

Commit

Permalink
feat(s3): add SessionToken field (close #4761)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jul 13, 2023
1 parent a31af20 commit d2ff040
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/s3/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Addition struct {
Region string `json:"region"`
AccessKeyID string `json:"access_key_id" required:"true"`
SecretAccessKey string `json:"secret_access_key" required:"true"`
SessionToken string `json:"session_token"`
CustomHost string `json:"custom_host"`
SignURLExpire int `json:"sign_url_expire" type:"number" default:"4"`
Placeholder string `json:"placeholder"`
Expand Down
2 changes: 1 addition & 1 deletion drivers/s3/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

func (d *S3) initSession() error {
cfg := &aws.Config{
Credentials: credentials.NewStaticCredentials(d.AccessKeyID, d.SecretAccessKey, ""),
Credentials: credentials.NewStaticCredentials(d.AccessKeyID, d.SecretAccessKey, d.SessionToken),
Region: &d.Region,
Endpoint: &d.Endpoint,
S3ForcePathStyle: aws.Bool(d.ForcePathStyle),
Expand Down

0 comments on commit d2ff040

Please sign in to comment.