-
Notifications
You must be signed in to change notification settings - Fork 391
feat: Enable full object checksum validation on JSON path #2687
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
Open
thiyaguk09
wants to merge
15
commits into
main
Choose a base branch
from
feat/enable-full-checksum-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds validation for client-provided (pre-calculated) and client-calculated CRC32C and MD5 hashes when the final upload request is made via the JSON API path (status 200). This ensures consistency checks are performed even when the `Upload` stream is finalized, preventing silent data corruption if the server-reported hash (in the response body) mismatches the client's expected hash.
Adds the 'Validation of Client Checksums Against Server Response' test suite. Fixes test failures in client-provided hash scenarios by updating mock responses to ensure server-reported checksums match the client's expected values.
Refactors four duplicate test cases (CRC32C/MD5 success and failure) into a single, parameterized test block within the 'Validation of Client Checksums Against Server Response' suite. This improves test clarity and reduces code duplication by dynamically generating test scenarios for post-upload hash validation.
6 tasks
This commit introduces several stability fixes for the ResumableUpload class: 1. **Fixes Timeouts in Unit Tests:** Updates `makeRequestStream` mocks to fully drain the request body stream, resolving stream consumption deadlocks and timeouts in `#startUploading` unit tests. 2. **Fixes Multi-Part Hang:** Correctly finalizes the `pipeline` for partial chunks (`isPartialUpload=true`) by calling `pipelineCallback()` immediately after successful chunk upload, preventing indefinite hangs in multi-session tests. 3. **Fixes Single-Chunk Checksum Missing Header:** Applies the `X-Goog-Hash` header unconditionally in single-chunk mode if a validator is present, ensuring checksum validation is active even when `contentLength` is unknown.
ddelgrosso1
reviewed
Dec 10, 2025
ddelgrosso1
reviewed
Dec 10, 2025
shubham-up-47
previously approved these changes
Dec 17, 2025
Simplify `HashStreamValidator._flush` by utilizing `md5Digest` getter.
shubham-up-47
approved these changes
Dec 18, 2025
Contributor
Author
|
@ddelgrosso1 Just a quick reminder to take a look at this PR when you get a chance! |
Contributor
Author
|
Hi @ddelgrosso1, Just a quick reminder to take a look at this PR when you get a chance! |
ddelgrosso1
reviewed
Jan 7, 2026
ddelgrosso1
approved these changes
Jan 7, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: storage
Issues related to the googleapis/nodejs-storage API.
size: l
Pull request size is large.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Impact
Testing
Additional Information
Checklist
Fixes #