pub struct DeviceFlowConfig {Show 13 fields
pub client_id: String,
pub client_secret: Option<Secret<String>>,
pub scopes: Vec<String>,
pub redirect_uri: Option<Url>,
pub poll_interval: Duration,
pub max_attempts: u32,
pub backoff_multiplier: f64,
pub max_poll_interval: Duration,
pub user_agent: Option<String>,
pub additional_headers: HashMap<String, String>,
pub generic_provider_config: Option<GenericProviderConfig>,
pub request_timeout: Duration,
pub use_pkce: Option<bool>,
}
Expand description
Configuration for the device flow
Fields§
§client_id: String
OAuth client ID
client_secret: Option<Secret<String>>
OAuth client secret (optional, required for some providers)
scopes: Vec<String>
Requested scopes
redirect_uri: Option<Url>
Custom redirect URI (optional)
poll_interval: Duration
Polling interval
max_attempts: u32
Maximum number of polling attempts
backoff_multiplier: f64
Exponential backoff multiplier for polling
max_poll_interval: Duration
Maximum polling interval (for backoff)
user_agent: Option<String>
Custom user agent for HTTP requests
additional_headers: HashMap<String, String>
Additional headers to send with requests
generic_provider_config: Option<GenericProviderConfig>
Configuration for generic providers
request_timeout: Duration
Timeout for HTTP requests
use_pkce: Option<bool>
Whether to use PKCE (Proof Key for Code Exchange)
Implementations§
Source§impl DeviceFlowConfig
impl DeviceFlowConfig
Sourcepub fn client_secret(self, client_secret: impl Into<String>) -> Self
pub fn client_secret(self, client_secret: impl Into<String>) -> Self
Set the client secret
Sourcepub fn redirect_uri(self, uri: impl Into<String>) -> Result<Self, ParseError>
pub fn redirect_uri(self, uri: impl Into<String>) -> Result<Self, ParseError>
Set the redirect URI
Sourcepub fn poll_interval(self, interval: Duration) -> Self
pub fn poll_interval(self, interval: Duration) -> Self
Set the polling interval
Sourcepub fn max_attempts(self, attempts: u32) -> Self
pub fn max_attempts(self, attempts: u32) -> Self
Set the maximum number of polling attempts
Sourcepub fn backoff_multiplier(self, multiplier: f64) -> Self
pub fn backoff_multiplier(self, multiplier: f64) -> Self
Set the exponential backoff multiplier
Sourcepub fn max_poll_interval(self, interval: Duration) -> Self
pub fn max_poll_interval(self, interval: Duration) -> Self
Set the maximum polling interval
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Set a custom user agent
Sourcepub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an additional header
Sourcepub fn generic_provider(self, config: GenericProviderConfig) -> Self
pub fn generic_provider(self, config: GenericProviderConfig) -> Self
Set the generic provider configuration
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Set the HTTP request timeout
Sourcepub fn effective_scopes(&self, provider: Provider) -> Vec<String>
pub fn effective_scopes(&self, provider: Provider) -> Vec<String>
Get the effective scopes for a provider
Sourcepub fn effective_poll_interval(&self, provider: Provider) -> Duration
pub fn effective_poll_interval(&self, provider: Provider) -> Duration
Get the effective polling interval for a provider
Sourcepub fn should_use_pkce(&self, provider: Provider) -> bool
pub fn should_use_pkce(&self, provider: Provider) -> bool
Check if PKCE should be used for a provider
Sourcepub fn requires_client_secret(&self, provider: Provider) -> bool
pub fn requires_client_secret(&self, provider: Provider) -> bool
Check if client secret is required for a provider
Trait Implementations§
Source§impl Clone for DeviceFlowConfig
impl Clone for DeviceFlowConfig
Source§fn clone(&self) -> DeviceFlowConfig
fn clone(&self) -> DeviceFlowConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more