pub struct AuthplaneClientBuilder { /* private fields */ }Expand description
Builder for AuthplaneClient.
Every knob defaults to the value AuthplaneClient::create uses, so a
builder built without further configuration produces a client identical to
one obtained from that constructor.
Implementations§
Source§impl AuthplaneClientBuilder
impl AuthplaneClientBuilder
Sourcepub const DEFAULT_JWKS_REFRESH_SECONDS: u64 = 300
pub const DEFAULT_JWKS_REFRESH_SECONDS: u64 = 300
Default JWKS refresh interval.
Sourcepub const DEFAULT_METADATA_REFRESH_SECONDS: u64 = 3600
pub const DEFAULT_METADATA_REFRESH_SECONDS: u64 = 3600
Default AS-metadata refresh interval.
Sourcepub fn with_fetch_settings(self, fetch_settings: FetchSettings) -> Self
pub fn with_fetch_settings(self, fetch_settings: FetchSettings) -> Self
Outbound HTTP / SSRF policy. Applied to both AS metadata and JWKS document fetches — RFC 8414 / RFC 7517 share the same threat profile, so a single setting governs both.
Sourcepub fn with_jwks_refresh_seconds(self, seconds: u64) -> Self
pub fn with_jwks_refresh_seconds(self, seconds: u64) -> Self
Override the JWKS refresh interval (seconds).
Sourcepub fn with_metadata_refresh_seconds(self, seconds: u64) -> Self
pub fn with_metadata_refresh_seconds(self, seconds: u64) -> Self
Override the AS-metadata refresh interval (seconds).
Sourcepub fn with_token_cache_ttl_buffer_seconds(self, buffer_seconds: f64) -> Self
pub fn with_token_cache_ttl_buffer_seconds(self, buffer_seconds: f64) -> Self
Override the token-cache TTL buffer.
Sourcepub fn with_default_token_ttl_seconds(self, seconds: f64) -> Self
pub fn with_default_token_ttl_seconds(self, seconds: f64) -> Self
Override the fallback token TTL used when the AS does not return one.
Sourcepub fn with_circuit_breaker_threshold(self, threshold: u32) -> Self
pub fn with_circuit_breaker_threshold(self, threshold: u32) -> Self
Override the circuit-breaker threshold.
Sourcepub fn with_circuit_breaker_cooldown_seconds(
self,
cooldown_seconds: f64,
) -> Self
pub fn with_circuit_breaker_cooldown_seconds( self, cooldown_seconds: f64, ) -> Self
Override the circuit-breaker cooldown (seconds).
Sourcepub fn with_auth(self, provider: Arc<dyn AuthProvider>) -> Self
pub fn with_auth(self, provider: Arc<dyn AuthProvider>) -> Self
Store a default auth provider (e.g., ClientCredentialsProvider)
so callers can use methods without passing credentials each time.
Sourcepub fn with_dpop_provider(self, provider: Arc<DpopProvider>) -> Self
pub fn with_dpop_provider(self, provider: Arc<DpopProvider>) -> Self
Wire an outbound DPoP provider so client_credentials /
exchange_token / introspect / revoke use a shared signing
key + nonce store when callers pass Some(&proof_options).
Sourcepub fn with_metadata_change_callback(
self,
callback: MetadataChangeCallback,
) -> Self
pub fn with_metadata_change_callback( self, callback: MetadataChangeCallback, ) -> Self
Register an async callback fired when AS metadata changes (e.g.
jwks_uri rotation).
Sourcepub async fn build(self) -> Result<AuthplaneClient, AuthplaneError>
pub async fn build(self) -> Result<AuthplaneClient, AuthplaneError>
Build and initialize the AuthplaneClient.
Performs AS metadata discovery, validates the issuer, primes the JWKS cache, and returns a fully wired client ready to use.