Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
23f9348e
Unverified
Commit
23f9348e
authored
Jul 13, 2021
by
Sergei Shvetsov
Committed by
GitHub
Jul 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(aws): allow for profile switch w/o MFA configured (#9924)
parent
e4f6f169
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
aws.plugin.zsh
plugins/aws/aws.plugin.zsh
+33
-33
No files found.
plugins/aws/aws.plugin.zsh
View file @
23f9348e
...
@@ -62,6 +62,7 @@ function acp() {
...
@@ -62,6 +62,7 @@ function acp() {
read
-r
sess_duration
read
-r
sess_duration
fi
fi
mfa_opt
=(
--serial-number
"
$mfa_serial
"
--token-code
"
$mfa_token
"
--duration-seconds
"
${
sess_duration
:-
3600
}
"
)
mfa_opt
=(
--serial-number
"
$mfa_serial
"
--token-code
"
$mfa_token
"
--duration-seconds
"
${
sess_duration
:-
3600
}
"
)
fi
# Now see whether we need to just MFA for the current role, or assume a different one
# Now see whether we need to just MFA for the current role, or assume a different one
local
role_arn
=
"
$(
aws configure get role_arn
--profile
$profile
)
"
local
role_arn
=
"
$(
aws configure get role_arn
--profile
$profile
)
"
...
@@ -103,7 +104,6 @@ function acp() {
...
@@ -103,7 +104,6 @@ function acp() {
aws_secret_access_key
=
"
${
credentials
[2]
}
"
aws_secret_access_key
=
"
${
credentials
[2]
}
"
aws_session_token
=
"
${
credentials
[3]
}
"
aws_session_token
=
"
${
credentials
[3]
}
"
fi
fi
fi
# Switch to AWS profile
# Switch to AWS profile
if
[[
-n
"
${
aws_access_key_id
}
"
&&
-n
"
$aws_secret_access_key
"
]]
;
then
if
[[
-n
"
${
aws_access_key_id
}
"
&&
-n
"
$aws_secret_access_key
"
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment