Repository navigation
Key principal-provider behavior on providesPrincipal, not the name 'auth' (#888) - #893
Merged
Merged
Conversation
…t the name auth (#888) The route auth: short form, the OpenAPI security scheme and review's session hint now follow the extension contract instead of the extension name `auth`. - ExtensionDefinition gains providesPrincipal; composeHost refuses a host() registration that disagrees with its definition, and build:addons writes it into urlcode.json and the release catalog (packages/auth declares it). - auth: expands to policies.extensions.<P>, where P is the one declared extension whose static descriptor declares providesPrincipal (site dependency, else first-party install location, else release catalog). Zero or several providers refuse the short form; the explicit form still works. Text-mode tools resolve against the release catalog only. - Determinism: the expansion lands in the normalized routes, so it is part of `version` and the pinned projectSha256. A package change that moves the target changes the revision, and pinned registrations and grants refuse it. prepareExtensions also refuses unless the one declared registration that provides a principal is the expansion target. - OpenAPI emits 401/403 and a per-provider urlcodeSession.<name> scheme for any principal-providing gate (registration when loaded, else descriptor). - review names the declared principal provider in the session hint. - installedProviders/readInstalledDescriptor move to addon-manifest.ts so the config worker can read descriptors without importing addon-install.ts. - The @example/urlcode-authjs proof declares providesPrincipal and its routes use auth: true; its README, the integration test (explain, OpenAPI urlcodeSession.authjs) and EXTENSIONS.md drop the coupling gap. - Package budget raised (909 KiB packed, 3598 KiB unpacked), measured against current main. BREAKING CHANGE: a host registration used with auth: must declare providesPrincipal: true; the OpenAPI scheme is now urlcodeSession.<provider>. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…udget Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 02:52
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mes with #881's per-method 403 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Sep 29, 2026
Closed
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.
Fixes #888. The
auth:short form, OpenAPI's 401/403 answers and security scheme, and review's session hint now follow the extension contract (providesPrincipal: true), not the extension nameauth.Design
providesPrincipalis declared onExtensionDefinitionand checked bydefineExtension.composeHostrefuses a registration that disagrees with its definition. It is written intourlcode.jsonbybuild:addonsand carried into the release catalog.packages/authdeclares it.auth: trueexpands topolicies.extensions.<P>, where P is the one declared extension whose descriptor declaresprovidesPrincipal. It looks in the site's packages first, then the first-party install location, then the release catalog.policies.extensions.<name>.authjsnow works withauth: true. First-party names stay reserved.projectSha256.explain, the manifest androutesshow the concrete extension.prepareExtensionsalso refuses unless the registered principal provider is the expansion target.urlcodeSession.<name>. Breaking: it wasurlcodeSession, and there is no alias.refusedOn).auth:must declareprovidesPrincipal: true.Auth.js proof converted
proofs/private-requests-authjsnow usesauth: true. Its protected routes must match the Better Auth proof's exactly (tested).explainshowsextensions.authjs.urlcodeSession.authjsand 200/401/403.Evidence (macOS, Node 26)
npm test: 1158/1158.test:proof:authjs: 13/13.npm run verifyandnpm run test:packagepass.authjsprovider with the short form: it validates statically, has the same revision as the long form, and returns 401/200;🤖 Generated with Claude Code