feat(jwt): allow custom typ in JwtHeader and createJwt - #168
Conversation
Allow callers to specify custom JWT 'typ' headers (such as 'kya+JWT' for Skyfire KYA tokens) in JwtHeader, createJwt, and schema validators. Resolves the TODO in the skyfire-kya demo. AI disclosure: Implemented with the assistance of Antigravity AI coding assistant.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
Included review availability: Your plan includes up to 2 reviews per rolling hour; 1 remains after this review. WalkthroughThe JWT package now accepts optional custom ChangesCustom JWT headers
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change allows custom JWT type headers and removes the demo workaround; reported tests and checks pass, and no actionable merge-blocking risk remains. Suggested reviewers: 🚥 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 |
Summary
This PR updates
JwtHeaderandcreateJwtin@agentcommercekit/jwtto allow customtypheader values (e.g."kya+JWT"), resolving theTODOindemos/skyfire-kya/src/kya-token.ts.Changes
JwtHeaderinterface fromtyp: "JWT"totyp?: string.valibot.tsandzod.ts) to validate optional stringtyp.// @ts-expect-error - TODO: fix thisindemos/skyfire-kya/src/kya-token.ts.ES256K-Rinjwt-algorithm.ts.create-jwt.test.ts.@agentcommercekit/jwt(patch).Testing
pnpm --filter @agentcommercekit/jwt test(25 passed)pnpm demo:skyfire-kya(runs cleanly end-to-end)pnpm run check(all 29 tasks passed)AI Disclosure
This PR was developed with the assistance of Antigravity AI coding assistant.
Summary by CodeRabbit
typheaders, enabling specialized JWT profiles.typandalgheader values.typvalues while preserving algorithm checks.ES256K-Rrecovery-signature algorithm is not available.