Skip to content

Commit

Permalink
Merge pull request #105 from 99designs/error-when-using-login-for-non…
Browse files Browse the repository at this point in the history
…-assumed-role-profiles

Show error when using a profile without source_profile
  • Loading branch information
mtibben committed Dec 11, 2016
2 parents 3b79eb1 + 8305a52 commit 658b48f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions login.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ func LoginCommand(app *kingpin.Application, input LoginCommandInput) {
return
}

if profileConfig, ok := profiles[input.Profile]; ok {
if _, hasSourceProfile := profileConfig["source_profile"]; !hasSourceProfile {
app.Fatalf("Login only works for profiles that use AssumeRole")
return
}
}

provider, err := NewVaultProvider(input.Keyring, input.Profile, VaultOptions{
AssumeRoleDuration: input.AssumeRoleDuration,
MfaToken: input.MfaToken,
Expand Down

0 comments on commit 658b48f

Please sign in to comment.