Skip to content

Commit afb521c

Browse files
author
Long Nguyen
committed
Renaming to assume_role_arn, it's more descriptive and added to readme
Signed-off-by: Long Nguyen <nguyenlo@vmware.com>
1 parent 705e4d9 commit afb521c

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ bucket.
5858
* `secret_access_key`: *Required.* The AWS secret key to use when accessing
5959
the bucket.
6060

61+
* `assume_role_arn`: *Optional.* The AWS role to assume when using access keys.
62+
6163
* `session_token`: *Optional.* The AWS session token to use when accessing
6264
the bucket.
6365

driver/driver.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ func FromSource(source models.Source) (Driver, error) {
7676
s3Session := session.New(awsConfig)
7777

7878
var s3Client *s3.S3
79-
if source.RoleArn != "" {
80-
creds := stscreds.NewCredentials(s3Session, source.RoleArn)
79+
if source.AssumeRoleArn != "" {
80+
creds := stscreds.NewCredentials(s3Session, source.AssumeRoleArn)
8181
s3Client = s3.New(s3Session, &aws.Config{Credentials: creds})
8282
} else {
8383
s3Client = s3.New(s3Session)
@@ -102,15 +102,15 @@ func FromSource(source models.Source) (Driver, error) {
102102
return &GitDriver{
103103
InitialVersion: initialVersion,
104104

105-
URI: source.URI,
106-
Branch: source.Branch,
107-
PrivateKey: source.PrivateKey,
108-
Username: source.Username,
109-
Password: source.Password,
110-
File: source.File,
111-
GitUser: source.GitUser,
112-
CommitMessage: source.CommitMessage,
113-
SkipSSLVerification: source.SkipSSLVerification,
105+
URI: source.URI,
106+
Branch: source.Branch,
107+
PrivateKey: source.PrivateKey,
108+
Username: source.Username,
109+
Password: source.Password,
110+
File: source.File,
111+
GitUser: source.GitUser,
112+
CommitMessage: source.CommitMessage,
113+
SkipSSLVerification: source.SkipSSLVerification,
114114
}, nil
115115

116116
case models.DriverSwift:

models/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type Source struct {
6262
Key string `json:"key"`
6363
AccessKeyID string `json:"access_key_id"`
6464
SecretAccessKey string `json:"secret_access_key"`
65-
RoleArn string `json:"role_arn"`
65+
AssumeRoleArn string `json:"assume_role_arn"`
6666
SessionToken string `json:"session_token"`
6767
RegionName string `json:"region_name"`
6868
Endpoint string `json:"endpoint"`

0 commit comments

Comments
 (0)