Package-level declarations
The kotlinx.serialization backend for Ihawu masking — the write half of the engine for kotlinx.serialization, and the multiplatform one (JVM + JS). It executes the decisions the serialization-neutral ihawu-core engine makes, at kotlinx's serialization boundary.
Because kotlinx generates serializers at compile time (no per-property hook), masking works by letting a value serialize to a JsonElement and rewriting it per the engine's decision, recursing into nested @IhawuResource objects, lists, and map values through an explicit registry. See ADR 0008.
Entry point
maskingRegistry — build the
serialName → resourceNameregistry from resource serializers.maskingSerializer — wrap a resource serializer so it masks through the engine, recursing via the registry.
IhawuKotlinxJson — encode a value for a given
IhawuPrincipal; a missing principal fails closed to{}.
Limitations (v1)
Polymorphic / sealed
@IhawuResourcehierarchies are not masked (their elements pass through) — a documented follow-up.
The kotlinx.serialization backend for Ihawu masking — the write half of the engine for kotlinx.serialization, and the multiplatform one (JVM + JS). It executes the decisions the serialization-neutral ihawu-core engine makes, at kotlinx's serialization boundary.
Because kotlinx generates serializers at compile time (no per-property hook), masking works by letting a value serialize to a JsonElement and rewriting it per the engine's decision, recursing into nested @IhawuResource objects, lists, and map values through an explicit registry. See ADR 0008.
Entry point
maskingRegistry — build the
serialName → resourceNameregistry from resource serializers.maskingSerializer — wrap a resource serializer so it masks through the engine, recursing via the registry.
IhawuKotlinxJson — encode a value for a given
IhawuPrincipal; a missing principal fails closed to{}.
Limitations (v1)
Polymorphic / sealed
@IhawuResourcehierarchies are not masked (their elements pass through) — a documented follow-up.
Types
Encodes masked values with kotlinx.serialization, supplying the caller per encode.
Functions
A coroutine context element that installs principal's MaskingContext on whichever thread runs the (synchronous) encode — the bridge for coroutine callers such as Ktor (#82):
Builds the resource registry (serialName -> resourceName) that drives masking recursion, from each resource serializer and its @IhawuResource name. Register every resource type — including nested ones and collection element types — so they mask themselves when reached.