GeoLeaf Core API - v3.19.0
    Preparing search index...

    Function redactSecrets

    • Removes from a piece of text the secrets this module knows the shape of.

      Redacted: the userinfo of a URL (https://user:password@host); query, fragment or space-separated parameters whose name says secret (key, code, sig, auth, jwt, and any name ending in token, secret, password, signature, credential, apikey or sessionid); Bearer credentials, and Basic ones that look encoded; JSON Web Tokens; JSON members whose key names a secret (password, apiKey, authorization, cookie…); e-mail addresses. The t cache token is kept.

      Parameters

      • text: string

        Any text: a log message, a serialised diagnostic.

      Returns string

      The text, each secret replaced by a [redacted…] marker.