Skip to content

Commit

Permalink
Replace public-read ACL integ test with private (#3723)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Apr 22, 2021
1 parent 0960b8c commit 7ef026a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
9 changes: 5 additions & 4 deletions features/s3/objects.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ Feature: Working with Objects in S3
Then the object "byebye" should contain "world"
Then I delete the object "byebye"

@unauthenticated
Scenario: Unauthenticated requests
When I put "world" to the public key "hello"
And I make an unauthenticated request to read object "hello"
@private
Scenario: Private ACL
When I put "world" to the private key "hello"
Then I get the object "hello"
Then the object "hello" should contain "world"
Then I delete the object "hello"

@blank
Scenario: Putting nothing to an object
Expand Down
16 changes: 2 additions & 14 deletions features/s3/step_definitions/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ module.exports = function () {
req.send(callback);
});

this.When(/^I put "([^"]*)" to the (public|private) key "([^"]*)"$/, function(data, access, key, next) {
var acl;
if (access === 'public') acl = 'public-read';
else if (access === 'private') acl = access;
var params = {Bucket: this.sharedBucket, Key: key, Body: data, ACL: acl};
this.When(/^I put "([^"]*)" to the private key "([^"]*)"$/, function(data, key, next) {
var params = {Bucket: this.sharedBucket, Key: key, Body: data, ACL: 'private'};
this.request('s3', 'putObject', params, next);
});

Expand All @@ -275,15 +272,6 @@ module.exports = function () {
this.request('s3', 'getObject', params, next);
});

this.Then(/^I make an unauthenticated request to read object "([^"]*)"$/, function(key, next) {
var params = {Bucket: this.sharedBucket, Key: key};
this.s3.makeUnauthenticatedRequest('getObject', params, function (err, data) {
if (err) return next(err);
this.data = data;
next();
}.bind(this));
});

this.Given(/^I generate the MD5 checksum of "([^"]*)"$/, function(data, next) {
this.sentContentMD5 = this.AWS.util.crypto.md5(data, 'base64');
next();
Expand Down

0 comments on commit 7ef026a

Please sign in to comment.