Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite recursion issue for missing/invalid profile #575

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,23 @@ sso_role_name=Administrator

This profile should work expected with AWS Vault commands, e.g. `exec` and `login`. See [Basic Usage](#basic-usage) for more information.

## Development
## Local Development
Have [go installed](https://golang.org/doc/install?download=go1.14.1.darwin-amd64.pkg)

The [macOS release builds](https://github.com/99designs/aws-vault/releases) are code-signed to avoid extra prompts in Keychain. You can verify this with:

$ codesign --verify --verbose $(which aws-vault)

If you are developing or compiling the aws-vault binary yourself, you can [generate a self-signed certificate](https://support.apple.com/en-au/guide/keychain-access/kyca8916/mac) by accessing Keychain Access > Certificate Assistant > Create Certificate > Code Signing Certificate. You can then sign your binary with:
If you are developing or compiling the aws-vault binary yourself, you can [generate a self-signed certificate](https://support.apple.com/en-au/guide/keychain-access/kyca8916/mac) by accessing Keychain Access > Certificate Assistant > Create Certificate
The certificate 'Name' can be whatever; the 'Identity Type' can be the default; for Certificate Type choose 'Code Signing'; hit create.

You can then sign your binary with:

$ go build .
$ codesign --sign "Name of my certificate" ./aws-vault
$ codesign --sign <Name of certificate created above> ./aws-vault
$ go run main.go # should work if everything was configured correctly

`go run main.go` is the local equivalent of running `aws-vault`

## References and Inspiration

Expand Down
3 changes: 3 additions & 0 deletions vault/credentialkeyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func (ck *CredentialKeyring) CredentialsKeys() (credentialsNames []string, err e
}

func (ck *CredentialKeyring) Has(credentialsName string) (bool, error) {
if credentialsName == "" {
return false, fmt.Errorf("Error finding credentials")
}
allKeys, err := ck.Keyring.Keys()
if err != nil {
return false, err
Expand Down