Skip to content

cayu.egress definitions

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.extensions.egress import DEFAULT_PROXY_SERVER_FACTORY
DEFAULT_PROXY_SERVER_FACTORY: ProxyServerFactory = TransparentEgressProxyServer

Release source · Runtime guarantees · Capability guides

DEFAULT_REMOTE_SETUP_COMMAND_TIMEOUT_SECONDS

Section titled “DEFAULT_REMOTE_SETUP_COMMAND_TIMEOUT_SECONDS”
from cayu.extensions.egress import DEFAULT_REMOTE_SETUP_COMMAND_TIMEOUT_SECONDS
DEFAULT_REMOTE_SETUP_COMMAND_TIMEOUT_SECONDS = 300

Release source · Runtime guarantees · Capability guides

from cayu.extensions.egress import prepare_exposed_proxy_binding

Start and expose one session proxy listener as an EgressBinding.

The binding’s teardown revokes the grants’ presented values and waits for that before closing the exposure and the listener. Any failure while starting or exposing the listener runs the same rollback, bounded by the default egress teardown timeout, before the original error propagates.

With transport_auth_token every connection must first present the session’s token in an authenticated transport tunnel. The token reaches only a trusted guest relay through the binding env, so the listener is usable only by this session even when the exposure is reachable from other sandboxes. Without that token, credentialless destinations require an exposure that asserts credentialless_isolated.

async prepare_exposed_proxy_binding(*, runner_kind: str, session_id: str, broker: TransparentEgressBroker, grants: Sequence[VirtualCredentialGrant], exposure: ProxyExposure, bind_host: str, loop: asyncio.AbstractEventLoop | None, proxy_server_factory: ProxyServerFactory, bind_port: int=0, certificate_authority: SessionCertificateAuthority | None=None, owns_certificate_authority: bool=True, transport_auth_token: bytes | None=None) -> EgressBinding

Release source · Runtime guarantees · Capability guides

from cayu.extensions.egress import ProxyServerFactory
ProxyServerFactory = Callable[..., TransparentEgressProxyServer]

Release source · Runtime guarantees · Capability guides

from cayu.extensions.egress import run_enforcement_preflight

Prove brokered reachability and direct-egress denial inside the guest.

Runs a python3 probe through runner.exec: the proxy must accept a CONNECT to the first grant destination and complete TLS with the guest CA, while direct TLS to public addresses must fail. With probe_metadata it also fails if link-local metadata is reachable. Returns the UTC observation time on success and raises UnsupportedEgressError (or UnsupportedEgressCapabilityError for metadata) otherwise.

async run_enforcement_preflight(runner: Runner, request: VirtualEgressRunnerRequest, *, timeout_s: int, probe_metadata: bool=True, metadata_isolation_reason: str | None=None, metadata_isolation_remediation: str | None=None) -> datetime

Release source · Runtime guarantees · Capability guides

from cayu.extensions.egress import run_setup_commands

Run each setup command through Runner.exec_system; fail on the first error.

async run_setup_commands(runner: Runner, request: VirtualEgressRunnerRequest) -> None

Release source · Runtime guarantees · Capability guides