Use the key cache in RequestContext.getSignedKey() - #1209
rewrite0w0 wants to merge 1 commit into
Conversation
✅ Deploy Preview for fedify-json-schema canceled.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
ChangesPublic-key cache
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Signing keys are now reused across requests, and a key that no longer verifies is refetched. Tests cover reuse, unavailable keys, and rotation. No merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Key reuse reduces remote lookups, but a previously trusted key can continue verifying requests after it is withdrawn. Refreshing after a signature mismatch supports rotation but does not detect requests signed with the old private key. Exposure depends on cache lifetime and the application's subsequent ownership checks. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
2chanhaeng
left a comment
There was a problem hiding this comment.
Please use the title to summarize the intent of the change, and note which issue the PR addresses in the body. If the title only includes the issue number, GitHub cannot link the issue to the PR.
I think this PR needs a changelog entry because the number of remote lookups and the timing of key updates will change. These changes are visible to users.
I also think users should have an option to disable the cache. However, it doesn’t need to be implemented right away, so you can create a separate issue.
The PR description says AI was used, but the only commit that changed the code, 3ff6fa0, doesn’t have Assisted-by trailers in its message. Please add them.
|
Note Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
🤖 Coding Agent task started for unit test generation. |
RequestContext.getSignedKey()
dahlia
left a comment
There was a problem hiding this comment.
Could you please rebase this branch onto the latest main and remove the back-merge commits to keep the history linear? Please use rebase for future updates as well.
The PR description discloses AI assistance, but the implementation commit is missing the required Assisted-by trailer. Please add it in the Assisted-by: AGENT_NAME:MODEL_VERSION format described in AI_POLICY.md.
b4fa07f to
5c509bf
Compare
|
Autopilot could not be updated. Open Coding to check access and billing. |
dahlia
left a comment
There was a problem hiding this comment.
Could you confirm whether you used ChatGPT or meant Codex? If you worked through conversations in ChatGPT and manually copied the code into your editor, ChatGPT is fine. Please also describe what the tool helped with in the PR description.
Please use the official model identifier gpt-5.6-luna instead of GPT-5.6-Luna, as required by CONTRIBUTING.md.
5c509bf to
2d904bf
Compare
|
Thanks for the review :D. I used ChatGPT through the regular chat interface (not Codex) and copied the code into my editor manually. ChatGPT implemented the change and wrote the tests, and I reviewed it manually. I've updated the trailer to Assisted-by: ChatGPT:gpt-5.6-luna and described this in the PR description. |
Assisted-by: ChatGPT:gpt-5.6-luna
2d904bf to
6653c12
Compare
Summary
RequestContext.getSignedKey()callsverifyRequest()without akeyCache, so signing keys are fetched again across requests using the same key ID.This adds the existing
KvKeyCachetoRequestContext.getSignedKey(), allowing signing keys to be reused across requests while preserving the existing key rotation behavior.Regression tests were added for positive caching, negative caching of unavailable keys, and refetching a key after verification failure.
Fixes #1122
Test plan
deno test -A packages/fedify/src/federation/middleware.test.tsmise check && mise fmt && mise testAI disclosure
Assisted-by: ChatGPT:gpt-5.6-luna
I used ChatGPT through the regular chat interface (not Codex) and copied the code into my editor manually. ChatGPT implemented the change to
RequestContext.getSignedKey()and wrote the regression tests. I manually reviewed the code before committing.