Repository navigation
feat: manage webhooks, login hooks, custom claims and audit streaming - #343
Merged
Merged
Conversation
Add four pages for the v0.23 extensibility routes (ADR 0005). Webhooks: create, edit, turn off and on, and delete endpoints for the published event types, with the reason the API turned one off. Rotate the signing secret, shown once, with the old one signing for 24 hours beside it. Send a test event and show the result. A delivery log per endpoint with status, attempts, last status code, failure and event body, a dead letter view, cursor paging, and redeliver. Login hooks: one per trigger with URL, timeout, failure mode explained, a secret shown once and rotation, a test call, and the invocation log. The page says break-glass and recovery sessions never call a hook. Custom claims: a JSON set per instance role, organization role and OpenID Provider client, with the reserved names and budget from the list response, checked before step-up, and the field the API refused. Audit streaming: OTLP and syslog sinks whose credentials are env var names only, a test record, and each sink's lag, last delivery and last failure. Every write asks for step-up first, and an API older than v0.23 gets an upgrade message. Bump @seamless-auth/types to 0.39 and categorize the new audit events. Closes #335 Closes #336
Put Webhooks, Login hooks and Audit streaming in an Integrations group in the sidebar, with Custom claims kept beside Roles. A turned-off audit sink still holds audit retention, since the API never deletes an event a sink has not delivered. A turned-off sink that is behind says so and that deleting it releases them; turning a sink off now asks for confirmation stating the same, and the delete confirmation says it too. The Custom claims page restates the order sources apply in, and when two roles of one kind set the same claim it names the role that wins in role-name order, worked out from the list response as the API sorts.
This was referenced Nov 8, 2026
Rotating a secret closes the confirmation and opens the secret dialog in the same step, so the shared helper's wait for no dialog raced it and lost on CI. Wait for the confirmation itself to close instead.
Bccorb
marked this pull request as ready for review
November 8, 2026 03:37
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
Console pages for the v0.23 extensibility routes (ADR 0005): Webhooks (#335), and Login hooks, Custom claims and Audit streaming (#336).
Depends on the unreleased API PRs fells-code/seamless-auth-api#580 (webhooks), #582 (audit sinks), #583 (login hooks) and #584 (custom claims). Until those ship, every page shows "Needs Seamless Auth API v0.23" on the 404 an older API answers, and does not retry it.
Changes
/webhooks): list, create (event types fromWEBHOOK_EVENT_TYPES), edit, turn off and on with thedisabledReasonexplained, delete, rotate secret (shown once, the old one signs for 24 hours), send a test event with its result. Delivery log with status, attempts, last status code and failure, the event body, an endpoint filter, a dead letter tab (status=dead),nextCursorpaging and redeliver./login-hooks): one section per trigger with URL, timeout (100 to 5000 ms), failure mode (open versus closed explained), secret shown once on create and on rotation, test call, and the invocation log with an outcome filter. States that break-glass and recovery sessions never call a hook./custom-claims): a JSON set per instance role, organization role and OIDC client, with the reserved names, prefixes and budget taken from the list response, each set's size, the precedence order and the shared token budget rule. A reserved name, depth over 3 or a set over budget is refused before step-up; an API refusal shows the field (invalid_requestdetails.issues). The page restates the order sources apply in (instance roles, organization roles, the OIDC client, then thepre_tokenhook), and when two roles of one kind set the same claim it shows "applied in role-name order;<role>wins", worked out from the list response with the API's own code-unit sort./audit-streaming): OTLP and syslog sinks, header and TLS credentials as_AUDIT_SINK_SECRETenv var names only (a value typed in their place is refused before any request), test record, and status with lag, last delivery and last failure, refreshed every 30 s. A turned-off sink still holds audit retention (the API never deletes an event a sink has not delivered): a turned-off sink that is behind shows "This sink still holds audit retention, so no event is lost. Delete it to release.", turning a sink off asks for confirmation stating the same, and the delete confirmation says deleting releases them.ensureStepUp()first, as the Roles and Applications pages do;apiFetchstill re-tries once on a lapsedstep_up_required. Request bodies are validated with the@seamless-auth/types0.40 schemas (CreateWebhookEndpointRequestSchema,UpdateWebhookEndpointRequestSchema,SetLoginHookRequestSchema,SetCustomClaimsRequestSchema,CreateAuditSinkRequestSchema,UpdateAuditSinkRequestSchema); responses are typed, not parsed, matching the existing pages.SigningSecretDialog,FormParts,src/lib/callouts.ts(failure reasons, test results,invalid_requestissues),src/lib/customClaims.ts.@seamless-auth/typesto 0.40.0; the new audit event types get categories (Webhooks, Login Hooks, Custom Claims, Audit Streaming) and labels.session_createdis a Session Tokens event,custom_claims_omitted("Custom claims omitted from token") a Custom Claims one, and the two application link events stay under OpenID Provider. The localPENDING_EVENT_TYPESlist is gone now thatAUTH_EVENT_TYPEShas the link events.misconfiguredcallout failure (a destination whose settings cannot be used, such as an unset_AUDIT_SINK_SECRETenv var, so no call was made) has its own text insrc/lib/callouts.ts.Type of Change
How to Test
npm test,npm run test:e2e.Checks (run locally at 9ca057e)
npm run typecheck: passesnpm run lint: passesnpm run format:check: "All matched files use Prettier code style!"npm run coverage: 116 files, 942 tests passed; all files 82.6% statements, 81% branches, 79.48% functions, 84.82% lines (thresholds 62/52/60/64)npm run build: builtnpm run check:types-current:@seamless-auth/types "^0.40.0" is current (latest 0.40.0)CI=1 npx playwright test(mocked/auth/*backend, fresh server): 248 passed, including 35 new specs acrosswebhooks,login-hooks,custom-claimsandaudit-streamingNot run
feat/custom-claimsandfeat/audit-sinks.Notes