Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.06 KB

File metadata and controls

36 lines (27 loc) · 1.06 KB
title services.audit
description Audit write bridge currently used by settings/runtime integrations.

services.audit

  • Stability: experimental
  • Canonical source: packages/services/service-settings/src/settings-service.types.ts

services.audit is currently a lightweight sink abstraction used by runtime services (for example service-settings) to emit append-only audit entries.

Method

services.audit.record(entry: {
  namespace: string;
  key: string;
  scope: SpecifierScope;
  userId?: string;
  actor?: string;
  action: 'set' | 'reset';
  valueDigest: string;
  encrypted: boolean;
  requestId?: string;
}): Promise<void> | void

Notes

  • This API is intentionally write-only.
  • For querying audit history, use services.data against sys_audit_log/sys_activity objects.

Typical Errors

Sink implementations should avoid throwing into user paths: the runtime caller (for example service-settings) awaits record() without a surrounding try/catch, so a throwing sink propagates its error and fails the caller's write.