pub struct IndieAuthServer { /* private fields */ }Expand description
IndieAuth server handling code issuance and token exchange.
Implementations§
Source§impl IndieAuthServer
impl IndieAuthServer
Sourcepub fn new(issuer: &str, code_lifetime: u64, token_lifetime: u64) -> Self
pub fn new(issuer: &str, code_lifetime: u64, token_lifetime: u64) -> Self
Create a new IndieAuth server with the given issuer URL.
Sourcepub fn metadata(&self) -> IndieAuthMetadata
pub fn metadata(&self) -> IndieAuthMetadata
Get server metadata.
Sourcepub async fn issue_code(
&self,
client_id: &str,
redirect_uri: &str,
me: &str,
scope: Option<&str>,
code_challenge: &str,
code_challenge_method: &str,
) -> Result<String>
pub async fn issue_code( &self, client_id: &str, redirect_uri: &str, me: &str, scope: Option<&str>, code_challenge: &str, code_challenge_method: &str, ) -> Result<String>
Issue an authorization code after user consent.
Sourcepub async fn exchange_code(
&self,
code: &str,
client_id: &str,
redirect_uri: &str,
code_verifier: &str,
) -> Result<IndieAuthTokenResponse>
pub async fn exchange_code( &self, code: &str, client_id: &str, redirect_uri: &str, code_verifier: &str, ) -> Result<IndieAuthTokenResponse>
Exchange an authorization code for a token response.
This is the server-side token exchange endpoint handler.
Sourcepub async fn introspect_token(
&self,
token: &str,
) -> Option<(String, Option<String>, bool)>
pub async fn introspect_token( &self, token: &str, ) -> Option<(String, Option<String>, bool)>
Introspect an access token.
Sourcepub async fn revoke_token(&self, token: &str) -> bool
pub async fn revoke_token(&self, token: &str) -> bool
Revoke an access token.
Auto Trait Implementations§
impl Freeze for IndieAuthServer
impl !RefUnwindSafe for IndieAuthServer
impl Send for IndieAuthServer
impl Sync for IndieAuthServer
impl Unpin for IndieAuthServer
impl UnsafeUnpin for IndieAuthServer
impl !UnwindSafe for IndieAuthServer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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 more