Package-level declarations

Types

Link copied to clipboard
class DefaultMaskingEngine(resolver: ResourcePolicyResolver, onFailClosed: MaskingFailureSink = MaskingFailureSink { _ -> }, resolverErrorMode: ResolverErrorMode = ResolverErrorMode.MASK_ALL) : MaskingEngine

The default MaskingEngine: resolves each resource's policy once per call (via MaskingContext.memoize) and fails closed, entirely independent of any serialization library.

Link copied to clipboard

Why a field was dropped fail-closed — for observability (logging today; metrics/alerting later).

Link copied to clipboard

How a single field may be masked so the output still satisfies the field's declared type contract.

Link copied to clipboard
interface MaskingContext

The call-scoped context a serialization backend supplies to a MaskingEngine for one write.

Link copied to clipboard
sealed interface MaskingDecision

The masked outcome for one field: decided by a MaskingEngine and executed by a serialization backend. The engine renders the decision fully (down to the concrete value written), so the declared type contract lives in one neutral place rather than being re-derived by each backend.

Link copied to clipboard
interface MaskingEngine

The serialization-neutral masking contract: given one field, decide what to write.

Link copied to clipboard
class MaskingFailure(val resource: String, val reason: FailReason, val field: String? = null, val cause: Throwable? = null)

The event fired for each fail-closed drop, delivered to MaskingFailureSink.onFailClosed.

Link copied to clipboard
fun interface MaskingFailureSink

Notified whenever a MaskingEngine drops a field fail-closed, so a serialization backend can surface the failure without the engine depending on any logging library.

Link copied to clipboard
class MaskingResolverException(val resource: String, val cause: Throwable) : RuntimeException

Thrown by DefaultMaskingEngine when the policy resolver fails and the engine is configured with ResolverErrorMode.FAIL_REQUEST, so a resolver outage surfaces as an error (an adapter maps it to a 5xx) instead of a silently masked {} that reports success.

Link copied to clipboard

Defines how Ihawu transforms a restricted field before it reaches the serialization output.

Link copied to clipboard

How DefaultMaskingEngine reacts when the policy resolver throws — a policy-store outage or a misconfiguration. Scoped to the resolver-error path only: a missing principal always masks fail-closed regardless of this mode. See ../../../../../../../docs/adr/0011-configurable-fail-request-on-resolver-error.md.