pkg/wildcard: Simplify the wildcard logic further. (#2555)

This commit is contained in:
Harshavardhana
2016-08-27 00:27:17 -07:00
committed by GitHub
parent b67c8970c9
commit 7270ca4157
4 changed files with 85 additions and 116 deletions

View File

@@ -70,12 +70,12 @@ func bucketPolicyActionMatch(action string, statement policyStatement) bool {
// Match function matches wild cards in 'pattern' for resource.
func resourceMatch(pattern, resource string) bool {
return wildcard.MatchExtended(pattern, resource)
return wildcard.Match(pattern, resource)
}
// Match function matches wild cards in 'pattern' for action.
func actionMatch(pattern, action string) bool {
return wildcard.Match(pattern, action)
return wildcard.MatchSimple(pattern, action)
}
// Verify if given resource matches with policy statement.

View File

@@ -114,7 +114,7 @@ func isElasticQueue(sqsArn arnSQS) bool {
// Match function matches wild cards in 'pattern' for events.
func eventMatch(eventType string, events []string) (ok bool) {
for _, event := range events {
ok = wildcard.Match(event, eventType)
ok = wildcard.MatchSimple(event, eventType)
if ok {
break
}