Skip to content

Commit 03d7ec0

Browse files
Merge remote-tracking branch 'origin/w/8.8/improvement/CLDSRV-621-backport-bucketownerid' into w/9.0/improvement/CLDSRV-621-backport-bucketownerid
2 parents 96a0315 + 3bd5761 commit 03d7ec0

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

lib/api/apiUtils/object/createAndStoreObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function createAndStoreObject(bucketName, bucketMD, objectKey, objMD, authInfo,
194194
metadataStoreParams.oldReplayId = objMD.uploadId;
195195
}
196196

197-
if (authInfo.getCanonicalID() != bucketMD.getOwner()) {
197+
if (authInfo.getCanonicalID() !== bucketMD.getOwner()) {
198198
metadataStoreParams.bucketOwnerId = bucketMD.getOwner();
199199
}
200200

tests/unit/api/multipartUpload.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,7 +2764,7 @@ describe('complete mpu with bucket policy', () => {
27642764
json.InitiateMultipartUploadResult.UploadId[0];
27652765
const md5Hash = crypto.createHash('md5').update(partBody);
27662766
const calculatedHash = md5Hash.digest('hex');
2767-
const partRequest = new DummyRequest({
2767+
const partRequest = new DummyRequest(Object.assign({
27682768
bucketName,
27692769
namespace,
27702770
objectKey,
@@ -2786,7 +2786,7 @@ describe('complete mpu with bucket policy', () => {
27862786
socket: {
27872787
remoteAddress: '1.1.1.1',
27882788
},
2789-
}, partBody);
2789+
}, requestFix), partBody);
27902790
objectPutPart(authInfoOtherAcc, partRequest, undefined, log, err => {
27912791
assert.ifError(err);
27922792
const completeBody = '<CompleteMultipartUpload>' +
@@ -2795,7 +2795,7 @@ describe('complete mpu with bucket policy', () => {
27952795
`<ETag>"${calculatedHash}"</ETag>` +
27962796
'</Part>' +
27972797
'</CompleteMultipartUpload>';
2798-
const completeRequest = {
2798+
const completeRequest = new DummyRequest(Object.assign({
27992799
bucketName,
28002800
namespace,
28012801
objectKey,
@@ -2808,7 +2808,7 @@ describe('complete mpu with bucket policy', () => {
28082808
socket: {
28092809
remoteAddress: '1.1.1.1',
28102810
},
2811-
};
2811+
}, requestFix));
28122812
completeMultipartUpload(authInfoOtherAcc,
28132813
completeRequest, log, err => {
28142814
assert.ifError(err);

tests/unit/api/objectCopy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe('objectCopy with versioning', () => {
141141
metadata.putObjectMD.lastCall,
142142
destBucketName,
143143
objectKey,
144-
sinon.match({ _data: { bucketOwnerId: sinon.match.typeOf('undefined') }}),
144+
sinon.match({ _data: { bucketOwnerId: sinon.match.typeOf('undefined') } }),
145145
sinon.match.any,
146146
sinon.match.any,
147147
sinon.match.any
@@ -171,7 +171,7 @@ describe('objectCopy with versioning', () => {
171171
Principal: { AWS: `arn:aws:iam::${authInfo2.shortid}:root` },
172172
Action: ['s3:GetObject'],
173173
Resource: [
174-
`arn:aws:s3:::${sourceBucketName}/*`
174+
`arn:aws:s3:::${sourceBucketName}/*`,
175175
],
176176
},
177177
],
@@ -192,7 +192,7 @@ describe('objectCopy with versioning', () => {
192192
Principal: { AWS: `arn:aws:iam::${authInfo2.shortid}:root` },
193193
Action: ['s3:PutObject'],
194194
Resource: [
195-
`arn:aws:s3:::${destBucketName}/*`
195+
`arn:aws:s3:::${destBucketName}/*`,
196196
],
197197
},
198198
],
@@ -208,14 +208,14 @@ describe('objectCopy with versioning', () => {
208208
metadata.putObjectMD.lastCall,
209209
destBucketName,
210210
objectKey,
211-
sinon.match({_data: { bucketOwnerId: authInfo.canonicalID }}),
211+
sinon.match({ _data: { bucketOwnerId: authInfo.canonicalID } }),
212212
sinon.match.any,
213213
sinon.match.any,
214214
sinon.match.any
215215
);
216216
assert.ifError(err);
217217
done();
218-
});
218+
});
219219
});
220220
});
221221
});

tests/unit/api/objectPut.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ describe('objectPut API', () => {
775775
}, postBody);
776776

777777
bucketPut(authInfo, testPutBucketRequest, log, () => {
778-
objectPut(authInfo, testPutObjectRequest, undefined, log,
778+
objectPut(authInfo, testPutObjectRequest, undefined, log,
779779
err => {
780780
assert.ifError(err);
781781
sinon.assert.calledWith(metadata.putObjectMD.lastCall,

0 commit comments

Comments
 (0)