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.
BrowserEgressPolicy
Section titled “BrowserEgressPolicy”from cayu.egress import BrowserEgressPolicyCredentialless 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.
Fields and attributes
Section titled “Fields and attributes”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 |
authorize (method)
Section titled “authorize (method)”BrowserEgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResultinit (method)
Section titled “init (method)”BrowserEgressPolicy.__init__(*, name: str, allowed_hosts: Iterable[str], allowed_path_prefixes: Iterable[str]=('/',), denied_prefixes: Iterable[str]=()) -> NoneRelease source · Runtime guarantees · Capability guides
EgressPolicy
Section titled “EgressPolicy”from cayu.egress import EgressPolicyAuthorizes 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.
Fields and attributes
Section titled “Fields and attributes”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 |
authorize (method)
Section titled “authorize (method)”EgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResultReturn whether the request may proceed to secret resolution.
Release source · Runtime guarantees · Capability guides
EgressRequest
Section titled “EgressRequest”from cayu.egress import EgressRequestThe 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.
Fields and attributes
Section titled “Fields and attributes”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 |
normalize_method (method)
Section titled “normalize_method (method)”EgressRequest.normalize_method(value: str, info) -> strnormalize_content_type (method)
Section titled “normalize_content_type (method)”EgressRequest.normalize_content_type(value: str | None) -> str | Nonenormalize_host (method)
Section titled “normalize_host (method)”EgressRequest.normalize_host(value: str, info) -> strvalidate_path (method)
Section titled “validate_path (method)”EgressRequest.validate_path(value: str, info) -> strRelease source · Runtime guarantees · Capability guides
HttpEgressPolicy
Section titled “HttpEgressPolicy”from cayu.egress import HttpEgressPolicyCoarse 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.
Fields and attributes
Section titled “Fields and attributes”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 |
authorize (method)
Section titled “authorize (method)”HttpEgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResultinit (method)
Section titled “init (method)”HttpEgressPolicy.__init__(*, name: str, allowed_hosts: Iterable[str], allowed_endpoints: Iterable[tuple[str, str]], denied_prefixes: Iterable[str]=()) -> NoneRelease source · Runtime guarantees · Capability guides
PublicWebEgressPolicy
Section titled “PublicWebEgressPolicy”from cayu.egress import PublicWebEgressPolicyApplication-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.
name (property)
Section titled “name (property)”PublicWebEgressPolicy.name() -> strauthorize (method)
Section titled “authorize (method)”PublicWebEgressPolicy.authorize(request: EgressRequest) -> ProxyAuthorizationResultinit (method)
Section titled “init (method)”PublicWebEgressPolicy.__init__(*, name: str) -> Noneadmits_hostname (method)
Section titled “admits_hostname (method)”PublicWebEgressPolicy.admits_hostname(host: str) -> bool