api: BucketNotification should disallow duplicate notification. (#2539)

Added checks to look for duplicated notification configs.

Fixes #2472
This commit is contained in:
Harshavardhana
2016-08-23 18:42:30 -07:00
committed by GitHub
parent c39d3db7a0
commit ec4260d260
6 changed files with 113 additions and 43 deletions
+10 -13
View File
@@ -32,33 +32,30 @@ type keyFilter struct {
FilterRules []filterRule `xml:"FilterRule,omitempty"`
}
// Queue SQS configuration.
type queueConfig struct {
// Common elements of service notification.
type serviceConfig struct {
Events []string `xml:"Event"`
Filter struct {
Key keyFilter `xml:"S3Key,omitempty"`
}
ID string `xml:"Id"`
ID string `xml:"Id"`
}
// Queue SQS configuration.
type queueConfig struct {
serviceConfig
QueueARN string `xml:"Queue"`
}
// Topic SNS configuration, this is a compliance field not used by minio yet.
type topicConfig struct {
Events []string `xml:"Event"`
Filter struct {
Key keyFilter `xml:"S3Key"`
}
ID string `xml:"Id"`
serviceConfig
TopicARN string `xml:"Topic"`
}
// Lambda function configuration, this is a compliance field not used by minio yet.
type lambdaConfig struct {
Events []string `xml:"Event"`
Filter struct {
Key keyFilter `xml:"S3Key,omitempty"`
}
ID string `xml:"Id"`
serviceConfig
LambdaARN string `xml:"CloudFunction"`
}