Struct wicrs_server::auth::Auth [−][src]
pub struct Auth { /* fields omitted */ }
Authentication handler.
Implementations
impl Auth
[src]
pub fn from_config(config: &AuthConfigs) -> Self
[src]
Sets up an authentication manager based on a configuration object and preloads previous authenticated token sessions from disk.
pub async fn for_testing(count: u8) -> (Self, ID, String)
[src]
Creates an authentication manager with hardcoded user data for testing purposes only.
pub async fn is_authenticated(
manager: Arc<RwLock<Self>>,
id: ID,
token_str: String
) -> bool
[src]
manager: Arc<RwLock<Self>>,
id: ID,
token_str: String
) -> bool
Checks if a given token and user ID match and are authenticated.
pub async fn invalidate_all_tokens(manager: Arc<RwLock<Self>>, id: ID)
[src]
Invalidates any tokens that are for the given user ID.
pub async fn invalidate_token(manager: Arc<RwLock<Self>>, id: ID, token: String)
[src]
Invalidates the given token for the given user ID.
pub async fn start_login(manager: Arc<RwLock<Self>>, service: Service) -> String
[src]
Start the OAuth login process. Returns a redirect to the given OAuth service’s page with the correct parameters.
pub async fn handle_oauth(
manager: Arc<RwLock<Self>>,
service: Service,
query: AuthQuery
) -> Result<IDToken>
[src]
manager: Arc<RwLock<Self>>,
service: Service,
query: AuthQuery
) -> Result<IDToken>
Handles the OAuth follow-up request. Possible errors ase usually caused by external services failing or behaving in unexpected ways.
Auto Trait Implementations
impl !RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl !UnwindSafe for Auth
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
type Err = Infallible
pub fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,