pub struct TokenSignerBuilder<Claims, Algo>where
Algo: Algorithm,{ /* private fields */ }
Expand description
Builder for TokenSigner
.
Implementations§
Source§impl<Claims, Algo> TokenSignerBuilder<Claims, Algo>where
Algo: Algorithm,
impl<Claims, Algo> TokenSignerBuilder<Claims, Algo>where
Algo: Algorithm,
Sourcepub fn access_token_name<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn access_token_name<VALUE: Into<String>>(self, value: VALUE) -> Self
The name of the future access tokens.
For example, the name of the cookie generated in TokenSigner::create_access_cookie
.
Defaults to "access_token"
Sourcepub fn access_token_lifetime(self, value: Duration) -> Self
pub fn access_token_lifetime(self, value: Duration) -> Self
The lifetime duration of the access token.
Defaults to Duration::from_secs(60)
Sourcepub fn refresh_token_name<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn refresh_token_name<VALUE: Into<String>>(self, value: VALUE) -> Self
The name of the future refresh tokens.
For example, the name of the cookie generated in TokenSigner::create_refresh_cookie
.
Defaults to "refresh_token"
Sourcepub fn refresh_token_lifetime(self, value: Duration) -> Self
pub fn refresh_token_lifetime(self, value: Duration) -> Self
The lifetime duration of the refresh token.
Defaults to Duration::from_secs(30 * 60)
Sourcepub fn header(self, value: Header) -> Self
pub fn header(self, value: Header) -> Self
JWT Header used in the creation of access and refresh tokens.
Please refer to the structs own documentation for more details.
Defaults to Header::default()
Sourcepub fn algorithm(self, value: Algo) -> Self
pub fn algorithm(self, value: Algo) -> Self
The Cryptographic signing algorithm used in the process of creation of access and refresh tokens.
Please referee to the Supported algorithms
section of the jwt-compact
crate
for a comprehensive list of the supported algorithms.
Sourcepub fn signing_key(self, value: Algo::SigningKey) -> Self
pub fn signing_key(self, value: Algo::SigningKey) -> Self
Key used to sign tokens.
Sourcepub fn time_options(self, value: TimeOptions) -> Self
pub fn time_options(self, value: TimeOptions) -> Self
Used in the creating of the token
, the current time stamp is taken from this.
Please refer to the structs own documentation for more details.
Defaults to TimeOptions::from_leeway(Duration::seconds(0))