Skip to content
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

Add test case to validate if anonymous delete request returns 200 #116

Merged
merged 1 commit into from
Aug 17, 2017

Conversation

nitisht
Copy link
Contributor

@nitisht nitisht commented Aug 16, 2017

The test case validates the case where the requesting user does not have access to the bucket they are attempting to delete objects from and should receive a response 200 and an 'Access Denied' error for each object they are attempting to delete rather than the generic 403 AccessDenied error response.

AWS S3 reference doc: http://docs.aws.amazon.com/AmazonS3/latest/API/multiobjectdeleteapi.html#multiobjectdeleteapi-examples

Fixes: #115

Copy link
Member

@krisis krisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall changes look good to me. Couple of minor comments.

]);
// Response code should be 200
if (getstatuscode($result) != HTTP_OK)
throw new Exception('deleteObjects failed for ' .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we change the exception message to,

"deleteObjects returned incorrect response " . getStatusCode($result);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that is better.

if (getstatuscode($result) != HTTP_OK)
throw new Exception('deleteObjects api failed for ' .
$bucket);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we check if errors for each object is empty in the authenticated client test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The test case validates the case where the requesting user does
not have access to the bucket they are attempting to delete objects
from and should receive an 'Access Denied' error for each object
they are attempting to delete rather than the generic 403
AccessDenied error response.
@nitisht
Copy link
Contributor Author

nitisht commented Aug 16, 2017

Done @krisis

Copy link
Member

@krisis krisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nitisht nitisht merged commit 770979d into minio:master Aug 17, 2017
@nitisht nitisht deleted the php-anon-delete branch August 17, 2017 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants