Package io.karatelabs.output
Class LogMask
java.lang.Object
io.karatelabs.output.LogMask
Declarative HTTP log masking. Applied by
HttpLogger when formatting
request / response payloads for the report buffer and the console.
Constructed from the map shape stored under configure logging = { mask: {...} }:
mask: {
headers: ['Authorization', 'Cookie'], // matched case-insensitively
jsonPaths: ['$.password', '$.token'], // simple "$.x.y" / "$..x" paths
patterns: [{ regex: '\\bBearer ...', replacement: 'Bearer ***' }],
replacement: '***', // default for headers / jsonPaths
enableForUri: function(uri) { return !uri.contains('/health') } // optional gate
}
-
Method Summary
-
Method Details
-
fromMap
-
describe
One-line description of mask rule counts, e.g."3 headers, 2 jsonPaths, 1 pattern". Used by the per-scenario "mask active" debug log so users can verify their config compiled. -
enabledForUri
-
isHeaderMasked
-
maskHeader
-
maskBody
-