pub struct CatGenerateOptions {
pub validation_type: CatValidationType,
pub alg: String,
pub kid: String,
pub generate_cwt_id: bool,
}Expand description
Options for generating a CAT token.
This struct contains parameters that control how a token is generated, including which cryptographic algorithm and key to use.
§Examples
use common_access_token::{CatGenerateOptions, CatValidationType};
// Basic token generation options
let options = CatGenerateOptions {
validation_type: CatValidationType::Mac,
alg: "HS256".to_string(),
kid: "key-1".to_string(),
generate_cwt_id: true,
};
// Using the default options
let default_options = CatGenerateOptions::default();Fields§
§validation_type: CatValidationTypeType of validation mechanism to use for the token.
Currently, only CatValidationType::Mac is fully implemented.
alg: StringAlgorithm to use for token generation.
For CatValidationType::Mac, this should be “HS256”.
kid: StringKey ID to use for token generation. This must match a key ID in the
keys map provided to the Cat instance.
generate_cwt_id: boolWhether to generate a CWT ID for the token. A CWT ID is a unique identifier for the token that can be used for tracking or revocation purposes.
Trait Implementations§
Source§impl Clone for CatGenerateOptions
impl Clone for CatGenerateOptions
Source§fn clone(&self) -> CatGenerateOptions
fn clone(&self) -> CatGenerateOptions
Returns a copy 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 moreSource§impl Debug for CatGenerateOptions
impl Debug for CatGenerateOptions
Source§impl Default for CatGenerateOptions
impl Default for CatGenerateOptions
Auto Trait Implementations§
impl Freeze for CatGenerateOptions
impl RefUnwindSafe for CatGenerateOptions
impl Send for CatGenerateOptions
impl Sync for CatGenerateOptions
impl Unpin for CatGenerateOptions
impl UnwindSafe for CatGenerateOptions
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