Option B — feat(auth): add createVerifier hook to the oauth config - #3
Open
muralx wants to merge 1 commit into
Open
Option B — feat(auth): add createVerifier hook to the oauth config#3muralx wants to merge 1 commit into
muralx wants to merge 1 commit into
Conversation
muralx
force-pushed
the
feat/create-verifier-hook
branch
from
August 4, 2026 14:16
1bc0db0 to
8a63a4d
Compare
OAuthConfig gains an optional createVerifier(config), called once at boot at the point where the framework builds its verifier today; it defaults to the built-in createJwksVerifier(config.verify). verify keeps its existing type and required issuer, so provider signatures and everything reading verify.issuer are untouched. A provider package pairs the config it returns with a createVerifier closing over state it prepared (providers are async; the hook is sync at boot). The returned verifier follows the requireBearerAuth contract: resolve AuthInfo or throw the SDK error classes. Metadata routes, per-tool schemes, and challenge handling are unchanged.
muralx
force-pushed
the
feat/create-verifier-hook
branch
from
August 4, 2026 14:19
8a63a4d to
f321ca2
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.
One of two alternative shapes for the same capability — see #2 for the other (widening
verifyinto a union). This variant keepsverifyuntouched and adds a creation hook instead. We intend to propose whichever reads better to the Skybridge maintainers upstream.Shape
OAuthConfiggains an optionalcreateVerifier(config), called once at boot at the exact point the framework builds its verifier today, defaulting to the built-increateJwksVerifier(config.verify). The config stays a data description of the deployment;createVerifieris the method that turns that data into the verifier, and a provider package returns both halves together — async preparation happens in the (already-async) provider, with the hook doing synchronous assembly at boot.verifykeeps its existing type and requiredissuer— no union, no type alias, provider signatures untouched; one uniform creation path insetupOAuth. Net diff is 4 files, +148/−2.Changes
createVerifier?: (config: OAuthConfig) => OAuthTokenVerifieronOAuthConfig, with docs on the contract (resolveAuthInfoor throw the SDK error classes, as withrequireBearerAuth).setupOAuth:const verifier = (config.createVerifier ?? ((c) => createJwksVerifier(c.verify)))(config); theissuerboot guard is unchanged and still applies.authInfo; 401 challenge withresource_metadataon rejection; metadata endpoints intact; hook called exactly once at boot with the resolved config;verify.issuerstill required alongside a custom hook.custom-provider.mdx.All 402 core tests pass;
tscandbiome ciclean; the new tests were verified to fail with the implementation reverted.