-
Notifications
You must be signed in to change notification settings - Fork 255
CLDSRV-901: Add functional test coverage for ListObjectsV2 optional object attributes #6174
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
Changes from all commits
1ed1972
5a3985d
9dfed18
97d0418
ea65b8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,7 +154,9 @@ function processVersions(bucketName, listParams, list) { | |
| `<ID>${v.Owner.ID}</ID>`, | ||
| `<DisplayName>${v.Owner.DisplayName}</DisplayName>`, | ||
| '</Owner>', | ||
| ...processOptionalAttributes(v, listParams.optionalAttributes), | ||
| ...(v.IsDeleteMarker | ||
| ? [] | ||
| : processOptionalAttributes(v, listParams.optionalAttributes)), | ||
| `<StorageClass>${v.StorageClass}</StorageClass>`, | ||
| v.IsDeleteMarker ? '</DeleteMarker>' : '</Version>' | ||
| ); | ||
|
|
@@ -332,16 +334,19 @@ function bucketGet(authInfo, request, log, callback) { | |
| const bucketName = request.bucketName; | ||
| const v2 = params['list-type']; | ||
|
|
||
| const optionalAttributes = | ||
| const optionalAttributes = new Set( | ||
| request.headers['x-amz-optional-object-attributes'] | ||
| ?.split(',') | ||
| .map(attr => attr.trim()) | ||
| .map(attr => attr !== 'RestoreStatus' ? attr.toLowerCase() : attr) | ||
| ?? []; | ||
| if (optionalAttributes.some(attr => !attr.startsWith('x-amz-meta-') && attr != 'RestoreStatus')) { | ||
| return callback( | ||
| errorInstances.InvalidArgument.customizeDescription('Invalid attribute name specified') | ||
| ); | ||
| ?? [] | ||
| ); | ||
| for (const attr of optionalAttributes) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure this match the AWS behaviour ? Of course no duplicate blocks, but should we reject the request ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checked with multiple Side note: We have a divergence with AWS. AWS does not include |
||
| if (!attr.startsWith('x-amz-meta-') && attr !== 'RestoreStatus') { | ||
| return callback( | ||
| errorInstances.InvalidArgument.customizeDescription('Invalid attribute name specified') | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| if (v2 !== undefined && Number.parseInt(v2, 10) !== 2) { | ||
|
|
||
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.
We should mention that in the JIRA also to make sure the develop who will resolve the VAULT-721, will remove it from here 🙏. Why waiting to do it ?
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.
Done: https://scality.atlassian.net/browse/VAULT-721?focusedCommentId=475640