mirror of
https://github.com/minio/minio.git
synced 2026-02-08 03:40:15 -05:00
api: Bucket notification add filter rules check and validate. (#2272)
These filtering techniques are used to validate object names for their prefix and suffix.
This commit is contained in:
@@ -110,6 +110,10 @@ const (
|
||||
ErrARNNotification
|
||||
ErrRegionNotification
|
||||
ErrOverlappingFilterNotification
|
||||
ErrFilterNameInvalid
|
||||
ErrFilterNamePrefix
|
||||
ErrFilterNameSuffix
|
||||
ErrFilterPrefixValueInvalid
|
||||
|
||||
// S3 extended errors.
|
||||
ErrContentSHA256Mismatch
|
||||
@@ -438,6 +442,26 @@ var errorCodeResponse = map[APIErrorCode]APIError{
|
||||
Description: "An object key name filtering rule defined with overlapping prefixes, overlapping suffixes, or overlapping combinations of prefixes and suffixes for the same event types.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrFilterNameInvalid: {
|
||||
Code: "InvalidArgument",
|
||||
Description: "filter rule name must be either prefix or suffix",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrFilterNamePrefix: {
|
||||
Code: "InvalidArgument",
|
||||
Description: "Cannot specify more than one prefix rule in a filter.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrFilterNameSuffix: {
|
||||
Code: "InvalidArgument",
|
||||
Description: "Cannot specify more than one suffix rule in a filter.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrFilterPrefixValueInvalid: {
|
||||
Code: "InvalidArgument",
|
||||
Description: "prefix rule value cannot exceed 1024 characters",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
|
||||
/// S3 extensions.
|
||||
ErrContentSHA256Mismatch: {
|
||||
|
||||
Reference in New Issue
Block a user