pub struct SecureStringGenerator { /* private fields */ }Expand description
Secure string generator for OAuth tokens, client IDs, and secrets
Implementations§
Source§impl SecureStringGenerator
impl SecureStringGenerator
Sourcepub fn generate_random_string(&self, length: usize) -> Result<String>
pub fn generate_random_string(&self, length: usize) -> Result<String>
Generate a cryptographically secure random string of the specified length Uses the same character set as the TypeScript implementation
Sourcepub fn generate_client_id(&self) -> Result<String>
pub fn generate_client_id(&self) -> Result<String>
Generate a client ID (16 characters)
Sourcepub fn generate_client_secret(&self) -> Result<String>
pub fn generate_client_secret(&self) -> Result<String>
Generate a client secret (32 characters)
Sourcepub fn generate_access_token_secret(&self) -> Result<String>
pub fn generate_access_token_secret(&self) -> Result<String>
Generate an access token secret (32 characters)
Sourcepub fn generate_refresh_token_secret(&self) -> Result<String>
pub fn generate_refresh_token_secret(&self) -> Result<String>
Generate a refresh token secret (32 characters)
Sourcepub fn generate_auth_code_secret(&self) -> Result<String>
pub fn generate_auth_code_secret(&self) -> Result<String>
Generate an authorization code secret (32 characters)
Sourcepub fn generate_grant_id(&self) -> Result<String>
pub fn generate_grant_id(&self) -> Result<String>
Generate a grant ID (16 characters)
Sourcepub fn generate_pkce_code_verifier(&self) -> Result<String>
pub fn generate_pkce_code_verifier(&self) -> Result<String>
Generate a PKCE code verifier (43-128 characters as per RFC 7636) Default to 43 characters for compatibility
Sourcepub fn generate_state_parameter(&self) -> Result<String>
pub fn generate_state_parameter(&self) -> Result<String>
Generate a state parameter for OAuth flow (recommended 32 characters)
Sourcepub fn generate_nonce(&self) -> Result<String>
pub fn generate_nonce(&self) -> Result<String>
Generate a nonce for OpenID Connect (recommended 32 characters)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecureStringGenerator
impl RefUnwindSafe for SecureStringGenerator
impl Send for SecureStringGenerator
impl Sync for SecureStringGenerator
impl Unpin for SecureStringGenerator
impl UnsafeUnpin for SecureStringGenerator
impl UnwindSafe for SecureStringGenerator
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.