pub struct Config {Show 14 fields
pub base_url: String,
pub port: u16,
pub session_secret: Option<String>,
pub catalog_path: String,
pub database_url: String,
pub encryption_key: String,
pub revoked_subjects: Vec<String>,
pub allowed_agents: Option<Vec<String>>,
pub operator_name: String,
pub operator_url: Option<String>,
pub key_check_limit_per_hour: u32,
pub trust_forwarded_for: TrustForwardedFor,
pub webhooks: WebhookConfig,
pub device: DeviceConfig,
}Expand description
Runtime configuration, loaded entirely from environment variables so the server itself stays container-friendly.
Issue #54 removed the tenant concept. APP_AUTH_*, SERVER_SECRET and
the other tenant-era variables are no longer read; leaving them set is
harmless.
Fields§
§base_url: StringPublic URL the proxy is reachable at, e.g. https://auth.example.com.
Used for OAuth redirect URLs, and as the origin of the URL covered by
every Atomic v2 request signature and of a capability’s aud. It must
be exactly what clients use: behind TLS termination the proxy cannot
tell its public scheme or host from the request.
port: u16§session_secret: Option<String>Secret used to encrypt the short-lived consent and OAuth-binding cookies. If unset, a random key is generated at startup, so a consent screen open during a restart has to be started again.
catalog_path: StringLocal file or immutable HTTPS URL listing the pinned OADs and overlays.
database_url: StringPostgreSQL: connections, delegations, runtimes, handoffs and the single-use record of signed requests.
encryption_key: StringBase64url-encoded 32-byte key for sealed provider credentials.
revoked_subjects: Vec<String>REVOKED_SUBJECTS: comma-separated agent ids (any accepted spelling)
refused by the default access policy.
allowed_agents: Option<Vec<String>>ALLOWED_AGENTS: when set, comma-separated agent ids; the default
access policy admits only these owners.
operator_name: StringOPERATOR_NAME: who runs this proxy, as the landing and consent pages
name them. Defaults to DEFAULT_OPERATOR_NAME when unset or blank.
operator_url: Option<String>OPERATOR_URL: optional absolute http(s) link for the operator’s
name on those pages.
key_check_limit_per_hour: u32KEY_CHECK_LIMIT_PER_HOUR: the most API key or token checks the
consent form makes for one client network and platform in any hour.
Defaults to DEFAULT_KEY_CHECK_LIMIT_PER_HOUR; 0 turns the limit
off.
trust_forwarded_for: TrustForwardedForTRUST_FORWARDED_FOR: where the client address of that limit comes
from. Defaults to TrustForwardedFor::None.
webhooks: WebhookConfigWEBHOOKS_ENABLED and the webhook inbox’s limits. Off by default.
device: DeviceConfigRegistered public device clients and the owner approval bridge. Disabled by default.
Implementations§
Source§impl Config
impl Config
pub fn from_env() -> Result<Self, String>
Sourcepub fn public_origin(&self) -> String
pub fn public_origin(&self) -> String
The origin (scheme://host[:port]) of Config::base_url: a
capability’s required aud.
Sourcepub fn public_host(&self) -> String
pub fn public_host(&self) -> String
host[:port] of Config::base_url, as the consent page shows it.