pub struct OAuthServerConfig {Show 16 fields
pub issuer: String,
pub access_token_lifetime: Duration,
pub refresh_token_lifetime: Duration,
pub authorization_code_lifetime: Duration,
pub allow_public_clients: bool,
pub min_code_verifier_length: usize,
pub max_code_verifier_length: usize,
pub max_clients: usize,
pub max_authorization_codes: usize,
pub max_authorization_codes_per_client: usize,
pub max_access_tokens: usize,
pub max_access_tokens_per_client: usize,
pub max_refresh_tokens: usize,
pub max_refresh_tokens_per_client: usize,
pub max_revocation_tombstones: usize,
pub max_revocation_tombstones_per_client: usize,
}Expand description
Configuration for the OAuth authorization server.
Fields§
§issuer: StringIssuer identifier (URL) for this authorization server.
access_token_lifetime: DurationAccess token lifetime.
refresh_token_lifetime: DurationRefresh token lifetime.
Authorization code lifetime (should be short; the default is 5 minutes).
allow_public_clients: boolWhether to allow public clients (clients without a secret).
min_code_verifier_length: usizeMinimum PKCE code verifier length (default: 43, min: 43, max: 128).
max_code_verifier_length: usizeMaximum PKCE code verifier length.
max_clients: usizeMaximum number of registered clients (hard-capped by
HARD_MAX_OAUTH_CLIENTS).
Maximum number of pending authorization codes globally (hard-capped by
HARD_MAX_AUTHORIZATION_CODES).
Maximum number of pending authorization codes for one client
(hard-capped by HARD_MAX_AUTHORIZATION_CODES_PER_CLIENT).
max_access_tokens: usizeMaximum number of active access tokens globally (hard-capped by
HARD_MAX_ACCESS_TOKENS).
max_access_tokens_per_client: usizeMaximum number of active access tokens for one client (hard-capped by
HARD_MAX_ACCESS_TOKENS_PER_CLIENT).
max_refresh_tokens: usizeMaximum number of active refresh tokens globally (hard-capped by
HARD_MAX_REFRESH_TOKENS).
max_refresh_tokens_per_client: usizeMaximum number of active refresh tokens for one client (hard-capped by
HARD_MAX_REFRESH_TOKENS_PER_CLIENT).
max_revocation_tombstones: usizeMaximum number of revocation tombstones globally (hard-capped by
HARD_MAX_REVOCATION_TOMBSTONES).
max_revocation_tombstones_per_client: usizeMaximum number of revocation tombstones for one client (hard-capped by
HARD_MAX_REVOCATION_TOMBSTONES_PER_CLIENT).
Implementations§
Source§impl OAuthServerConfig
impl OAuthServerConfig
Sourcepub fn validate(&self) -> Result<(), OAuthError>
pub fn validate(&self) -> Result<(), OAuthError>
Validates PKCE policy, state-retention limits, and token lifetimes.
§Errors
Returns an error when PKCE bounds are outside RFC 7636, a state cap is zero, above its hard ceiling, incoherent, or over the checked aggregate retention ceiling, or a configured lifetime is zero or excessive.
Trait Implementations§
Source§impl Clone for OAuthServerConfig
impl Clone for OAuthServerConfig
Source§fn clone(&self) -> OAuthServerConfig
fn clone(&self) -> OAuthServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more