Skip to content

cayu.egress.policy

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.egress import BrowserEgressPolicy

Credentialless GET/HEAD policy for explicitly admitted web origins.

Browser page loads request paths that are not practical to enumerate one by one (documents, scripts, stylesheets, images, and fonts). This policy keeps destination authority application-owned while allowing only read-only HTTP methods beneath configured path prefixes. It deliberately does not accept model-provided hosts, methods, headers, or policy overrides. The broker also requires identity content encoding for this policy so decoded browser input can be bounded before buffering.

Bases: EgressPolicy.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
name str required
BrowserEgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResult
BrowserEgressPolicy.__init__(*, name: str, allowed_hosts: Iterable[str], allowed_path_prefixes: Iterable[str]=('/',), denied_prefixes: Iterable[str]=()) -> None

Release source · Runtime guarantees · Capability guides

from cayu.egress import EgressPolicy

Authorizes a captured request before any secret is resolved.

authorize is pure and synchronous: it must reach a decision using only the request, so the broker can deny disallowed traffic before touching the vault. A denial always carries a reason.

Bases: ABC.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
name str required
EgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResult

Return whether the request may proceed to secret resolution.

Release source · Runtime guarantees · Capability guides

from cayu.egress import EgressRequest

The policy’s view of one captured outbound request.

Deliberately excludes headers: a policy authorizes on destination, method, path, query, body metadata, and never needs to see the credential.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
method str required
host str required
path str required
query str ''
body bytes b''
content_type str | None None
EgressRequest.normalize_method(value: str, info) -> str
EgressRequest.normalize_content_type(value: str | None) -> str | None
EgressRequest.normalize_host(value: str, info) -> str
EgressRequest.validate_path(value: str, info) -> str

Release source · Runtime guarantees · Capability guides

from cayu.egress import HttpEgressPolicy

Coarse HTTP egress policy for brokered credentials.

This policy constrains credential use by host, method, and path. It does not infer provider-specific business semantics from request bodies or opaque provider object ids; applications and provider-scoped credentials remain responsible for business authorization.

Bases: EgressPolicy.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
name str required
HttpEgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResult
HttpEgressPolicy.__init__(*, name: str, allowed_hosts: Iterable[str], allowed_endpoints: Iterable[tuple[str, str]], denied_prefixes: Iterable[str]=()) -> None

Release source · Runtime guarantees · Capability guides

from cayu.egress import PublicWebEgressPolicy

Application-owned, credentialless public HTTPS GET/HEAD research.

Hostnames supplied by a workload are requests. The broker and its pinned upstream remain responsible for public IP admission on every connection. This policy has fixed semantics; changing its name changes durable authority.

Bases: EgressPolicy.

PublicWebEgressPolicy.name() -> str
PublicWebEgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResult
PublicWebEgressPolicy.__init__(*, name: str) -> None
PublicWebEgressPolicy.admits_hostname(host: str) -> bool

Release source · Runtime guarantees · Capability guides