SnoopConfig

DSL for install(Snoop) { ... }. Everything is a lambda so the host filters and redacts with plain predicates. All lists are additive across multiple calls.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Bodies larger than this (in bytes/chars) are captured truncated with a "truncated" flag.

Functions

Link copied to clipboard
fun filter(predicate: (HttpRequestBuilder) -> Boolean)

Keep only requests for which every filter returns true; a false skips capture entirely.

Link copied to clipboard
fun sanitizeBody(transform: (String) -> String)

Rewrite captured body previews (request and response) before they are stored — e.g. blank out a JSON field. Transforms apply in registration order, after truncation; only the stored preview is affected, never the real traffic.

Link copied to clipboard
fun sanitizeHeader(predicate: (String) -> Boolean)

Redact matching headers with a visible placeholder. Matches on the header name. Authorization, Cookie and Set-Cookie are always redacted on top of these.

Link copied to clipboard

Redact matching query parameter values in the captured URL. Matches on the parameter name. Common secret-bearing parameters (api_key, token, ...) are always redacted on top of these.