|
|
@ -24,7 +24,7 @@ import ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// Action - policy action.
|
|
|
|
// Action - policy action.
|
|
|
|
// Refer https://docs.aws.amazon.com/IAM/latest/UserGuide/list_s3.html
|
|
|
|
// Refer https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html
|
|
|
|
// for more information about available actions.
|
|
|
|
// for more information about available actions.
|
|
|
|
type Action string |
|
|
|
type Action string |
|
|
|
|
|
|
|
|
|
|
@ -75,9 +75,6 @@ const ( |
|
|
|
// ListMultipartUploadPartsAction - ListParts Rest API action.
|
|
|
|
// ListMultipartUploadPartsAction - ListParts Rest API action.
|
|
|
|
ListMultipartUploadPartsAction = "s3:ListMultipartUploadParts" |
|
|
|
ListMultipartUploadPartsAction = "s3:ListMultipartUploadParts" |
|
|
|
|
|
|
|
|
|
|
|
// ListObjectsAction - ListObjects Rest API action exactly same behavior as ListBucketAction.
|
|
|
|
|
|
|
|
ListObjectsAction = "s3:ListObjects" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PutBucketNotificationAction - PutObjectNotification Rest API action.
|
|
|
|
// PutBucketNotificationAction - PutObjectNotification Rest API action.
|
|
|
|
PutBucketNotificationAction = "s3:PutBucketNotification" |
|
|
|
PutBucketNotificationAction = "s3:PutBucketNotification" |
|
|
|
|
|
|
|
|
|
|
@ -113,7 +110,7 @@ func (action Action) IsValid() bool { |
|
|
|
fallthrough |
|
|
|
fallthrough |
|
|
|
case ListBucketMultipartUploadsAction, ListenBucketNotificationAction: |
|
|
|
case ListBucketMultipartUploadsAction, ListenBucketNotificationAction: |
|
|
|
fallthrough |
|
|
|
fallthrough |
|
|
|
case ListMultipartUploadPartsAction, ListObjectsAction, PutBucketNotificationAction: |
|
|
|
case ListMultipartUploadPartsAction, PutBucketNotificationAction: |
|
|
|
fallthrough |
|
|
|
fallthrough |
|
|
|
case PutBucketPolicyAction, PutObjectAction: |
|
|
|
case PutBucketPolicyAction, PutObjectAction: |
|
|
|
return true |
|
|
|
return true |
|
|
@ -237,14 +234,6 @@ var actionConditionKeyMap = map[Action]condition.KeySet{ |
|
|
|
condition.AWSSourceIP, |
|
|
|
condition.AWSSourceIP, |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
ListObjectsAction: condition.NewKeySet( |
|
|
|
|
|
|
|
condition.S3Prefix, |
|
|
|
|
|
|
|
condition.S3Delimiter, |
|
|
|
|
|
|
|
condition.S3MaxKeys, |
|
|
|
|
|
|
|
condition.AWSReferer, |
|
|
|
|
|
|
|
condition.AWSSourceIP, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PutBucketNotificationAction: condition.NewKeySet( |
|
|
|
PutBucketNotificationAction: condition.NewKeySet( |
|
|
|
condition.AWSReferer, |
|
|
|
condition.AWSReferer, |
|
|
|
condition.AWSSourceIP, |
|
|
|
condition.AWSSourceIP, |
|
|
|