Repository navigation
Expose native session identity to application function routes - #833
Merged
Merged
Conversation
This was referenced Sep 28, 2026
Closed
jimhoyd
marked this pull request as ready for review
September 28, 2026 04:41
This was referenced Sep 28, 2026
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.
Problem and change
Native auth authorizes ordinary function routes but did not expose their verified session user ID to the handler. Custom business rules therefore needed extra integration code. Auth now projects the opaque ID after authorization, CSRF and principal assignment;
sessionUserId(request)reads it without forwarding credentials.Adds an
authenticated-handlersrecipe with explicit YAML endpoints, bounded inputs, native account flows and installed-package coverage. Documents the trust boundary and sandbox-local alternative. Resolves #832.Verification
npm run verifypassed, including all workspace and installed add-on integration tests.npm run test:packagepassed; 39 packaged example commands ran from consumer copies.Core archive budgets increase from 860 to 864 KiB packed and 3395 to 3430 KiB unpacked for the shipped recipe and guidance. Measured size: 882184 packed bytes, 3510731 unpacked bytes, 499 entries; entry budget remains 500.
Compatibility and security
Additive auth API and recipe; no new YAML field or core-to-extension import. Native session identity is distinct from bearer authorization. The accessor trusts only URLCode's client-stripped, auth-produced request context; it cannot authenticate arbitrary Requests. Trusted package imports retain ambient Node authority;
sandbox: trueisolation and credential withholding are preserved. No package publication or deployment is included.