Skip to main content

writeAuditEntry

@nmi-agro/fdm-source


@nmi-agro/fdm-source / fdm-core/src / writeAuditEntry

Function: writeAuditEntry()

writeAuditEntry(fdm, origin, resource, action, principal_id, granting_resource, granting_resource_id, duration): Promise<void>

Defined in: fdm-core/src/authorization.ts:257

Writes a single audit entry for operations that authorize via SQL-level filtering rather than checkPermission (e.g. list operations). Reads channel and credential_id from the active AuditContext.

Parameters

fdm

PgDatabase

Database context.

origin

string

Source function name for audit trail.

resource

Resource

The resource type being listed.

action

Action

The action performed (typically "list").

principal_id

any

The principal performing the action.

granting_resource

string

The resource type that grants this access.

granting_resource_id

string

The ID of the granting resource.

duration

number

Time taken in milliseconds.

Returns

Promise<void>