pub struct OAuth2ClientConfig {
pub provider: OAuth2ProviderConfig,
pub use_pkce: bool,
pub use_state: bool,
pub validate_scope: bool,
pub allowed_scopes: HashSet<String>,
pub timeout_ms: u64,
}Expand description
OAuth2 客户端配置
Fields§
§provider: OAuth2ProviderConfig提供者配置
use_pkce: bool是否启用 PKCE
use_state: bool是否启用状态验证
validate_scope: bool是否验证 scope
allowed_scopes: HashSet<String>允许的 scope 集合
timeout_ms: u64请求超时(毫秒)
Implementations§
Source§impl OAuth2ClientConfig
impl OAuth2ClientConfig
Sourcepub fn new(provider: OAuth2ProviderConfig) -> Self
pub fn new(provider: OAuth2ProviderConfig) -> Self
创建新的客户端配置
Sourcepub fn with_state_validation(self, use_state: bool) -> Self
pub fn with_state_validation(self, use_state: bool) -> Self
设置是否启用状态验证
Sourcepub fn with_scope_validation(self, validate: bool) -> Self
pub fn with_scope_validation(self, validate: bool) -> Self
设置是否验证 scope
Sourcepub fn with_allowed_scopes(self, scopes: HashSet<String>) -> Self
pub fn with_allowed_scopes(self, scopes: HashSet<String>) -> Self
设置允许的 scope
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
设置请求超时
Trait Implementations§
Source§impl Clone for OAuth2ClientConfig
impl Clone for OAuth2ClientConfig
Source§fn clone(&self) -> OAuth2ClientConfig
fn clone(&self) -> OAuth2ClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OAuth2ClientConfig
impl RefUnwindSafe for OAuth2ClientConfig
impl Send for OAuth2ClientConfig
impl Sync for OAuth2ClientConfig
impl Unpin for OAuth2ClientConfig
impl UnsafeUnpin for OAuth2ClientConfig
impl UnwindSafe for OAuth2ClientConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more