Package-level declarations

Types

Link copied to clipboard
class KeepMaskStrategy(keepPrefix: Int = 0, keepSuffix: Int = 0) : MaskStrategy

The built-in mask: keeps keepPrefix leading and keepSuffix trailing code points and masks the rest.

Link copied to clipboard
annotation class Mask(val keepPrefix: Int = 0, val keepSuffix: Int = 0, val strategy: KClass<out MaskStrategy> = MaskStrategy::class)

How query results mask a Sensitive value.

Link copied to clipboard
fun interface MaskStrategy

Masks one string value of a query result (SensitiveValue). It must not return null and should keep an empty string empty.

Link copied to clipboard
annotation class QueryAlias(vararg val value: String)

Other logical paths a query may use for this field, typically its names before a rename.

Link copied to clipboard
annotation class QueryDecimal(val scale: Int)

Declares a numeric field a fixed-point decimal with scale fraction digits, so query consumers format and total it at that precision: @field:QueryDecimal(scale = 2). Never inferred: a BigDecimal does not tell its precision. A field has one semantic type, so this cannot combine with QueryTemporal, QueryMoney, QueryDuration or QueryReference.

Link copied to clipboard

Declares a numeric field a length of time counted in unit, so query consumers format it as a duration: @field:QueryDuration(TimeUnit.SECONDS). Never inferred: an Int does not tell its unit. A field has one semantic type, so this cannot combine with QueryTemporal, QueryDecimal, QueryMoney or QueryReference.

Link copied to clipboard
annotation class QueryIndex(val name: String = "", val on: String = "", val with: Array<String> = [])

Declares a query index, so filters and sorts on its keys stay index scans as the snapshot table grows.

Link copied to clipboard
annotation class QueryMoney(val currency: String = "", val currencyField: String = "", val scale: Int = -1)

Declares a numeric field an amount of money, in exactly one of a fixed ISO 4217 currency or the currency held by the sibling string field currencyField (a property of the same object or element):

Link copied to clipboard
annotation class QueryReference(val aggregate: String, val context: String = "")

Declares a field (or the elements of an array field) the id of an aggregate, so query consumers can look the aggregate up and link to it: @field:QueryReference("member"), or @field:QueryReference("product", context = "catalog") for an aggregate of another bounded context. context defaults to the bounded context of the model that declares the field. The Manifest writes it as x-wow-reference: {"aggregate": "member", "context"?: "catalog"}. A field has one semantic type, so this cannot combine with QueryTemporal, QueryDecimal, QueryMoney or QueryDuration.

Link copied to clipboard
annotation class QueryTemporal(val unit: TimeUnit = TimeUnit.MILLISECONDS, val pattern: String = "")

Declares how a field encodes time when its type does not say so, so time conditions and date histograms can use it. Standard time types (Instant, LocalDate, OffsetDateTime, …) need no annotation.

Link copied to clipboard

This field is prose a reader searches by words: a product's name or description, a note, a reason.

Link copied to clipboard
annotation class Sensitive(val level: SensitivityLevel, val mask: Mask = Mask())

Declares a sensitive field of a query model: its level and how query results mask it.

Link copied to clipboard
class SensitiveValue @InternalWowApi constructor(val value: String, val level: SensitivityLevel)

A sensitive value as a MaskStrategy sees it: the raw value of a query result and the level its field declares. Fields may be added in a minor release: construct it with of; the constructor is internal to Wow. Masking does not depend on the caller, every caller seeing the same mask, so no caller is among its fields. A revealing read, which returns a DISPLAY value raw, does not ask the strategy for it at all.

Link copied to clipboard

How much the query subsystem protects a Sensitive field's raw value. Both levels mask the value in every query result; they differ in what a query may do with the raw value, and in whether the service's own code may ask for it: a revealing read (TrustedQueries.revealed(), a subscription handler's queries.revealed()) returns a DISPLAY value raw, never a CONFIDENTIAL one.