We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7d0192 commit 1132401Copy full SHA for 1132401
aws_role.go
@@ -2,6 +2,7 @@ package saml2aws
2
3
import (
4
"fmt"
5
+ "regexp"
6
"strings"
7
)
8
@@ -29,7 +30,8 @@ func ParseAWSRoles(roles []string) ([]*AWSRole, error) {
29
30
}
31
32
func parseRole(role string) (*AWSRole, error) {
- tokens := strings.Split(role, ",")
33
+ r, _ := regexp.Compile("arn:([^:\n]*):([^:\n]*):([^:\n]*):([^:\n]*):(([^:/\n]*)[:/])?([^:,\n]*)")
34
+ tokens := r.FindAllString(role, -1)
35
36
if len(tokens) != 2 {
37
return nil, fmt.Errorf("Invalid role string only %d tokens", len(tokens))
0 commit comments