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::seconds(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::minutes(30)
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))