pub struct AuthConfigBuilder { /* private fields */ }Expand description
Builder for AuthConfig.
Implementations§
Source§impl AuthConfigBuilder
impl AuthConfigBuilder
Sourcepub fn jwt_secret(self, secret: impl Into<String>) -> Self
pub fn jwt_secret(self, secret: impl Into<String>) -> Self
Set the JWT secret.
Sourcepub const fn token_expiry_hours(self, hours: u64) -> Self
pub const fn token_expiry_hours(self, hours: u64) -> Self
Set token expiry in hours.
Sourcepub const fn refresh_expiry_days(self, days: u64) -> Self
pub const fn refresh_expiry_days(self, days: u64) -> Self
Set refresh token expiry in days.
Sourcepub const fn require_auth_for_rpc(self, required: bool) -> Self
pub const fn require_auth_for_rpc(self, required: bool) -> Self
Set whether RPC requires auth.
Sourcepub const fn require_auth_for_ws(self, required: bool) -> Self
pub const fn require_auth_for_ws(self, required: bool) -> Self
Set whether WebSocket requires auth.
Sourcepub fn public_method(self, method: impl Into<String>) -> Self
pub fn public_method(self, method: impl Into<String>) -> Self
Add a public method (doesn’t require auth).
Sourcepub fn build(self) -> AuthConfig
pub fn build(self) -> AuthConfig
Build the config.
Trait Implementations§
Source§impl Debug for AuthConfigBuilder
impl Debug for AuthConfigBuilder
Source§impl Default for AuthConfigBuilder
impl Default for AuthConfigBuilder
Source§fn default() -> AuthConfigBuilder
fn default() -> AuthConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthConfigBuilder
impl RefUnwindSafe for AuthConfigBuilder
impl Send for AuthConfigBuilder
impl Sync for AuthConfigBuilder
impl Unpin for AuthConfigBuilder
impl UnwindSafe for AuthConfigBuilder
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