pub struct SaTokenConfigBuilder { /* private fields */ }Expand description
配置构建器
Implementations§
Source§impl SaTokenConfigBuilder
impl SaTokenConfigBuilder
pub fn token_name(self, name: impl Into<String>) -> Self
pub fn timeout(self, timeout: i64) -> Self
pub fn active_timeout(self, timeout: i64) -> Self
Sourcepub fn auto_renew(self, enabled: bool) -> Self
pub fn auto_renew(self, enabled: bool) -> Self
设置是否开启自动续签
pub fn is_concurrent(self, concurrent: bool) -> Self
pub fn token_style(self, style: TokenStyle) -> Self
pub fn token_prefix(self, prefix: impl Into<String>) -> Self
pub fn jwt_secret_key(self, key: impl Into<String>) -> Self
Sourcepub fn jwt_algorithm(self, algorithm: impl Into<String>) -> Self
pub fn jwt_algorithm(self, algorithm: impl Into<String>) -> Self
设置 JWT 算法
Sourcepub fn jwt_issuer(self, issuer: impl Into<String>) -> Self
pub fn jwt_issuer(self, issuer: impl Into<String>) -> Self
设置 JWT 签发者
Sourcepub fn jwt_audience(self, audience: impl Into<String>) -> Self
pub fn jwt_audience(self, audience: impl Into<String>) -> Self
设置 JWT 受众
Sourcepub fn enable_nonce(self, enable: bool) -> Self
pub fn enable_nonce(self, enable: bool) -> Self
启用防重放攻击(nonce 机制)
Sourcepub fn nonce_timeout(self, timeout: i64) -> Self
pub fn nonce_timeout(self, timeout: i64) -> Self
设置 Nonce 有效期(秒)
Sourcepub fn enable_refresh_token(self, enable: bool) -> Self
pub fn enable_refresh_token(self, enable: bool) -> Self
启用 Refresh Token
Sourcepub fn refresh_token_timeout(self, timeout: i64) -> Self
pub fn refresh_token_timeout(self, timeout: i64) -> Self
设置 Refresh Token 有效期(秒)
Sourcepub fn build(self) -> SaTokenManager
pub fn build(self) -> SaTokenManager
Sourcepub fn build_config(self) -> SaTokenConfig
pub fn build_config(self) -> SaTokenConfig
仅构建配置(不创建 Manager)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SaTokenConfigBuilder
impl !RefUnwindSafe for SaTokenConfigBuilder
impl Send for SaTokenConfigBuilder
impl Sync for SaTokenConfigBuilder
impl Unpin for SaTokenConfigBuilder
impl !UnwindSafe for SaTokenConfigBuilder
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