Skip to content

Commit

Permalink
Add External ID parameter to AWS converter
Browse files Browse the repository at this point in the history
  • Loading branch information
artydeez authored Jan 25, 2022
1 parent 9bd2ccf commit 6422d1d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public AWSCredentialsImpl convert(Secret secret) throws CredentialsConvertionExc
if (iamMfaSerialNumberBase64.isPresent()) {
iamMfaSerialNumber = SecretUtils.requireNonNull(SecretUtils.base64DecodeToString(iamMfaSerialNumberBase64.get()), "aws credential has an invalid iamMfaSerialNumber (must be base64 encoded UTF-8)");
}

Optional<String> iamExternalIdBase64 = SecretUtils.getOptionalSecretData(secret, "iamExternalId", "aws credential: failed to retrieve optional parameter iamExternalId");
String iamExternalId = null;

if (iamExternalIdBase64.isPresent()) {
iamExternalId = SecretUtils.requireNonNull(SecretUtils.base64DecodeToString(iamExternalIdBase64.get()), "aws credential has an invalid iamExternalId (must be base64 encoded UTF-8)");
}

return new AWSCredentialsImpl(
// Scope
Expand All @@ -83,7 +90,9 @@ public AWSCredentialsImpl convert(Secret secret) throws CredentialsConvertionExc
// IAM Role ARN
iamRoleArn,
// MFA
iamMfaSerialNumber
iamMfaSerialNumber,
// External ID
iamExternalId
);

}
Expand Down

0 comments on commit 6422d1d

Please sign in to comment.