From 45e05d59fdc44b9454449d9114949421c1e8fccb Mon Sep 17 00:00:00 2001 From: jlestrada Date: Thu, 7 Apr 2022 07:52:50 -0700 Subject: [PATCH] aws auth displayName * set displayName to include RoleSessionName --- builtin/credential/aws/path_login.go | 5 +++++ changelog/14954.txt | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 changelog/14954.txt diff --git a/builtin/credential/aws/path_login.go b/builtin/credential/aws/path_login.go index 50cdd37d2568..fe70de0d06e8 100644 --- a/builtin/credential/aws/path_login.go +++ b/builtin/credential/aws/path_login.go @@ -1407,6 +1407,11 @@ func (b *backend) pathLoginUpdateIam(ctx context.Context, req *logical.Request, Name: identityAlias, }, } + + if entity.Type == "assumed-role" { + auth.DisplayName = strings.Join([]string{entity.FriendlyName, entity.SessionInfo}, "/") + } + roleEntry.PopulateTokenAuth(auth) if err := identityConfigEntry.IAMAuthMetadataHandler.PopulateDesiredMetadata(auth, map[string]string{ "client_arn": callerID.Arn, diff --git a/changelog/14954.txt b/changelog/14954.txt new file mode 100644 index 000000000000..fc8be705694e --- /dev/null +++ b/changelog/14954.txt @@ -0,0 +1,3 @@ +```release-note:change +auth/aws: Add RoleSession to DisplayName when using assumeRole for authentication +``` \ No newline at end of file