IF Commons GitHub

sql/extensions/operations/identity/audit

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0041-identity-authorize FR-006

The audit trail of the identity model (commons data 0041-identity-authorize): each event is written in the transaction of what it records, and holds the hash of the event before it, so that a change to one shows in every one after it. The head of the chain is the event that no other names as its predecessor.

Source: commons/data/sql/extensions/operations/identity/audit.ts

2 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

ChainProblemtypeno test imports it
type ChainProblem = { readonly kind: "broken"; readonly at: string } | { readonly kind: "forked"; readonly at: string } | { readonly kind: "hash-mismatch"; readonly at: string };

What is wrong with a chain, or nothing.

IdentityAuditEventinterfaceno test imports it
interface IdentityAuditEvent extends AuditEvent

An audit event, with what the identity trail adds: on whose behalf, through what, and what decided.

MemberTypeWhat it is
onBehalfOf?string
delegationKey?string
runKey?string
decision?"allow" | "deny"
policyRefs?readonly string[]
chain?readonly string[]
actionstring
outcome"denied" | "failure" | "success"
actorKind"agent" | "device" | "impersonator" | "machine" | "system" | "user"
actor?string
tenant?string
targetConcept?string
targetKey?string
sessionKey?string
reason?string
detail?Readonly<Record<string, unknown>>
identityAuditSinkconst
const identityAuditSink: AuditSink

The audit sink of the identity model.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

verifyAuditChainfunction
function verifyAuditChain(tx: Tx): Promise<{ readonly length: number; readonly problems: readonly ChainProblem[]; }>

Walks the chain from its start and says where it is broken or forked.

ParameterWhat it is
txa transaction

Returns: how many events the chain holds, and what is wrong with it

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.