feat(s3): add `SessionToken` field (close #4761)

pull/4762/head
Andy Hsu 2023-07-13 15:58:19 +08:00
parent a31af209cc
commit d2ff040cf8
2 changed files with 2 additions and 1 deletions

View File

@ -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"`

View File

@ -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),