Skip to content

Commit

Permalink
allow non-root roles
Browse files Browse the repository at this point in the history
  • Loading branch information
greenpau committed Apr 22, 2020
1 parent d124ad2 commit a3844a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/client/adfs_saml_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ func ParseAwsRole(s string) (*AwsRole, error) {
}
r.AccountID = roleParts[4]
roleNameParts := strings.Split(roleParts[5], "/")
if len(roleNameParts) != 2 {
return &r, fmt.Errorf("the passed Role name does not match expected format (%d parts): role/<role_name>", len(roleNameParts))
if len(roleNameParts) < 2 {
return &r, fmt.Errorf("the passed Role name does not match expected format: role/*<role_name>")
}
r.Name = roleNameParts[1]
r.Name = roleNameParts[len(roleNameParts)-1]
return &r, nil
}

Expand Down

0 comments on commit a3844a7

Please # to comment.