Repository navigation
feat: add schemas for webhooks, login hooks, custom claims and audit sinks - #156
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.
Closes #146.
Shared schemas for v0.23 Wave 4, as agreed in API ADR 0005 (webhooks, login hooks, custom claims, SIEM streaming). The API consumes its route schemas from this package, so this lands first, as in Wave 3.
What is here
callout/schema.ts):CalloutUrlSchema(http or https, no userinfo, no fragment; reachability is the API's call at connect time),CalloutFailureSchema(coarse failure reasons that never reveal a resolved address),CalloutSecretSchema(a Standard Webhookswhsec_secret of 32 bytes), and the test call response.webhook/): routes, the ten-type event catalog pluswebhook.test, one payload schema per type, the versioned envelope as a discriminated union, endpoint, delivery and dead letter schemas.webhook/constants(no Zod) holds header names, the 300 s replay tolerance, the 24 h rotation overlap and the retry schedule, for theverifyWebhookwork in seamless-auth-server#269.loginHook/): one hook per trigger (post_login,pre_token), 2 s default timeout capped at 5 s, fail closed by default. The call body carries no token, code or secret. Apost_loginresult that tries to add claims fails to parse.customClaim/): claim sets per instance role, organization role and OIDC client, names^[a-z][a-z0-9_]{0,63}$, JSON values up to depth 3, 1 KiB per set in UTF-8 bytes.customClaim/reserved(no Zod) holds the reserved list for the API and the provider (feat(config): let a deployment ask authenticators to identify themselves #47) to share.auditSink/): OTLP and syslog settings, sink status, andAuditExportEventSchema(theseamless-auth-events/1line). Sink credentials name env vars ending_AUDIT_SINK_SECRETand are never stored. No UDP transport.Beyond the ADR text
actandmay_act(RFC 8693), since a hook asserting a delegation chain would be as misleading as one assertingemail./admin/webhook-deliveriesrather than under/admin/webhooks, so the delivery routes cannot collide with/admin/webhooks/:id.Checks
npm test(675 passed),npm run lint,npm run build,npm run format:checkandnpm run test:zod-floor(zod 4.5.0 under bundler and NodeNext resolution) all pass locally.No
system_configkeys are added, so the CLIWRITABLE_KEYStest is unaffected.