fix(auth): route helpers through selected providers - #5
Closed
Upd4ting wants to merge 1 commit into
Closed
Conversation
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Member
Author
|
Closed at Upd4ting's request: the Core 1.5 / multi-provider train is deferred and will be restarted manually later. This PR contains only work for that train; no independent fix is being retained. Do not merge or publish artifacts from this branch. Any future implementation should start from the then-current main branches and released package graph. |
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.
Summary
ValidateRaw,SignRaw,SignServerResponse,CreateAuthDecorator, andAuthenticationfrom the consumer's automatically boundinternal.Verifyandinternal.SignAuthentication()parameter provider invoked later by API keeps the Auth provider selected for the declaring consumerBug reproduced
With two Auth providers, the canonical Auth module cannot choose a provider when called outside an active consumer context. The old architecture could therefore pass direct lifecycle calls while failing later:
Authentication()stores a parameter provider during module evaluation. API invokes it later under API's provider context. Before this change, the default authenticator closed over canonicalValidateRaw, which reached an ambiguousinternal.Verifywhen two Auth providers existed.The facade builder now creates the same public helpers from the consumer-bound Verify/Sign functions. No HTTP callback or parameter provider is wrapped in an async context.
Validation
pnpm lintpnpm buildAmbiguousProviderError, proving the test exercises provider selection rather than a single-provider side effectgit diff --checkRelease ordering
Publish interface-core and Core first, then release this package alongside/after interface-api #17. No package is published by this PR.
Greptile Summary
The PR adds an Auth interface-facade builder so derived signing, verification, response, and decorator helpers retain the provider selected for each consumer.
internal.Verifyandinternal.Sign.Confidence Score: 5/5
The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified.
The rebuilt helpers consistently close over the consumer-bound Verify and Sign functions, preserve the source-verifier-validator pipeline, and are covered by a deferred two-provider regression.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Consumer participant Core as Interface Core participant Facade as Auth Facade participant API as Deferred API Provider participant Auth as Selected Auth Provider Consumer->>Core: CreateInterfaceFacade(Auth, context) Core->>Facade: BuildInterfaceFacade(scope, bound exports) Consumer->>Facade: Authentication() Facade->>API: Register parameter provider API->>Facade: Invoke provider during request Facade->>Auth: Bound Verify(token, options) Auth-->>Facade: Verified payload Facade-->>API: Authenticated handler valueReviews (1): Last reviewed commit: "fix(auth): route helpers through selecte..." | Re-trigger Greptile