mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-09 00:33:28 -04:00
Granting S3 backend temporary access
This commit is contained in:
parent
8503f5b4b2
commit
04bc1c0ae1
2 changed files with 6 additions and 0 deletions
|
|
@ -41,6 +41,10 @@ func newS3Backend(conf map[string]string) (Backend, error) {
|
|||
if !ok {
|
||||
secret_key = ""
|
||||
}
|
||||
session_token, ok := conf["session_token"]
|
||||
if !ok {
|
||||
session_token = ""
|
||||
}
|
||||
region, ok := conf["region"]
|
||||
if !ok {
|
||||
region = os.Getenv("AWS_DEFAULT_REGION")
|
||||
|
|
@ -53,6 +57,7 @@ func newS3Backend(conf map[string]string) (Backend, error) {
|
|||
&credentials.StaticProvider{Value: credentials.Value{
|
||||
AccessKeyID: access_key,
|
||||
SecretAccessKey: secret_key,
|
||||
SessionToken: session_token,
|
||||
}},
|
||||
&credentials.EnvProvider{},
|
||||
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ func TestS3Backend(t *testing.T) {
|
|||
b, err := NewBackend("s3", map[string]string{
|
||||
"access_key": creds.AccessKeyID,
|
||||
"secret_key": creds.SecretAccessKey,
|
||||
"session_token": creds.SessionToken,
|
||||
"bucket": bucket,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue