Skip to content

INTEGRATION [PR#5832 > development/9.0] Backport CLDSRV-621: Support bucket owner #5834

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/api/apiUtils/object/createAndStoreObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function createAndStoreObject(bucketName, bucketMD, objectKey, objMD, authInfo,
metadataStoreParams.oldReplayId = objMD.uploadId;
}

if (authInfo.getCanonicalID() != bucketMD.getOwner()) {
if (authInfo.getCanonicalID() !== bucketMD.getOwner()) {
metadataStoreParams.bucketOwnerId = bucketMD.getOwner();
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@azure/storage-blob": "^12.25.0",
"@hapi/joi": "^17.1.1",
"arsenal": "git+https://github.com/scality/Arsenal#8.2.21",
"arsenal": "git+https://github.com/scality/Arsenal#8.2.23",
"async": "2.6.4",
"aws-sdk": "^2.1692.0",
"bucketclient": "scality/bucketclient#8.2.4",
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/api/multipartUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,7 @@ describe('complete mpu with bucket policy', () => {
json.InitiateMultipartUploadResult.UploadId[0];
const md5Hash = crypto.createHash('md5').update(partBody);
const calculatedHash = md5Hash.digest('hex');
const partRequest = new DummyRequest({
const partRequest = new DummyRequest(Object.assign({
bucketName,
namespace,
objectKey,
Expand All @@ -2786,7 +2786,7 @@ describe('complete mpu with bucket policy', () => {
socket: {
remoteAddress: '1.1.1.1',
},
}, partBody);
}, requestFix), partBody);
objectPutPart(authInfoOtherAcc, partRequest, undefined, log, err => {
assert.ifError(err);
const completeBody = '<CompleteMultipartUpload>' +
Expand All @@ -2795,7 +2795,7 @@ describe('complete mpu with bucket policy', () => {
`<ETag>"${calculatedHash}"</ETag>` +
'</Part>' +
'</CompleteMultipartUpload>';
const completeRequest = {
const completeRequest = new DummyRequest(Object.assign({
bucketName,
namespace,
objectKey,
Expand All @@ -2808,7 +2808,7 @@ describe('complete mpu with bucket policy', () => {
socket: {
remoteAddress: '1.1.1.1',
},
};
}, requestFix));
completeMultipartUpload(authInfoOtherAcc,
completeRequest, log, err => {
assert.ifError(err);
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/api/objectCopy.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('objectCopy with versioning', () => {
metadata.putObjectMD.lastCall,
destBucketName,
objectKey,
sinon.match({ _data: { bucketOwnerId: sinon.match.typeOf('undefined') }}),
sinon.match({ _data: { bucketOwnerId: sinon.match.typeOf('undefined') } }),
sinon.match.any,
sinon.match.any,
sinon.match.any
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('objectCopy with versioning', () => {
Principal: { AWS: `arn:aws:iam::${authInfo2.shortid}:root` },
Action: ['s3:GetObject'],
Resource: [
`arn:aws:s3:::${sourceBucketName}/*`
`arn:aws:s3:::${sourceBucketName}/*`,
],
},
],
Expand All @@ -192,7 +192,7 @@ describe('objectCopy with versioning', () => {
Principal: { AWS: `arn:aws:iam::${authInfo2.shortid}:root` },
Action: ['s3:PutObject'],
Resource: [
`arn:aws:s3:::${destBucketName}/*`
`arn:aws:s3:::${destBucketName}/*`,
],
},
],
Expand All @@ -208,14 +208,14 @@ describe('objectCopy with versioning', () => {
metadata.putObjectMD.lastCall,
destBucketName,
objectKey,
sinon.match({_data: { bucketOwnerId: authInfo.canonicalID }}),
sinon.match({ _data: { bucketOwnerId: authInfo.canonicalID } }),
sinon.match.any,
sinon.match.any,
sinon.match.any
);
assert.ifError(err);
done();
});
});
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/api/objectPut.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ describe('objectPut API', () => {
}, postBody);

bucketPut(authInfo, testPutBucketRequest, log, () => {
objectPut(authInfo, testPutObjectRequest, undefined, log,
objectPut(authInfo, testPutObjectRequest, undefined, log,
err => {
assert.ifError(err);
sinon.assert.calledWith(metadata.putObjectMD.lastCall,
Expand Down
33 changes: 19 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@
fast-xml-parser "^5.0.7"
tslib "^2.8.1"

"@azure/identity@^4.10.0":
version "4.10.0"
resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.10.0.tgz#10cfe49207b4d111ebe3aab3ade47561c2852c6d"
integrity sha512-iT53Sre2NJK6wzMWnvpjNiR3md597LZ3uK/5kQD2TkrY9vqhrY5bt2KwELNjkOWQ9n8S/92knj/QEykTtjMNqQ==
"@azure/identity@^4.10.1":
version "4.10.1"
resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.10.1.tgz#6ce1e7b367d2eb6680d0efa5817382aafcd86f05"
integrity sha512-YM/z6RxRtFlXUH2egAYF/FDPes+MUE6ZoknjEdaq7ebJMMNUzn9zCJ3bd2ZZZlkP0r1xKa88kolhFH/FGV7JnA==
dependencies:
"@azure/abort-controller" "^2.0.0"
"@azure/core-auth" "^1.9.0"
Expand Down Expand Up @@ -1296,11 +1296,11 @@ arraybuffer.prototype.slice@^1.0.4:
get-intrinsic "^1.2.6"
is-array-buffer "^3.0.4"

"arsenal@git+https://github.com/scality/Arsenal#8.2.21":
version "8.2.21"
resolved "git+https://github.com/scality/Arsenal#534e10f48d170b0c4dff9bd818376f796eac8aaa"
"arsenal@git+https://github.com/scality/Arsenal#8.2.23":
version "8.2.23"
resolved "git+https://github.com/scality/Arsenal#77d5781ba013708e44251c4e0142428c5f05a643"
dependencies:
"@azure/identity" "^4.10.0"
"@azure/identity" "^4.10.1"
"@azure/storage-blob" "^12.27.0"
"@js-sdsl/ordered-set" "^4.4.2"
"@scality/hdclient" "^1.3.1"
Expand All @@ -1321,7 +1321,7 @@ arraybuffer.prototype.slice@^1.0.4:
joi "^17.13.3"
level "~5.0.1"
level-sublevel "~6.6.5"
mongodb "^6.16.0"
mongodb "^6.17.0"
node-forge "^1.3.1"
prom-client "^15.1.3"
simple-glob "^0.2.0"
Expand Down Expand Up @@ -1635,6 +1635,11 @@ bson@^6.10.3, bson@^6.8.0:
resolved "https://registry.yarnpkg.com/bson/-/bson-6.10.3.tgz#5f9a463af6b83e264bedd08b236d1356a30eda47"
integrity sha512-MTxGsqgYTwfshYWTRdmZRC+M7FnG1b4y7RO7p2k3X24Wq0yv1m77Wsj0BzlPzd/IowgESfsruQCUToa7vbOpPQ==

bson@^6.10.4:
version "6.10.4"
resolved "https://registry.yarnpkg.com/bson/-/bson-6.10.4.tgz#d530733bb5bb16fb25c162e01a3344fab332fd2b"
integrity sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng==

bucketclient@scality/bucketclient#8.2.4:
version "8.2.4"
resolved "https://codeload.github.com/scality/bucketclient/tar.gz/99ce471a7e665547317e0103a1ba38d75e331a63"
Expand Down Expand Up @@ -4942,13 +4947,13 @@ mongodb@^6.11.0:
bson "^6.10.3"
mongodb-connection-string-url "^3.0.0"

mongodb@^6.16.0:
version "6.16.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.16.0.tgz#2a7a1986ec151d9c738fc8ce4cf4324c3f728a2f"
integrity sha512-D1PNcdT0y4Grhou5Zi/qgipZOYeWrhLEpk33n3nm6LGtz61jvO88WlrWCK/bigMjpnOdAUKKQwsGIl0NtWMyYw==
mongodb@^6.17.0:
version "6.17.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.17.0.tgz#b52da4e3cdf62299e55c51584cb5657283157594"
integrity sha512-neerUzg/8U26cgruLysKEjJvoNSXhyID3RvzvdcpsIi2COYM3FS3o9nlH7fxFtefTb942dX3W9i37oPfCVj4wA==
dependencies:
"@mongodb-js/saslprep" "^1.1.9"
bson "^6.10.3"
bson "^6.10.4"
mongodb-connection-string-url "^3.0.0"

ms@2.0.0:
Expand Down
Loading