redact

suspend fun redact(vararg patterns: String, timeout: Duration = 30.seconds)(source)

Adds regular expressions (Java syntax) whose matches are replaced by <redacted> in everything read from now on, lines already captured included: by read and follow, Device.deviceLogs and the failure artifacts. A match is replaced whole; a pattern with a capturing group has only its first group replaced (session=(\w+) keeps session=).

Redacted without any call: Authorization / Cookie style headers, password= / token= style values, bearer tokens, JWTs, and the text of every sensitive setText / typeText on this device. At most 64 patterns per attachment.