Skip to content

Commit

Permalink
aws auth displayName (#14954)
Browse files Browse the repository at this point in the history
* set displayName to include RoleSessionName
  • Loading branch information
jlestrada authored and Matt Schultz committed Apr 27, 2022
1 parent 6bfa72a commit 7490f3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/credential/aws/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions changelog/14954.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:change
auth/aws: Add RoleSession to DisplayName when using assumeRole for authentication
```

0 comments on commit 7490f3e

Please sign in to comment.