pub struct OAuthState { /* private fields */ }Expand description
Shared runtime state for the OAuth surface. Cheaply cloneable.
Implementations§
Source§impl OAuthState
impl OAuthState
Sourcepub fn with_tokens_path(
config: OAuthConfig,
tokens_path: PathBuf,
) -> Result<Self>
pub fn with_tokens_path( config: OAuthConfig, tokens_path: PathBuf, ) -> Result<Self>
Construct an OAuthState backed by a TokenStore at tokens_path.
Use OAuthState::with_tokens_path to supply the path explicitly,
or OAuthState::from_default_path to derive it from the standard
ProjectDirs location (test code uses the former, production uses the latter).
Sourcepub fn from_default_path(config: OAuthConfig) -> Result<Self>
pub fn from_default_path(config: OAuthConfig) -> Result<Self>
Standard production constructor: derive the tokens path from the
same ProjectDirs base used by oauth.toml.
pub fn issuer(&self) -> &str
Sourcepub fn resource_metadata_url(&self) -> String
pub fn resource_metadata_url(&self) -> String
URL the WWW-Authenticate challenge points clients at for resource metadata. Defined by RFC 9728 §5.1.
Sourcepub async fn validate_token(&self, token: &str) -> bool
pub async fn validate_token(&self, token: &str) -> bool
Returns true iff the token was previously issued and is not expired.
Trait Implementations§
Source§impl Clone for OAuthState
impl Clone for OAuthState
Source§fn clone(&self) -> OAuthState
fn clone(&self) -> OAuthState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OAuthState
impl !RefUnwindSafe for OAuthState
impl Send for OAuthState
impl Sync for OAuthState
impl Unpin for OAuthState
impl UnsafeUnpin for OAuthState
impl !UnwindSafe for OAuthState
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