Skip to content

Commit

Permalink
Scope Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish Bhat committed Jul 25, 2019
1 parent ad52f23 commit 8e7552c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/Token.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ func (token *JwtToken) isValidForScope(allowedScopes []string) bool {
if ok, _ := inArray(allowedScope, token.Scopes); !ok {
scopeParts := strings.Split(allowedScope, ":")
if ok, _ := inArray(scopeParts[0]+":*", token.Scopes); !ok {
allScopesMatched = false
if ok, _ := inArray("*:"+scopeParts[1], token.Scopes); !ok {
allScopesMatched = false
}
}
}
}
Expand Down

0 comments on commit 8e7552c

Please sign in to comment.