Skip to main content

Module binding

Module binding 

Source
Expand description

Session registration: the binding of (org, project, session) to an account, and the env set a child is stamped with.

The child never holds a real credential. Its ANTHROPIC_BASE_URL points at this listener with the three routing segments in the path, and the credential it does hold is a dummy delivered through the SAME variable the account’s real credential uses - moving a credential between variables changes which entitlements reach the backend, not only which header carries it.

Re-exports§

use std::collections::HashMap; 🔒
use forge_primitives::account::Provider; 🔒
use parking_lot::Mutex; 🔒
use crate::account::AccountKey; 🔒

Structs§

Bindings
The session bindings, keyed by the three routing segments.
EnvSet
The env a child is stamped with, in insertion order.
Registration
One spawn’s registration: who owns the session and where it sits.

Constants§

ALT_BASE_URL_VARIABLE 🔒
API_KEY_VARIABLE 🔒
AUTH_TOKEN_VARIABLE 🔒
BASE_URL_VARIABLE 🔒
DUMMY_CREDENTIAL
What the CLI sends when it has no real credential. Authorises nothing upstream; the gateway replaces it before forwarding.
OAUTH_VARIABLE 🔒

Functions§

credential_variable_for
The variable the account’s real credential lives in, which is the variable its dummy has to travel in too. The one home for the rule: the config load maps the flat token onto it, the stamp puts the dummy in it, and the forward leg reads the real credential back out of it.
stamped_gateway_keys 🔒
The four gateway-owned keys, stamped fresh for registration: every other env key composes per the documented precedence, these four are the gateway’s alone.