QueryAudit

One query as an audit trail sees it: who asked (caller; Wow does not own identity), what shape of query on which model version, under which restrictions, and what came back. It never carries a filter value, so no personal data from the query reaches the audit log.

Parameters

fingerprinter

computes fingerprint on first read.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

How the query ended: it completed, failed or was cancelled.

Properties

Link copied to clipboard

the aggregate type queried.

Link copied to clipboard

who ran the query, for the principal and its attributes.

Link copied to clipboard

The tenants a cross-tenant query read, the caller's; null for any other. Every such audit is logged at INFO (CROSS_TENANT_LOGGER).

Link copied to clipboard

the time from the start of the query to its end.

Link copied to clipboard

the query's entry, as the caller stated it.

Link copied to clipboard

the error code of a failed query (QueryError.errorCode and, when it states one, the rule code of its first binding error); for a state read answered as not found, wow.aggregate.not-found:<reason> (StateNotFoundException.Reason).

Link copied to clipboard

A hash of the submitted query's shape (queryShapeOf: operators, fields, value counts, sort, projection, groups, metrics and the paging kind and size), with every value, search text, alias and cursor left out, so equal shapes group together. Computed on first read, so an observer that never reads it (a metrics observer, say) does not pay for it.

Link copied to clipboard

the fields of the model the response carries masked, read from the admitted (canonical) projection so an alias cannot hide one. A state read's are its state's (state.<path>), and a trace's those of its states and of every event's body of its aggregate (events.body.<path>, as the events model names them), each named from the schema the read masked it by: the type's snapshot query or policy gateway's when it has one, else the Manifest's. An events query's and a trace's also name the fields of each scheduled command they return (events.body.command.<path>), from the schema of the command type its schedule names. Empty for a count, an aggregation or a query rejected before admission. A query that reveals DISPLAY values (QueryCaller.revealsDisplay) masks its CONFIDENTIAL fields alone.

Link copied to clipboard

the queried model, or null when the query was rejected before its schema loaded, and for a state read (QueryType.STATE, QueryType.TRACE), which reads no query model.

Link copied to clipboard

the content hash of the model's schema (QueryModelSchema.version).

Link copied to clipboard

how the query ended.

Link copied to clipboard

the QueryPolicy classes that restricted the query (those that returned anything but match-all).

Link copied to clipboard

the gateway operation.

Link copied to clipboard

the DISPLAY fields the response carries raw: those of maskedFields' kind that a query revealing them returns as they are; empty for any other query. A non-empty list is the record of a revealing read, with caller for who read it (no caller for trusted code, the service itself).

Link copied to clipboard
val rows: Long

the records or aggregation rows delivered; a count delivers one.

Link copied to clipboard

the fields the caller's scope restricts (tenantId, ownerId, ...), not their values.

Functions

Link copied to clipboard
open override fun toString(): String

Leaves caller out: it holds scope values and principal attributes that must not reach a log line.