-
Notifications
You must be signed in to change notification settings - Fork 254
✨ CLDSRV-812: ListObjectsV2 create x-amz-optional-attributes header #6033
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
base: development/9.2
Are you sure you want to change the base?
✨ CLDSRV-812: ListObjectsV2 create x-amz-optional-attributes header #6033
Conversation
Hello darkisdude,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 1 file with indirect coverage changes @@ Coverage Diff @@
## development/9.2 #6033 +/- ##
===================================================
+ Coverage 84.34% 84.36% +0.01%
===================================================
Files 204 204
Lines 12926 12935 +9
===================================================
+ Hits 10903 10912 +9
Misses 2023 2023
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
|
/wait |
| url: baseUrl, | ||
| }, baseGetRequest); | ||
| testGetRequest.headers['x-amz-optional-object-attributes'] = 'x-amz-meta-department'; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: multiple empty lines
| async.waterfall( | ||
| [ | ||
| next => bucketPut(authInfo, testPutBucketRequest, log, next), | ||
| (_, next) => bucketGet(authInfo, testGetRequest, log, next), | ||
| (result, _, next) => parseString(result, next), | ||
| ], | ||
| (err, result) => { | ||
| assert.strictEqual(err, null); | ||
| assert.strictEqual(result.ListBucketResult.$.xmlns, 'http://s3.amazonaws.com/doc/2006-03-01/'); | ||
| done(); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: inconsistent formatting of async.xxx
| async.waterfall( | |
| [ | |
| next => bucketPut(authInfo, testPutBucketRequest, log, next), | |
| (_, next) => bucketGet(authInfo, testGetRequest, log, next), | |
| (result, _, next) => parseString(result, next), | |
| ], | |
| (err, result) => { | |
| assert.strictEqual(err, null); | |
| assert.strictEqual(result.ListBucketResult.$.xmlns, 'http://s3.amazonaws.com/doc/2006-03-01/'); | |
| done(); | |
| }, | |
| async.waterfall([ | |
| next => bucketPut(authInfo, testPutBucketRequest, log, next), | |
| (_, next) => bucketGet(authInfo, testGetRequest, log, next), | |
| (result, _, next) => parseString(result, next), | |
| ], (err, result) => { | |
| assert.strictEqual(err, null); | |
| assert.strictEqual(result.ListBucketResult.$.xmlns, 'http://s3.amazonaws.com/doc/2006-03-01/'); | |
| done(); | |
| }, |
| }); | ||
| }); | ||
|
|
||
| it('should ignore the missing permission if the header contains only RestoreStatus', done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it does not really "ignore" the missing permission, it should not even try to check/require it...
| it('should ignore the missing permission if the header contains only RestoreStatus', done => { | |
| it('should return RestoreStatus without extra permission', done => { |
| }); | ||
|
|
||
| it('should ignore the missing permission if the header contains only RestoreStatus', done => { | ||
| const testGetRequest = Object.assign({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we should have a test with this purpose, looking at the code I think it does not really test anything: permission-wise, we have the exact same test as should return valid xml if the user have the permission (the only difference between the tests is the attribute we ask for, but no difference in "auth" setup/mock or assertion on the requested permissions)
| it('should return an error if the user does not have all permissions for multiple attributes', done => { | ||
| const authInfoNoPerm = makeAuthInfo('accessKey2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well, same auth setup as should return an error if the user does not have the permission : making this test redundant...
| url: baseUrl, | ||
| }, baseGetRequest); | ||
| testGetRequest.headers['x-amz-optional-object-attributes'] = 'RestoreStatus,InvalidAttribute'; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely unrelated, but I wonder if we need to be case-insensitive when matching attributes (esp. RestoreStatus which is capitalized) : we should check/test AWS behavior (and verify if user metadata "labels" are case sensitive or not), and handle case-senstitiveness accordingly
May be done in a followup ticket however
| query: {}, | ||
| url: baseUrl, | ||
| }, baseGetRequest); | ||
| testGetRequest.headers['x-amz-optional-object-attributes'] = 'x-amz-meta-foo'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should have leading/trailing whitespaces
| testGetRequest.headers['x-amz-optional-object-attributes'] = 'x-amz-meta-foo'; | |
| testGetRequest.headers['x-amz-optional-object-attributes'] = ' x-amz-meta-foo '; |
NOTE: may be worth testing as well with RestoreStatus, since we will not pick the data form the same place...
| (err, result) => { | ||
| assert.strictEqual(err, null); | ||
| assert.strictEqual(result.ListBucketResult.$.xmlns, 'http://s3.amazonaws.com/doc/2006-03-01/'); | ||
| done(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as such, this test (and the next) do not test much : since we don't have a way to check that "every" requested field is returned
I guess this will be fixed in next PR, but may be best to add a //TODO for now to ensure we don't forget to update the test in next PR
Pull request template
Description
Support a new header
x-amz-object-optional-attributesto be able to retrieve in the ListObjectsV2 user metadata.Motivation and context
https://github.com/scality/citadel/pull/301/changes
https://scality.atlassian.net/browse/CLDSRV-812
Related issues
scality/Arsenal#2581 is needed as the bump of Arsenal in Vault.
A new MR will be opened to update the response of
ListObjectsV2and return asked fields.