Skip to content

Commit

Permalink
Add --no-session to login
Browse files Browse the repository at this point in the history
  • Loading branch information
mtibben committed Jan 22, 2020
1 parent a6c2a7c commit a23e9fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func ConfigureExecCommand(app *kingpin.Application) {
Short('d').
DurationVar(&input.SessionDuration)

cmd.Flag("no-session", "Don't create a session with GetSessionToken").
cmd.Flag("no-session", "Skip creating STS session with GetSessionToken").
Short('n').
BoolVar(&input.NoSession)

Expand Down
7 changes: 7 additions & 0 deletions cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type LoginCommandInput struct {
Path string
Config vault.Config
SessionDuration time.Duration
NoSession bool
}

func ConfigureLoginCommand(app *kingpin.Application) {
Expand All @@ -34,6 +35,10 @@ func ConfigureLoginCommand(app *kingpin.Application) {
Short('d').
DurationVar(&input.SessionDuration)

cmd.Flag("no-session", "Skip creating STS session with GetSessionToken").
Short('n').
BoolVar(&input.NoSession)

cmd.Flag("mfa-token", "The MFA token to use").
Short('t').
StringVar(&input.Config.MfaToken)
Expand Down Expand Up @@ -63,6 +68,8 @@ func ConfigureLoginCommand(app *kingpin.Application) {
}

func LoginCommand(input LoginCommandInput) error {
vault.UseSession = !input.NoSession

configLoader.BaseConfig = input.Config
configLoader.ActiveProfile = input.ProfileName
config, err := configLoader.LoadFromProfile(input.ProfileName)
Expand Down

0 comments on commit a23e9fd

Please sign in to comment.