4.9 KiB
4.9 KiB
@suaveplan/api-auth-provider - Abstract auth-provider contract for the Suaveplan API plugin system. Defines AuthProviderAdapter, the canonical provider route surface, path-ownership registry, collision detector, the auth.provider CapabilityId, the AUTH_PROVIDER error-code registry, and the provider conformance harness. $2; concrete providers (better-auth, rolled) ship in Stages 6 and 8.
Abstract account-lifecycle contract for the Suaveplan API plugin system
(contracts). This package is OPTIONAL: hosted-IdP deployments
(Clerk, Auth0, Cognito) install only the session resolver from
@suaveplan/api-auth; self-hosted deployments install exactly one provider
implementation (api-auth-better-auth , api-auth-rolled in
Stage 8) which structurally implements AuthProviderAdapter from this
package.
Documentation tree
- capability-id — The
capability-idmodule pins the runtime literal for the"auth.provider"capability this package contributes to th…- capability-id — The
capability-idmodule pins the runtime literal for the"auth.provider"capability this package contributes to th…
- capability-id — The
- collision-detector —
collision-detectoris the install-time guard that prevents a plugin from accidentally squatting on the auth-provider'…- collision-detector —
collision-detectoris the install-time guard that prevents a plugin from accidentally squatting on the auth-provider'…
- collision-detector —
- error-codes — This module centralises the four stable error codes the auth-provider contract emits —
PATH_COLLISION, `MULTIPLE_PROV…- error-codes — This module centralises the four stable error codes the auth-provider contract emits —
PATH_COLLISION, `MULTIPLE_PROV…
- error-codes — This module centralises the four stable error codes the auth-provider contract emits —
- path-ownership —
path-ownershipis the runtime registry the host consults to enforce the "exactly one auth provider per deployment" in…- path-ownership —
path-ownershipis the runtime registry the host consults to enforce the "exactly one auth provider per deployment" in…
- path-ownership —
- provider — The
providermodule is the type-level + thin-runtime heart of@suaveplan/api-auth-provider. It declares the abstrac…- provider — The
providermodule is the type-level + thin-runtime heart of@suaveplan/api-auth-provider. It declares the abstrac…
- provider — The
- route-surface —
route-surfacedeclares the closed set of paths an auth provider OWNS relative to itspathPrefix. The set is the uni…- route-surface —
route-surfacedeclares the closed set of paths an auth provider OWNS relative to itspathPrefix. The set is the uni…
- route-surface —
- testing —
runAuthProviderConformanceis the runner-agnostic harness every concreteAuthProviderAdapterMUST clear. It exercis…- conformance —
runAuthProviderConformanceis the runner-agnostic harness every concreteAuthProviderAdapterMUST clear. It exercis…
- conformance —
What ships here
AuthProviderAdaptercontract —id,pathPrefix,routes(router, ctx), four-hook lifecycle.AuthPathPrefixbrand + Zod-validatedauthPathPrefixconstructor.PROVIDER_ROUTE_SURFACE— the canonical 9-entry route table providers project from.PathOwnershipruntime registry — enforces "exactly one provider" install-time invariant.detectAuthPathCollisions— install-time guard that plugin routes do not squat on the provider's owned prefix.AUTH_PROVIDER_CAPABILITY_IDconstant —"auth.provider".AUTH_PROVIDER_CODES— the four-code error registry plusAuthProviderErrorand theauthProviderErrorfactory.runAuthProviderConformance— runner-agnostic harness every concrete provider clears.
Module index
- provider
- route-surface
- path-ownership
- collision-detector
- capability-id
- error-codes
- testing/conformance
Dependencies
@suaveplan/api-types(workspace) —AuthProviderAdapterconsumesRouter,PluginContext,CapabilityId,CapabilityRequirements.@suaveplan/error(workspace) —SuaveplanError+defineCodes.zod(catalog) —AuthPathPrefixSchema.tslib(catalog) — emitter helpers.
Stage / status
Concrete providers ship in Stages 6 / 8.