Skip to content

Commit

Permalink
Use md5 hash for session name when assuming Org Role in new backplane…
Browse files Browse the repository at this point in the history
… flow
  • Loading branch information
AlexVulaj committed Apr 1, 2024
1 parent ee590bd commit a2a5e1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ocm-backplane/cloud/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
const (
OldFlowSupportRole = "role/RH-Technical-Support-Access"
CustomerRoleArnName = "Target-Role-Arn"
OrgRoleArnName = "Org-Role-Arn"
)

var StsClient = awsutil.StsClient
Expand Down Expand Up @@ -293,7 +294,7 @@ func (cfg *QueryConfig) getIsolatedCredentials(ocmToken string) (aws.Credentials
assumeRoleArnSessionSequence := make([]awsutil.RoleArnSession, 0, len(roleChainResponse.AssumptionSequence))
for _, namedRoleArnEntry := range roleChainResponse.AssumptionSequence {
roleArnSession := awsutil.RoleArnSession{RoleArn: namedRoleArnEntry.Arn}
if namedRoleArnEntry.Name == CustomerRoleArnName {
if namedRoleArnEntry.Name == CustomerRoleArnName || namedRoleArnEntry.Name == OrgRoleArnName {
roleArnSession.RoleSessionName = roleChainResponse.CustomerRoleSessionName
} else {
roleArnSession.RoleSessionName = email
Expand Down

0 comments on commit a2a5e1f

Please sign in to comment.