Trusted

The policy for a known upstream: it checks the scheme, optionally pins the host, and applies the downgrade rule. It does no address filtering, has no name rule and no port rule, so a private address is fetchable.

Stable Core. Equality is on every property. toString() prints the number of pinned hosts, never a host.

Types

Link copied to clipboard

Collects the properties of a Trusted. Not thread-safe; use it only inside the factory's lambda. A property holds the caller's reference until the policy is built, which copies it.

Properties

Link copied to clipboard

Whether http is allowed; false means https only.

Link copied to clipboard

The hosts a hop may reach, canonical (lower-case; IPv6 without brackets); empty means any host. Exact match with Url.host.

Link copied to clipboard
open override val settings: TransportSettings

The caps, timeouts and concurrency limits that go with this policy.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two Trusted policies are equal when their pinnedHosts, allowCleartext and settings are equal.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: the number of pinnedHosts, never a host, allowCleartext and settings. Its format is not part of the API and may change.