auth/audit_log_routes.ts

Audit log and admin observability route specs.

All routes require admin role by default. Provides audit event listing, permit history shortcut, and active session overview.

Declarations
#

2 declarations

view source

AuditLogRouteOptions
#

auth/audit_log_routes.ts view source

AuditLogRouteOptions

Options for audit log route specs.

required_role

Role required to access audit routes. Default 'admin'.

type string

stream

When provided, includes an SSE route at /audit-log/stream for realtime audit events. The subscribe function receives the stream, channels, and the subscriber's account_id as an identity key — enabling close_by_identity() for auth revocation.

type { subscribe: ( stream: SseStream<SseNotification>, channels?: Array<string>, identity?: string, ) => () => void; log: Logger; }

create_audit_log_route_specs
#

auth/audit_log_routes.ts view source

(options?: AuditLogRouteOptions | undefined): RouteSpec[]

Create audit log and admin observability route specs.

options?

optional options with role override

type AuditLogRouteOptions | undefined
optional

returns

RouteSpec[]

route specs for audit log and admin session management

Depends on
#