fix: model simulator SSE-C downloads#118
Open
goanpeca wants to merge 14 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the in-memory B2 simulator’s handling of server-side encryption metadata, specifically modeling SSE-B2/SSE-C behavior without persisting customer-provided keys and enforcing SSE-C requirements on download paths to catch SDK regressions.
Changes:
- Persist simulator encryption metadata separately (hashed for SSE-C) and ensure public responses echo only mode/algorithm.
- Enforce SSE-C customer headers on downloads by validating against stored digests.
- Add regression tests covering SSE-C download failures/success, public SSE metadata echo, and non-persistence of raw customer keys.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/simulator/index.ts | Stores SSE metadata in simulator state and enforces SSE-C headers on download. |
| src/simulator/fidelity.test.ts | Adds regression coverage for SSE-C download enforcement and non-persistence of raw keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f0cdec5 to
f1dd2fe
Compare
Comment on lines
+6
to
+21
| const originalGetBuiltinModule = process.getBuiltinModule | ||
| const originalBuffer = globalThis.Buffer | ||
|
|
||
| function restoreGlobals() { | ||
| Object.defineProperty(process, 'getBuiltinModule', { | ||
| configurable: true, | ||
| enumerable: true, | ||
| value: originalGetBuiltinModule, | ||
| writable: true, | ||
| }) | ||
| Object.defineProperty(globalThis, 'Buffer', { | ||
| configurable: true, | ||
| value: originalBuffer, | ||
| writable: true, | ||
| }) | ||
| } |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
Linked issue:
Tests run:
Follow-up notes: