Skip to content
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

[Backport into 5.14] boto fix and version bump #8840

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

liranmauda
Copy link
Contributor

Explain the changes

  1. [Backport into 5.14] boto fix and version bump

Issues: Fixed #xxx / Gap #xxx

  1. https://issues.redhat.com/browse/DFBUGS-1538

[5.14] Bumping version from 5.14.16 to 5.14.17

Signed-off-by: liranmauda <[email protected]>
…nkedContentDecoder)

1. In http_utils.js accept more types of content sha256 headers (STREAMING-UNSIGNED-PAYLOAD-TRAILER, STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER), as without those headers on clients that add the checksum headers with trailing we would fail.
2. Change the state of the machine and add more states to support the trailing headers: STATE_READ_TRAILER (like we have STATE_READ_CHUNK_HEADER), STATE_WAIT_NL_TRAILER (like we have STATE_WAIT_NL_DATA) and STATE_WAIT_NL_END.
3. Set the following constants to limit the request (avoid the client from abuse):
   - MAX_CHUNK_SIZE - we want to have a lower number than Number.MAX_SAFE_INTEGER (reference), we expect lower number.
   - MAX_CHUNK_HEADER_SIZE - we don't expect that long (as it is saved in memory during the parsing).
   - MAX_TRAILER_SIZE - same, in the example we saw it was about ~30 (x-amz-checksum-crc32:uOMGCw==).
   - MAX_TRAILERS - currently we saw the trailer of checksum (x-amz-checksum-crc32:uOMGCw==), we expect to have a few trailers in a request.
4. Refactor and organize - add comments with explanations about the state machine, add helper functions, add separation between the parts, rename chunk_header_str to chunk_header, add members related to trailers, add the member this.stream_pos which we use for validation.
5. Improve building the string (either this.chunk_header, and this.trailer) so we won't build it byte by byte, but only after we find the CR ('\r`).
6. Replace buffer slice function with subarray as the function slice was deprecated (see reference).

Co-authored-by: Guy Margalit <[email protected]>
Signed-off-by: shirady <[email protected]>
(cherry picked from commit 9b5cc89)
(cherry picked from commit b8953b7)
@liranmauda liranmauda force-pushed the liran-backport-into-5.14 branch from 7f1c6df to 5f40621 Compare February 27, 2025 14:10
@liranmauda liranmauda merged commit ded1807 into noobaa:5.14 Feb 27, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants