From 3d10b62ae585cc0a9ccd222e3f613dd261c4c272 Mon Sep 17 00:00:00 2001 From: Guy Rozendorn Date: Tue, 3 Aug 2021 22:11:25 +0300 Subject: [PATCH 1/2] add support for session token --- cli/add.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/add.go b/cli/add.go index 67adca542..fd1b57479 100644 --- a/cli/add.go +++ b/cli/add.go @@ -50,7 +50,7 @@ func ConfigureAddCommand(app *kingpin.Application, a *AwsVault) { } func AddCommand(input AddCommandInput, keyring keyring.Keyring, awsConfigFile *vault.ConfigFile) error { - var accessKeyId, secretKey string + var accessKeyId, secretKey, sessionToken string p, _ := awsConfigFile.ProfileSection(input.ProfileName) if p.SourceProfile != "" { @@ -65,6 +65,9 @@ func AddCommand(input AddCommandInput, keyring keyring.Keyring, awsConfigFile *v if secretKey = os.Getenv("AWS_SECRET_ACCESS_KEY"); secretKey == "" { return fmt.Errorf("Missing value for AWS_SECRET_ACCESS_KEY") } + if sessionToken = os.Getenv("AWS_SESSION_TOKEN"); sessionToken == "" { + return fmt.Errorf("Missing value for AWS_SESSION_TOKEN") + } } else { var err error if accessKeyId, err = prompt.TerminalPrompt("Enter Access Key ID: "); err != nil { @@ -75,7 +78,7 @@ func AddCommand(input AddCommandInput, keyring keyring.Keyring, awsConfigFile *v } } - creds := aws.Credentials{AccessKeyID: accessKeyId, SecretAccessKey: secretKey} + creds := aws.Credentials{AccessKeyID: accessKeyId, SecretAccessKey: secretKey, SessionToken: sessionToken} ckr := &vault.CredentialKeyring{Keyring: keyring} if err := ckr.Set(input.ProfileName, creds); err != nil { From ea4c504c74617b96c4126b2357c0cad1c59a17b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 01:12:16 +0000 Subject: [PATCH 2/2] Bump actions/setup-go from 2.2.0 to 4.1.0 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.2.0 to 4.1.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2.2.0...v4.1.0) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4bbf18bce..6a84a89a1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Set up Go 1.17 - uses: actions/setup-go@v2.2.0 + uses: actions/setup-go@v4.1.0 with: go-version: 1.17 id: go