Skip to content

Commit 5a4b131

Browse files
committed
Squash commit of 99designs/master e22aea1
1 parent f230b59 commit 5a4b131

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2178
-893
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/stale.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/go.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
name: Continuous Integration
2-
32
on:
43
push:
54
pull_request:
65
branches:
7-
- master
6+
- master
7+
permissions:
8+
contents: read
89

910
jobs:
10-
11-
build:
12-
name: Build
11+
test:
12+
name: test
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
1316
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: '1.20'
21+
- uses: actions/checkout@v3
22+
- name: Run tests
23+
run: go test -race ./...
24+
lint:
25+
permissions:
26+
contents: read # for actions/checkout to fetch code
27+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
28+
name: lint
1429
strategy:
1530
matrix:
16-
os: [ubuntu-latest, macOS-latest]
17-
31+
os: [macos-latest, ubuntu-latest]
32+
runs-on: ${{ matrix.os }}
1833
steps:
19-
20-
- name: Set up Go 1.17
21-
uses: actions/setup-go@v2.2.0
22-
with:
23-
go-version: 1.17
24-
id: go
25-
26-
- name: Check out code into the Go module directory
27-
uses: actions/checkout@v2.4.0
28-
29-
- name: Run tests
30-
run: go test -race ./...
31-
32-
- name: Check go vet
33-
run: go vet ./...
34-
35-
- name: Check go fmt
36-
run: diff -u <(echo -n) <(gofmt -s -d .)
34+
- uses: actions/setup-go@v3
35+
with:
36+
go-version: '1.20'
37+
- uses: actions/checkout@v3
38+
- name: golangci-lint
39+
uses: golangci/golangci-lint-action@v3.4.0
40+
with:
41+
version: v1.52.0

.github/workflows/stale.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://github.com/actions/stale
2+
name: Mark and close stale issues
3+
on:
4+
schedule:
5+
- cron: '15 10 * * *'
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
steps:
12+
- uses: actions/stale@v7
13+
with:
14+
days-before-stale: 180
15+
days-before-close: 7
16+
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.'
17+
exempt-issue-labels: pinned,security,feature

.golangci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
linters:
2+
enable:
3+
- bodyclose
4+
- contextcheck
5+
- depguard
6+
- durationcheck
7+
- dupl
8+
- errchkjson
9+
- errname
10+
- exhaustive
11+
- exportloopref
12+
- gofmt
13+
- goimports
14+
- makezero
15+
- misspell
16+
- nakedret
17+
- nilerr
18+
- nilnil
19+
- noctx
20+
- prealloc
21+
- revive
22+
# - rowserrcheck
23+
- thelper
24+
- tparallel
25+
- unconvert
26+
- unparam
27+
# - wastedassign
28+
- whitespace

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ You can install AWS Vault:
1919
- on Windows with [Scoop](https://scoop.sh/): `scoop install aws-vault`
2020
- on Linux with [Homebrew on Linux](https://formulae.brew.sh/formula/aws-vault): `brew install aws-vault`
2121
- on [Arch Linux](https://www.archlinux.org/packages/community/x86_64/aws-vault/): `pacman -S aws-vault`
22+
- on [Gentoo Linux](https://github.com/gentoo/guru/tree/master/app-admin/aws-vault): `emerge --ask app-admin/aws-vault` ([enable Guru first](https://wiki.gentoo.org/wiki/Project:GURU/Information_for_End_Users))
2223
- on [FreeBSD](https://www.freshports.org/security/aws-vault/): `pkg install aws-vault`
2324
- on [OpenSUSE](https://software.opensuse.org/package/aws-vault): enable devel:languages:go repo then `zypper install aws-vault`
24-
- with [Nix](https://nixos.org/nixos/packages.html?attr=aws-vault): `nix-env -i aws-vault`
25+
- with [Nix](https://search.nixos.org/packages?show=aws-vault&query=aws-vault): `nix-env -i aws-vault`
2526
- with [asdf-vm](https://github.com/karancode/asdf-aws-vault): `asdf plugin-add aws-vault https://github.com/karancode/asdf-aws-vault.git && asdf install aws-vault <version>`
2627

2728
## Documentation
@@ -62,6 +63,13 @@ $ aws-vault list
6263
Profile Credentials Sessions
6364
======= =========== ========
6465
jonsmith jonsmith -
66+
67+
# Start a subshell with temporary credentials
68+
$ aws-vault exec jonsmith
69+
Starting subshell /bin/zsh, use `exit` to exit the subshell
70+
$ aws s3 ls
71+
bucket_1
72+
bucket_2
6573
```
6674

6775
## How it works
@@ -79,10 +87,17 @@ AWS Vault then exposes the temporary credentials to the sub-process in one of tw
7987
AWS_ACCESS_KEY_ID=%%%
8088
AWS_SECRET_ACCESS_KEY=%%%
8189
AWS_SESSION_TOKEN=%%%
82-
AWS_SECURITY_TOKEN=%%%
83-
AWS_SESSION_EXPIRATION=2020-04-16T11:16:27Z
90+
AWS_CREDENTIAL_EXPIRATION=2020-04-16T11:16:27Z
91+
```
92+
2. **Local metadata server** is started. This approach has the advantage that anything that uses Amazon's SDKs will automatically refresh credentials as needed, so session times can be as short as possible.
93+
```shell
94+
$ aws-vault exec --server jonsmith -- env | grep AWS
95+
AWS_VAULT=jonsmith
96+
AWS_DEFAULT_REGION=us-east-1
97+
AWS_REGION=us-east-1
98+
AWS_CONTAINER_CREDENTIALS_FULL_URI=%%%
99+
AWS_CONTAINER_AUTHORIZATION_TOKEN=%%%
84100
```
85-
2. **Local [EC2 Instance Metadata server](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)** is started. This approach has the advantage that anything that uses Amazon's SDKs will automatically refresh credentials as needed, so session times can be as short as possible. The downside is that only one can run per host and because it binds to `169.254.169.254:80`, your sudo password is required.
86101

87102
The default is to use environment variables, but you can opt-in to the local instance metadata server with the `--server` flag on the `exec` command.
88103

0 commit comments

Comments
 (0)