pub trait AuthorizationSecrets {
// Required methods
fn new_state(&self) -> Result<State, SecretError>;
fn new_code_verifier(&self) -> Result<CodeVerifier, SecretError>;
}Expand description
A source of the unguessable values an authorization request is built from.
Narrow, and owned by this use case because this use case is what consumes it. An adapter implements it; the crate ships none by default, because the right source depends on where the client runs and a wrong default is a predictable token rather than a compile error.
Both methods are fallible: the usual implementation draws from the OS entropy source, which is a runtime facility that can fail, and a client that quietly falls back to something guessable is the failure mode this avoids.
Required Methods§
Sourcefn new_state(&self) -> Result<State, SecretError>
fn new_state(&self) -> Result<State, SecretError>
A fresh state for one authorization request.
§Errors
Whatever the underlying source raises when it cannot produce one.
Sourcefn new_code_verifier(&self) -> Result<CodeVerifier, SecretError>
fn new_code_verifier(&self) -> Result<CodeVerifier, SecretError>
A fresh PKCE code_verifier for one authorization request.
§Errors
Whatever the underlying source raises when it cannot produce one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".