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 ittype 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 itinterface IdentityAuditEvent extends AuditEvent
An audit event, with what the identity trail adds: on whose behalf, through what, and what decided.
| Member | Type | What it is |
|---|
onBehalfOf? | string | |
delegationKey? | string | |
runKey? | string | |
decision? | "allow" | "deny" | |
policyRefs? | readonly string[] | |
chain? | readonly string[] | |
action | string | |
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>> | |
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
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.
| Parameter | What it is |
|---|
tx | a 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