pub struct OAuthConfig {Show 32 fields
pub host: String,
pub port: u16,
pub external_url: Option<String>,
pub default_scopes: Vec<String>,
pub token_ttl_seconds: u32,
pub refresh_token_ttl_seconds: u32,
pub tls_cert: Option<PathBuf>,
pub tls_key: Option<PathBuf>,
pub quic_port: Option<u16>,
pub deployment_well_known_dir: Option<PathBuf>,
pub cors: CorsConfig,
pub trusted_issuers: HashMap<String, TrustedIssuerConfig>,
pub identity_registration_did_web_origins: Vec<String>,
pub mesh_peers: HashMap<String, MeshPeerConfig>,
pub authority_hints: Vec<String>,
pub oidc_providers: HashMap<String, OidcProviderConfig>,
pub user_signing_key: Option<String>,
pub client_jwks_uri_cache_ttl_secs: u64,
pub jwt_key_active_days: u32,
pub jwt_key_lead_days: u32,
pub jwt_key_drain_days: u32,
pub jwt_key_active_secs: Option<u32>,
pub jwt_key_lead_secs: Option<u32>,
pub jwt_key_drain_secs: Option<u32>,
pub jwt_key_rotation_check_secs: Option<u64>,
pub require_pushed_authorization_requests: bool,
pub xrpc_read_slice: bool,
pub public_git_canary_backend_port: Option<u16>,
pub public_git_canary_registry_repo_id: Option<String>,
pub public_git_canary_publisher_did: Option<String>,
pub atproto_plc_directory_url: String,
pub atproto_did_cache_ttl_secs: u64,
}Expand description
OAuth 2.1 authorization server configuration
Provides OAuth 2.1 (draft-ietf-oauth-v2-1-13) authorization for MCP and OAI services. Supports RFC 7591 (Dynamic Client Registration), RFC 8414 (AS Metadata), RFC 8707 (Resource Indicators), and Client ID Metadata Documents.
Fields§
§host: StringHost address for OAuth server
port: u16Port for OAuth server
external_url: Option<String>External URL for this server (used in metadata responses). Auto-derived from host:port if not set.
default_scopes: Vec<String>Default scopes granted to new clients
token_ttl_seconds: u32Access token TTL in seconds
refresh_token_ttl_seconds: u32Refresh token TTL in seconds (default: 72 hours)
tls_cert: Option<PathBuf>TLS certificate path (optional, overrides global [tls])
tls_key: Option<PathBuf>TLS private key path (optional, overrides global [tls])
quic_port: Option<u16>QUIC/WebTransport port. None = no QUIC, Some(0) = ephemeral, Some(N) = explicit.
deployment_well_known_dir: Option<PathBuf>Deployment static well-known directory (#1137 / #1136 serving half).
When set, this OAuth instance terminates the deployment’s did:web host:
/.well-known/did.json serves <dir>/did.json (replacing the dynamic
node document), /.well-known/at9p/<cid>.cbor serves the cluster at9p
capsule, /.well-known/deployment/deployment-authority.log.json serves
the current root-anchored authority log, and
/.well-known/deployment/registry-service.jwt serves the current
registry credential. All are public, integrity-anchored bytes re-read
on every request so an external credential-refresh agent needs no
restart.
cors: CorsConfigCORS configuration for the OAuth HTTP server
trusted_issuers: HashMap<String, TrustedIssuerConfig>Trusted external OIDC issuers for federation.
Key = issuer URL (must match JWT iss claim exactly).
Value = configuration for fetching/caching that issuer’s JWKS.
identity_registration_did_web_origins: Vec<String>Exact HTTPS origins permitted for authenticated did:web federation
intake through the identity registration API.
This is deliberately separate from CORS, OIDC issuers, and federation
policy. Entries must be origins only (no wildcard, path, query,
fragment, or userinfo). An empty list disables did:web intake while
retaining the fixed-directory did:plc arm.
mesh_peers: HashMap<String, MeshPeerConfig>Trusted mesh peers’ post-quantum signing identities (#157).
Key = an operator-chosen peer label (informational only).
Value = the peer’s Ed25519 mesh signer key + ML-DSA-65 mesh verifying
key, supplied inline as out-of-band Multikey strings. Populates the
process-global KeyedPqTrustStore eagerly at startup (admin-anchored,
immutable). Empty = empty store = unchanged behavior (Hybrid fails
closed for unknown peers). Distinct from trusted_issuers.
OpenID Federation 1.0 Trust Anchor URLs (optional).
When set, included as authority_hints in the entity configuration JWT,
making this node discoverable within the named federations.
Example: ["https://federation.example.org"]
oidc_providers: HashMap<String, OidcProviderConfig>External OIDC providers for login delegation (IdP-agnostic).
Users authenticate with the external provider; hyprstream validates the
external id_token and issues its own JWT with scopes from the policy engine.
Separate from trusted_issuers which is for hyprstream federation (direct
JWT acceptance between nodes).
user_signing_key: Option<String>Hex-encoded Ed25519 private key bytes for the local user identity (bypasses OS keyring).
TEST USE ONLY. Set via HYPRSTREAM__OAUTH__USER_SIGNING_KEY env var.
Allows the sign-challenge CLI and wizard to use a pre-generated key in
isolated test environments without a keyring daemon.
Never set this in production config files.
client_jwks_uri_cache_ttl_secs: u64How long to cache a third-party OAuth client’s JWKS fetched
via jwks_uri (RFC 7591 §2.1). Applies to private_key_jwt
client authentication at the token endpoint.
Clients that rotate signing keys faster than this should keep the old key in their JWKS for at least one cache window so verification spans the rotation (standard JWKS rotation hygiene). Default: 3600 seconds (1 hour).
Distinct from trusted_issuers[*].jwks_cache_ttl_secs (which
configures hyprstream federation peers, not OAuth clients).
jwt_key_active_days: u32How many days a JWT signing key remains in the active (issuance) slot.
jwt_key_lead_days: u32How many days before active-key expiry a lead key is pre-generated.
jwt_key_drain_days: u32How many extra days after active-key expiry the drain key remains in JWKS for verification.
jwt_key_active_secs: Option<u32>Override active key lifetime in seconds (takes precedence over jwt_key_active_days).
Intended for integration tests with short rotation cycles.
jwt_key_lead_secs: Option<u32>Override lead key pre-generation window in seconds (takes precedence over jwt_key_lead_days).
jwt_key_drain_secs: Option<u32>Override drain key retention window in seconds (takes precedence over jwt_key_drain_days).
jwt_key_rotation_check_secs: Option<u64>Override rotation check interval in seconds (default: 21600 = 6 hours).
Enforce RFC 9126 Pushed Authorization Requests at /oauth/authorize.
When true, the authorization endpoint rejects any request that does
not arrive via a request_uri referencing a prior /oauth/par call.
Advertised in server metadata as require_pushed_authorization_requests.
Defaults to false for compatibility.
xrpc_read_slice: boolEnable the com.atproto.* XRPC read slice (/xrpc/…) served from the
OAuth HTTP surface (#1112). Defaults to false — the data plane is
inert until the operator explicitly opts in and the write path (#910)
populates the in-process XrpcRepoStore with public-flagged snapshots.
When false, the XRPC routes are not mounted at all.
public_git_canary_backend_port: Option<u16>Enable the single, read-only public Git canary proxy on the HTTPS
listener. The proxy forwards only the fixed canary.git upload-pack
endpoints to this loopback port. The loopback backend must itself be
configured with exactly one exported repository and no receive-pack.
None leaves the public Git routes unmounted.
public_git_canary_registry_repo_id: Option<String>Opt in one Registry-owned ai.hyprstream.model record to the public
XRPC getRecord path. This is the canonical Registry UUID; the publisher
Every other record remains behind the existing Discovery policy boundary.
public_git_canary_publisher_did: Option<String>Exact Registry PdsPublisher DID from the operator-attested canonical mapping. Registry and OAuth have distinct process signing keys, so the OAuth key cannot be used to infer this publisher identity. Both canary fields must be configured together; neither is set by default.
atproto_plc_directory_url: StringRead-only PLC directory used to resolve ATProto account signing keys.
atproto_did_cache_ttl_secs: u64TTL for validated ATProto DID documents.
Implementations§
Source§impl OAuthConfig
impl OAuthConfig
Sourcepub fn active_secs(&self) -> i64
pub fn active_secs(&self) -> i64
Active key lifetime in seconds (_secs override wins over _days * 86400).
Sourcepub fn drain_secs(&self) -> i64
pub fn drain_secs(&self) -> i64
Drain retention window in seconds.
Sourcepub fn rotation_check_interval(&self) -> Duration
pub fn rotation_check_interval(&self) -> Duration
Rotation check interval (default 6 hours).
Sourcepub fn issuer_url(&self) -> String
pub fn issuer_url(&self) -> String
Get the configured issuer URL, preserving an explicit path when set,
otherwise deriving it from host:port.
Auto-derives https:// when global TLS is enabled.
Trait Implementations§
Source§impl Clone for OAuthConfig
impl Clone for OAuthConfig
Source§fn clone(&self) -> OAuthConfig
fn clone(&self) -> OAuthConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OAuthConfig
impl Debug for OAuthConfig
Source§impl Default for OAuthConfig
impl Default for OAuthConfig
Source§impl<'de> Deserialize<'de> for OAuthConfig
impl<'de> Deserialize<'de> for OAuthConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for OAuthConfig
impl RefUnwindSafe for OAuthConfig
impl Send for OAuthConfig
impl Sync for OAuthConfig
impl Unpin for OAuthConfig
impl UnsafeUnpin for OAuthConfig
impl UnwindSafe for OAuthConfig
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request