test(responses): mint the surviving blob as a valid Fernet token - #5246
Conversation
Co-authored-by: ingwannu <ingwannu@teamwicked.me>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe encrypted-content sanitization test now uses a valid encrypted blob from ChangesEncrypted fixture validation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
devis red at12cb129d42:sanitizeEncryptedContentInPlace > plaintext parked in encrypted slots becomes input_text; real blobs survivefails on Linux shard 2/4 and macOS shard 2/2 withExpected: 2, Received: 3.looksLikeBackendCiphertextwithisStructurallyValidFernetToken, which requires canonical base64url, length >= 100, a0x80version byte and a 16-byte-aligned ciphertext. The case's stand-in blob"gAAAAAB".padEnd(120, "Qw1_-=")embeds=mid-token, so it is no longer a valid token and is now lowered toinput_textas a third rewrite.fernetFixture()helper already defined in the samedescribe, which is the shape the sibling cases added by fix(responses): reject Fernet-shaped agent plaintext #5239 use. The rewrite count returns to 2 andoutParts[0]stays byte-identical.Verification
src/server/responses/encrypted-payload.ts:fernetFixture()produces a 73-byte payload withraw[0] = 0x80, encoding to a 100-character canonical base64url token, soisStructurallyValidFernetTokenaccepts it (decoded.length - 57 === 16).Checklist
Summary by CodeRabbit