New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: fix get bucket policy s3 compatible issue #15280

Merged
merged 1 commit into from Jun 13, 2017

Conversation

Projects
None yet
3 participants
@ZVampirEM77
Contributor

ZVampirEM77 commented May 25, 2017

In AWS S3 get bucket policy should return 404 error code when bucket policy does not exist like following:

Response: {'status': 404, 'headers': {'x-amz-id-2': 'Gncp2wjrOy2Juy0RFbuyWjGFCFNSQd8vXIi8sbxhSdR7bi4VmjSlbmRKkUr3dK3+tmewATJSwZw=', 'server': 'AmazonS3', 'transfer-encoding': 'chunked', 'x-amz-request-id': 'D3F18909B654014A', 'date': 'Thu, 25 May 2017 03:28:35 GMT', 'content-type': 'application/xml'}, 'reason': 'Not Found', 'data': '\nNoSuchBucketPolicyThe bucket policy does not existem-111D3F18909B654014AGncp2wjrOy2Juy0RFbuyWjGFCFNSQd8vXIi8sbxhSdR7bi4VmjSlbmRKkUr3dK3+tmewATJSwZw='}

Now RGW return is:

Response: {'status': 404, 'headers': {'date': 'Thu, 25 May 2017 06:38:48 GMT', 'content-length': '270', 'x-amz-request-id': 'tx00000000000000000000e-0059267bf8-1013-default', 'content-type': 'application/xml', 'accept-ranges': 'bytes'}, 'reason': 'Not Found', 'data': 'NoSuchBucketPolicyThe bucket policy does not exist111tx00000000000000000000e-0059267bf8-1013-default1013-default-default'}

Signed-off-by: Enming Zhang enming.zhang@umcloud.com

@adamemerson

Lions Groom Their Manes

@cbodley

This comment has been minimized.

Contributor

cbodley commented Jun 8, 2017

rgw: fix get bucket policy s3 compatible issue
In AWS S3 get bucket policy should return 404 error code when bucket policy does not exist like following:

Response: {'status': 404, 'headers': {'x-amz-id-2': 'Gncp2wjrOy2Juy0RFbuyWjGFCFNSQd8vXIi8sbxhSdR7bi4VmjSlbmRKkUr3dK3+tmewATJSwZw=', 'server': 'AmazonS3', 'transfer-encoding': 'chunked', 'x-amz-request-id': 'D3F18909B654014A', 'date': 'Thu, 25 May 2017 03:28:35 GMT', 'content-type': 'application/xml'}, 'reason': 'Not Found', 'data': '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>NoSuchBucketPolicy</Code><Message>The bucket policy does not exist</Message><BucketName>em-111</BucketName><RequestId>D3F18909B654014A</RequestId><HostId>Gncp2wjrOy2Juy0RFbuyWjGFCFNSQd8vXIi8sbxhSdR7bi4VmjSlbmRKkUr3dK3+tmewATJSwZw=</HostId></Error>'}

Now RGW return is:

Response: {'status': 404, 'headers': {'date': 'Thu, 25 May 2017 06:38:48 GMT', 'content-length': '270', 'x-amz-request-id': 'tx00000000000000000000e-0059267bf8-1013-default', 'content-type': 'application/xml', 'accept-ranges': 'bytes'}, 'reason': 'Not Found', 'data': '<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchBucketPolicy</Code><Message>The bucket policy does not exist</Message><BucketName>111</BucketName><RequestId>tx00000000000000000000e-0059267bf8-1013-default</RequestId><HostId>1013-default-default</HostId></Error>'}

Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
@ZVampirEM77

This comment has been minimized.

Contributor

ZVampirEM77 commented Jun 9, 2017

@cbodley OK, I have done it~

@cbodley

This comment has been minimized.

Contributor

cbodley commented Jun 9, 2017

jenkins test this please

1 similar comment
@cbodley

This comment has been minimized.

Contributor

cbodley commented Jun 12, 2017

jenkins test this please

@cbodley cbodley merged commit 40d8bc7 into ceph:master Jun 13, 2017

4 of 5 checks passed

default Build started sha1 is merged.
Details
Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment