pub struct AuthBuilder<'a> { /* private fields */ }Expand description
Entry point for building auth configurations on an APIClient.
Returned by APIClient::auth().
Implementations§
Source§impl<'a> AuthBuilder<'a>
impl<'a> AuthBuilder<'a>
Sourcepub fn session(
self,
user: &impl ForceLoginUser,
backend: Arc<dyn AsyncSessionBackend>,
) -> SessionAuthBuilder<'a>
pub fn session( self, user: &impl ForceLoginUser, backend: Arc<dyn AsyncSessionBackend>, ) -> SessionAuthBuilder<'a>
Configure session-based authentication.
Creates a real session in the AsyncSessionBackend and sets the
sessionid cookie on the client. The session will be validated by
CookieSessionAuthMiddleware on subsequent requests.
Sourcepub fn jwt(
self,
user: &impl ForceLoginUser,
config: JwtTestConfig,
) -> JwtAuthBuilder<'a>
pub fn jwt( self, user: &impl ForceLoginUser, config: JwtTestConfig, ) -> JwtAuthBuilder<'a>
Configure JWT Bearer token authentication.
Auto Trait Implementations§
impl<'a> Freeze for AuthBuilder<'a>
impl<'a> !RefUnwindSafe for AuthBuilder<'a>
impl<'a> Send for AuthBuilder<'a>
impl<'a> Sync for AuthBuilder<'a>
impl<'a> Unpin for AuthBuilder<'a>
impl<'a> UnsafeUnpin for AuthBuilder<'a>
impl<'a> !UnwindSafe for AuthBuilder<'a>
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
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