Repository navigation
feat(sdk): pin signing keys or verify offline from TypeScript, as in Rust - #330
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
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. |
PiquelChips
force-pushed
the
sdk/ts-fixed-keys
branch
from
November 4, 2026 10:35
f4501ef to
7a1d978
Compare
PiquelChips
force-pushed
the
sdk/ts-fixed-keys
branch
from
November 4, 2026 13:59
f4501ef to
405753d
Compare
…Rust KeySet is now exported from @piquel/auth, and KeyCache.fixed(keys) mirrors the Rust SDK's KeyCache::fixed: a set that is never fetched, so a kid it lacks fails with unknown_key. KeySet.parse also takes the set's JSON text.
PiquelChips
force-pushed
the
sdk/ts-fixed-keys
branch
from
November 4, 2026 14:56
405753d to
19468c9
Compare
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.
The Rust SDK can verify tokens against a pinned or offline key set (
KeySet::parse+KeyCache::fixed), but the TypeScript SDK couldn't: itsKeySetwasn't exported andKeyCacheonly took a JWKS URL. Now it can, with the same semantics:KeySetis exported.KeySet.parsefollows the existing rules: it skips keys it can't use, and rejects a document that isn't a key set or that has a duplicatekid. It now also takes the set's JSON text, the way Rust's takes bytes. A JSON string can never be a key set, so treating strings as text is unambiguous.KeyCache.fixed(keys)never fetches, so akidthe set lacks isunknown_key, nevernetwork, as in Rust. The constructor overload behind it is@internaland stripped from the.d.ts, and so isKeySet.read.unknown_key. Thejwksvectors also run against the JSON-text form.docs/architecture/sdk.md, and a sentence in the Rust crate docs namingKeyCache::fixed.just web check,lint,testandsmoke(Node, Bun, workerd) pass.Reviewed with review-loop: 1 round with 2× GPT 6.1 Sol and Claude Opus 5.5. Verdict: approved
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by GPT 6.1 Sol and Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code