pub struct IndieAuthClient { /* private fields */ }Expand description
IndieAuth client for building authorization flows.
Implementations§
Source§impl IndieAuthClient
impl IndieAuthClient
Sourcepub fn new(config: IndieAuthConfig) -> Result<Self>
pub fn new(config: IndieAuthConfig) -> Result<Self>
Create a new IndieAuth client.
Sourcepub fn generate_code_verifier() -> Result<String>
pub fn generate_code_verifier() -> Result<String>
Generate a PKCE code verifier (43–128 character random string).
Sourcepub fn compute_code_challenge(verifier: &str) -> String
pub fn compute_code_challenge(verifier: &str) -> String
Compute the S256 code challenge from a code verifier.
Build an authorization request URL.
Sourcepub fn verify_callback(
&self,
callback: &IndieAuthCallback,
expected_state: &str,
) -> Result<()>
pub fn verify_callback( &self, callback: &IndieAuthCallback, expected_state: &str, ) -> Result<()>
Verify a callback matches the original request state.
Sourcepub fn verify_pkce(code_verifier: &str, code_challenge: &str) -> Result<()>
pub fn verify_pkce(code_verifier: &str, code_challenge: &str) -> Result<()>
Verify a PKCE code challenge against the stored verifier.
Sourcepub fn validate_profile_url(url: &str) -> Result<()>
pub fn validate_profile_url(url: &str) -> Result<()>
Validate that a profile URL is canonical per IndieAuth rules.
- Must have scheme
https://orhttp:// - Must not contain a fragment
- Must not contain a username/password
- Path must end with
/
Auto Trait Implementations§
impl Freeze for IndieAuthClient
impl RefUnwindSafe for IndieAuthClient
impl Send for IndieAuthClient
impl Sync for IndieAuthClient
impl Unpin for IndieAuthClient
impl UnsafeUnpin for IndieAuthClient
impl UnwindSafe for IndieAuthClient
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