core / pragma.http /
Package pragma.http #
Types #
| Name | Summary |
|---|---|
Builds outbound ktor clients on the Apache5 engine, which pools connections. CIO only reuses connections when pipelining is enabled, so every request would otherwise pay a new TCP connect and TLS handshake. | |
A client certificate the HTTP client presents for mutual TLS. Server trust stays the JVM default. | |
Wraps a TimedHttpClient with a per-instance cap on the number of concurrent outbound requests, enforced by a MetrickingPragmaSemaphore. Each convenience method holds a permit for the duration of the call. use is a pass-through and is not permit-limited: it hands out the raw ktor client rather than issuing a single request. | |
Value of the failure_reason tag on outbound HTTP timers. NONE covers both success and an HTTP error status, which the result tag already records. | |
An outbound HTTP request. | |
The one exception TimedHttpClient throws when a request fails without a response. failureReason says why, and the underlying exception is attached as the cause, a RedactedException copy is returned if the request contains any HttpRequest.sensitiveValues. | |
Marks where a redacted copy of a cause chain stops. The original’s deeper causes and suppressed throwables were dropped. | |
Stands in for a throwable whose message carried a sensitive value. The cause is attached afterwards with initCause, so a cause chain that loops can be copied as the same loop. | |
Secrets an outbound request carries, keyed by a label. redact replaces each value, raw or URL-encoded, with <<label>>. Only declared values are matched, so a caller that sends a secret must declare it on the request. | |
Issues outbound requests and records their timing. The sensitiveValues parameter on each helper declares the secrets and provider account IDs the request carries, which are redacted from the exceptions thrown on failure. See HttpRequest. |
Functions #
| Name | Summary |
|---|---|
Rebuilds ktor’s response exception, keeping its type, over a view of the response whose request URL is redacted. ktor builds the message from that URL, which is how query parameters reach logs. The view reads the original body unchanged. A subclass ktor does not define cannot be rebuilt with its own type, so it fails closed: it becomes a plain ResponseException, which callers catching that subclass by type no longer match.
Returns this throwable unchanged when no message in its cause or suppressed chain carries a sensitive value. Otherwise returns a copy of the chain made of RedactedExceptions. |