From aa2604ba6867154bf570f2adaca4856e07851b91 Mon Sep 17 00:00:00 2001 From: vishalnayak Date: Thu, 29 Mar 2018 20:17:00 -0400 Subject: [PATCH] reintroduce flagMFA --- command/base.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/command/base.go b/command/base.go index 45169e4bafba..f86f8b622d8e 100644 --- a/command/base.go +++ b/command/base.go @@ -43,6 +43,8 @@ type BaseCommand struct { flagFormat string flagField string + flagMFA []string + tokenHelper token.TokenHelper client *api.Client @@ -109,6 +111,8 @@ func (c *BaseCommand) Client() (*api.Client, error) { client.SetToken(token) } + client.SetMFACreds(c.flagMFA) + c.client = client return client, nil @@ -257,6 +261,15 @@ func (c *BaseCommand) flagSet(bit FlagSetBit) *FlagSets { "The TTL is specified as a numeric string with suffix like \"30s\" " + "or \"5m\".", }) + + f.StringSliceVar(&StringSliceVar{ + Name: "mfa", + Target: &c.flagMFA, + Default: nil, + EnvVar: api.EnvVaultMFA, + Completion: complete.PredictAnything, + Usage: "Supply MFA credentials as part of X-Vault-MFA header.", + }) } if bit&(FlagSetOutputField|FlagSetOutputFormat) != 0 {