Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

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

Merged
nitisht merged 1 commit into
minio:masterfrom
nitisht:php-anon-delete
Aug 17, 2017
Merged

Add test case to validate if anonymous delete request returns 200#116
nitisht merged 1 commit into
minio:masterfrom
nitisht:php-anon-delete

Conversation

@nitisht

@nitisht nitisht commented Aug 16, 2017

Copy link
Copy Markdown
Contributor

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

@krisis krisis left a comment

Copy link
Copy Markdown
Member

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)

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

nitisht commented Aug 16, 2017

Copy link
Copy Markdown
Contributor Author

Done @krisis

@krisis krisis left a comment

Copy link
Copy Markdown
Member

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants