API Core - v1.5.0
    Preparing search index...

    Interface Redaction

    The redaction engine bound to one sensitive-key vocabulary — the ONE surface shared by the call loggers and the HttpError snapshot, so a secret cannot reach a log through either route. Built by createRedaction; each consumer builds exactly one, seeded with its wire's credential keys.

    interface Redaction {
        isSensitive: (key: string) => boolean;
        redactUrl: (url: string) => string;
        redactValue: (value: unknown) => unknown;
    }
    Index
    isSensitive: (key: string) => boolean

    Whether a header or payload key names a secret.

    Type Declaration

      • (key: string): boolean
      • Parameters

        • key: string

          Header or payload key, in any casing.

        Returns boolean

        true when the value behind the key must be redacted.

    redactUrl: (url: string) => string

    Redacts the query-string portion of a URL through the same form-encoded vocabulary as the bodies: a token can ride inline in the URL (?code=…) rather than in a separate params record, and the URL travels into every log line and thrown-error snapshot.

    Type Declaration

      • (url: string): string
      • Parameters

        • url: string

          Request URL, with or without a query string.

        Returns string

        The URL with sensitive query values replaced by REDACTED.

    redactValue: (value: unknown) => unknown

    Redacts every value whose key names a secret, walking nested objects, arrays, JSON-encoded and form-encoded strings — the deep counterpart of Redaction.isSensitive.

    Type Declaration

      • (value: unknown): unknown
      • Parameters

        • value: unknown

          Any payload: object, array, string or primitive.

        Returns unknown

        The value with sensitive entries replaced by REDACTED.