Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add MFA serial and token support #1124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

catz-lw
Copy link

@catz-lw catz-lw commented Jul 29, 2024

Resolves issue #184

Add an optional MFA device serial number and one-time token to the workflow inputs.

This PR has been tested with a role that requires MFA and thus run with a real-world serial number and tokens.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@catz-lw catz-lw changed the title Add mfa token feat: Add MFA serial and token support Jul 29, 2024
@catz-lw catz-lw marked this pull request as ready for review July 29, 2024 22:17
@@ -137,6 +141,8 @@ export async function assumeRole(params: assumeRoleParams) {
ExternalId: roleExternalId ? roleExternalId : undefined,
Policy: inlineSessionPolicy ? inlineSessionPolicy : undefined,
PolicyArns: managedSessionPolicies?.length ? managedSessionPolicies : undefined,
SerialNumber: mfaSerial,
Copy link
Author

@catz-lw catz-lw Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this project's style requires an explicit check for null here, as with the other parameters.

@@ -137,6 +141,8 @@ export async function assumeRole(params: assumeRoleParams) {
ExternalId: roleExternalId ? roleExternalId : undefined,
Policy: inlineSessionPolicy ? inlineSessionPolicy : undefined,
PolicyArns: managedSessionPolicies?.length ? managedSessionPolicies : undefined,
SerialNumber: mfaSerial,
TokenCode: mfaToken,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the meat of the PR, passing SerialNumber and TokenCode to AssumeRoleCommandInput:

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sts/Interface/AssumeRoleCommandInput/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant