diff options
author | Mike Mattice <mmattice@users.noreply.github.com> | 2022-01-19 08:58:34 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 15:58:34 +0100 |
commit | fe9d87d6dc2f3e6194862799b0707f97844e83ac (patch) | |
tree | b42f3fdb728af22145e2cc7ab5be7c05218f4bc5 /plugins/aws/aws.plugin.zsh | |
parent | 22c11da108764336d92d03d3113c1f486cdb5911 (diff) | |
download | zsh-fe9d87d6dc2f3e6194862799b0707f97844e83ac.tar.gz zsh-fe9d87d6dc2f3e6194862799b0707f97844e83ac.tar.bz2 zsh-fe9d87d6dc2f3e6194862799b0707f97844e83ac.zip |
feat(aws): accept aws mfa tokencode on `acp` cli call (#10130)
Co-authored-by: Mike Mattice <mmattice@reliant.io>
Diffstat (limited to 'plugins/aws/aws.plugin.zsh')
-rw-r--r-- | plugins/aws/aws.plugin.zsh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index c18bd634b..920a7139d 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -45,6 +45,7 @@ function acp() { fi local profile="$1" + local mfa_token="$2" # Get fallback credentials for if the aws command fails or no command is run local aws_access_key_id="$(aws configure get aws_access_key_id --profile $profile)" @@ -58,9 +59,10 @@ function acp() { if [[ -n "$mfa_serial" ]]; then local -a mfa_opt - local mfa_token - echo -n "Please enter your MFA token for $mfa_serial: " - read -r mfa_token + if [[ -z "$mfa_token" ]]; then + echo -n "Please enter your MFA token for $mfa_serial: " + read -r mfa_token + fi if [[ -z "$sess_duration" ]]; then echo -n "Please enter the session duration in seconds (900-43200; default: 3600, which is the default maximum for a role): " read -r sess_duration |