Skip to content

Commit

Permalink
Merge branch 'feature/CLDSRV-176-support-object-tagging-notifications…
Browse files Browse the repository at this point in the history
…' into q/8.4
  • Loading branch information
bert-e committed Apr 21, 2022
2 parents 48aaede + 53d9f8c commit e83057c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/api/objectDeleteTagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ function objectDeleteTagging(authInfo, request, log, callback) {
objectMD.replicationInfo = Object.assign({},
objectMD.replicationInfo, replicationInfo);
}
// eslint-disable-next-line no-param-reassign
objectMD.originOp = 's3:ObjectTagging:Delete';
metadata.putObjectMD(bucket.getName(), objectKey, objectMD, params,
log, err =>
next(err, bucket, objectMD));
Expand Down
2 changes: 2 additions & 0 deletions lib/api/objectPutTagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ function objectPutTagging(authInfo, request, log, callback) {
objectMD.replicationInfo = Object.assign({},
objectMD.replicationInfo, replicationInfo);
}
// eslint-disable-next-line no-param-reassign
objectMD.originOp = 's3:ObjectTagging:Put';
metadata.putObjectMD(bucket.getName(), objectKey, objectMD, params,
log, err =>
next(err, bucket, objectMD));
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/api/objectDeleteTagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('deleteObjectTagging API', () => {

afterEach(() => cleanup());

it('should delete tag set', done => {
it('should delete tag set and update originOp', done => {
const taggingUtil = new TaggingConfigTester();
const testObjectPutTaggingRequest = taggingUtil
.createObjectTaggingRequest('PUT', bucketName, objectName);
Expand All @@ -62,6 +62,7 @@ describe('deleteObjectTagging API', () => {
], (err, objectMD) => {
const uploadedTags = objectMD.tags;
assert.deepStrictEqual(uploadedTags, {});
assert.strictEqual(objectMD.originOp, 's3:ObjectTagging:Delete');
return done();
});
});
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/api/objectPutTagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('putObjectTagging API', () => {

afterEach(cleanup);

it('should update an object\'s metadata with tags resource', done => {
it('should update an object\'s metadata with tags resource and update originOp', done => {
const taggingUtil = new TaggingConfigTester();
const testObjectPutTaggingRequest = taggingUtil
.createObjectTaggingRequest('PUT', bucketName, objectName);
Expand All @@ -85,6 +85,7 @@ describe('putObjectTagging API', () => {
}
const uploadedTags = objectMD.tags;
assert.deepStrictEqual(uploadedTags, taggingUtil.getTags());
assert.strictEqual(objectMD.originOp, 's3:ObjectTagging:Put');
return done();
});
});
Expand Down

0 comments on commit e83057c

Please sign in to comment.