Skip to content

Commit

Permalink
Annoyingly login doesn't work without source_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed Dec 11, 2016
1 parent 53e5850 commit 8305a52
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 8305a52

Please sign in to comment.