refactor(core): export the remaining handlers and verifiers from the root - #130
Merged
Conversation
…root The admin, session, internal-metrics, and system-config handlers, along with verifySignedAuthResponse and verifyRefreshCookie, were reachable only through a subpath import. Everything else came from the root, so which import an adapter needed depended on which handler it wanted. 27 names are now available from the package root as well. Purely additive: nothing is removed or renamed, the ./handlers/* subpaths keep working, and a test asserts a subpath import and a root import resolve to the same function rather than two copies. Rewrites the README's public API overview to match, grouped by what an adapter author is looking for, covering the response contract, proxy, delivery, and contract-value exports added earlier in this epic that it had never listed. Refs #72
6 tasks
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.
PR 5 of #72, the last item in the epic.
Problem
Six modules were reachable only through a subpath import: the admin, session, internal-metrics, and system-config handlers, plus
verifySignedAuthResponseandverifyRefreshCookie. Everything else came from the package root, so which import form an adapter needed depended on which handler it wanted.Change
27 names are now exported from
@seamless-auth/coreas well:Purely additive
The root export list was captured before and after and diffed: 27 added, nothing removed or renamed. I checked for name collisions across every module the root re-exports before adding these; there are none, which is why
export *is safe here.The
./handlers/*subpaths keep working, and a new test asserts that a subpath import and a root import resolve to the same function, not two module instances:That matters because adopters already import from the subpaths, and identity mismatch would be a subtle way to break them.
README
The public API overview had drifted: it still listed 11 exports and never mentioned
applyResult,proxyRequest,deliverAuthMessage, or the contract values added in PRs 1 to 4 of this epic. Rewritten and grouped by what an adapter author is actually looking for: sessions and cookies, building an adapter, auth flow handlers, admin and operations handlers, message delivery, auth API contract, utilities.publicExports.test.jsmirrors that section by design, so it grew with it. It now covers 48 functions and the contract constants, and fails at module link time if any documented name stops being exported.Checks
pnpm buildclean.pnpm testpasses: 49 suites, 332 tests (up 45, almost all from the expanded export coverage).Epic status
This closes the last of the five sub-items in #72. Still tracked there, outside the epic, are the two items that save a new adapter no lines: extracting the copy-pasted core session helpers with a typed
UpstreamSessionResponse, and an injectable logger. Also open is #125, the empty upstream body on passthrough routes.