Skip to content

Commit

Permalink
Update help message
Browse files Browse the repository at this point in the history
  • Loading branch information
mtibben committed Mar 17, 2023
1 parent 471968f commit 9a3590b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cli/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,18 @@ func ConfigureGlobals(app *kingpin.Application) *AwsVault {
app.Flag("prompt", fmt.Sprintf("Prompt driver to use %v", promptsAvailable)).
Envar("AWS_VAULT_PROMPT").
StringVar(&a.promptDriver)
app.PreAction(func(c *kingpin.ParseContext) error {
value := a.promptDriver
if value == "" {

app.Validate(func(app *kingpin.Application) error {
if a.promptDriver == "" {
return nil
}
if value == "pass" {
kingpin.Fatalf(
"--prompt=pass / AWS_VAULT_PROMPT=pass has been removed in v7.0.0 for security reasons." +
"\nSee https://github.com/99designs/aws-vault/pull/1006#issuecomment-1233508808 for details." +
"\nIf you wish to continue using it, " +
"add `mfa_process = pass otp <your mfa_serial>` to profiles in your ~/.aws/config file.")
if a.promptDriver == "pass" {
kingpin.Fatalf("--prompt=pass (or AWS_VAULT_PROMPT=pass) has been removed from aws-vault as using TOTPs without " +
"a dedicated device goes against security best practices. If you wish to continue using pass, " +
"add `mfa_process = pass otp <your mfa_serial>` to profiles in your ~/.aws/config file.")
}
for _, v := range promptsAvailable {
if v == value {
if v == a.promptDriver {
return nil
}
}
Expand Down

0 comments on commit 9a3590b

Please sign in to comment.