Struct wasm_service_oauth::OAuthHandler[][src]

pub struct OAuthHandler { /* fields omitted */ }

Instance data for OAuthHandler

Implementations

impl OAuthHandler[src]

pub fn init(config: OAuthConfig) -> Result<Self, Error>[src]

Validate parameters and initialize oauth handler

pub fn add_cors_headers(
    &self,
    req: &Request,
    ctx: &mut Context
) -> Result<(), Error>
[src]

Append CORS headers to response

pub fn map_cors_origin(&self, origin: Option<String>) -> &str[src]

If requested origin is in list, return it (allow it); otherwise, return first origin in allowed list For credentialed request, return value should never be wildcard "*"

pub fn re_authorize(
    &self,
    ctx: &mut Context,
    redirect_url: &str
) -> HandlerReturn
[src]

Send user back through the oauth workflow. This may occur if user tries to hit url that requires authentication, and session cookie is either missing or expired. redirect_url should be the app url to returning to after auth has completed.

pub fn verify_auth_user(
    &self,
    req: &Request,
    ctx: &mut Context
) -> Result<Session, HandlerReturn>
[src]

Verify that user is authenticated and authorized. Call this at the front of every handler that requires authN+authZ. Any failure results in 400

pub fn would_handle(&self, req: &Request) -> bool[src]

Returns true if this handler would process the url, i.e., if the request url matches one of the configured url prefixes.

Trait Implementations

impl Handler for OAuthHandler[src]

fn handle<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    req: &'life1 Request,
    ctx: &'life2 mut Context
) -> Pin<Box<dyn Future<Output = Result<(), HandlerReturn>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Process incoming Request

Auto Trait Implementations

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> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

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>,