Repository navigation
feat: add the /oidc/* contract between the OpenID Provider service and the API - #123
Merged
Merged
Conversation
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.
What
A new
oidcEdgemodule with the service-token contract between the OpenID Provider service (fells-code/seamless-auth-oidc-provider) and the private API, per ADR 0001 (D4, D5, D6, D9, D13).OIDC_EDGE_CONTRACT_VERSIONandOidcEdgeRoutes(the route paths both sides use).GET /oidc/config: contract version,oidc_issuer, app name,allow_client_secrets,third_party_clients_enabled. The edge checks the version at startup./oidc/payloads/:model/*: upsert, find, find by user code, find by uid, consume, destroy, revoke by grant id. The model enum is the ten storedoidc-providermodels.Clientand the API-internal OAuth state replay model are not accepted. Upsert returnscreated: falsefor an existingReplayDetectionrow.POST /oidc/sign: the library's external signing input pluskind,kid,clientIdandsessionId(required unlessclient_credentials), the base64url signature back, and the refusal codes.GET /oidc/jwks: public keys only. The schema rejects any key carrying private members.GET /oidc/clients/:id(client metadata in the library's names, never a secret) andPOST /oidc/clients/:id/verify-secret.GET /oidc/accounts/:id(claims) andGET /oidc/sessions/:id/auth-context, withOidcAccountQuerySchema(clientId,sessionId) andOidcSessionQuerySchema(clientId). The auth context carriesauthMethods,authTimeand the derivedacr/amr. The API answers only for a live session holding a grant for that client.POST /oidc/sessions/:id/revoke.POST /oidc/events: provider audit events with a correlation id.SystemConfigSchemaand the patch schema gain the provider keys the API needs for D6, D10 and D13:oidc_provider_enabled(defaultfalse),oidc_issuer(defaultnull),allow_client_secretsandthird_party_clients_enabled(both defaultfalse). The inferredSystemConfigtype gains four required fields, which the changeset calls out.Two routes go beyond the issue's list because the library needs them: client metadata (the
Clientmodel) and account claims (findAccount/userinfo).Prereleases
This PR enters Changesets pre mode on
next(.changeset/pre.json), so the release PR it produces publishes0.34.0-next.0to thenextdist-tag andlateststays on 0.33.x. RELEASES.md documents the flow and thepre exitstep for the stable 0.34.0. The changeset isminor.The module notes that
/oidc/*takes the provider service's own service token (SEAMLESS_OIDC_SERVICE_TOKEN), never the adapters' secret.Contract-affecting. Consumers: seamless-auth-api (the
/oidc/*routes) and seamless-auth-oidc-provider.Closes #122
Checks
npm run typecheck: passnpm run lint: passnpm run format:check: passnpm test: 22 files, 368 tests passnpm run buildandnpm run check-npm-build: pass,dist/schemas/oidcEdge/*included