bucket policy: Support for '?' wildcard. (#2353)

- Support for '?' wildcard for resource matching.

- Wildcard package is added with Match functions.

- Wildcard.Match supports '*' and wild.MatchExtended supports both '*'
  and '?' wildcards in the pattern string.

- Tests for the same for the wide range of cases.
This commit is contained in:
karthic rao authored and Harshavardhana committed 2016-08-04 00:41:32 -07:00
1 parent cc0d5b6fe0
commit 2e0742e309
5 files changed
+661 -103

No files matched your search

+2 -1
View File
@@ -23,6 +23,7 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/minio/minio/pkg/wildcard"
)
const (
@@ -85,7 +86,7 @@ func isElasticQueue(sqsArn arnMinioSqs) bool {
// Match function matches wild cards in 'pattern' for events.
func eventMatch(eventType EventName, events []string) (ok bool) {
for _, event := range events {
ok = wildCardMatch(event, eventType.String())
ok = wildcard.Match(event, eventType.String())
if ok {
break
}