mirror of
https://github.com/minio/minio.git
synced 2026-11-30 15:37:48 +00:00
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:
1 parent
cc0d5b6fe0
commit
2e0742e309
5 files changed
+661
-103
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user