Skip to main content

Config

Struct Config 

Source
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: String

Public 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: String

Local file or immutable HTTPS URL listing the pinned OADs and overlays.

§database_url: String

PostgreSQL: connections, delegations, runtimes, handoffs and the single-use record of signed requests.

§encryption_key: String

Base64url-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: String

OPERATOR_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: u32

KEY_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: TrustForwardedFor

TRUST_FORWARDED_FOR: where the client address of that limit comes from. Defaults to TrustForwardedFor::None.

§webhooks: WebhookConfig

WEBHOOKS_ENABLED and the webhook inbox’s limits. Off by default.

§device: DeviceConfig

Registered public device clients and the owner approval bridge. Disabled by default.

Implementations§

Source§

impl Config

Source

pub fn from_env() -> Result<Self, String>

Source

pub fn public_origin(&self) -> String

The origin (scheme://host[:port]) of Config::base_url: a capability’s required aud.

Source

pub fn public_host(&self) -> String

host[:port] of Config::base_url, as the consent page shows it.

Source

pub fn provider_env_prefix(provider: &str) -> Result<String, String>

OAuth callback and credential variable names are deterministic from the catalog platform name, e.g. google-calendar becomes OAUTH_GOOGLE_CALENDAR_CLIENT_ID and /oauth/google-calendar/callback.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Forget for Config

§

impl Freeze for Config

§

impl Move for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnsafeUnpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more