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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> Fruit for T where
    T: Send + Downcast, 
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

type Err = Infallible

impl<T> Pointable for T

type Init = T

The type for initializers.

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,