Struct wasm_service_oauth::OAuthHandler [−][src]
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]
&self,
req: &Request,
ctx: &mut Context
) -> Result<(), Error>
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]
&self,
ctx: &mut Context,
redirect_url: &str
) -> HandlerReturn
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]
&self,
req: &Request,
ctx: &mut Context
) -> Result<Session, HandlerReturn>
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]
&'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,
Process incoming Request
Auto Trait Implementations
impl !RefUnwindSafe for OAuthHandler
[src]
impl !Send for OAuthHandler
[src]
impl !Sync for OAuthHandler
[src]
impl Unpin for OAuthHandler
[src]
impl !UnwindSafe for OAuthHandler
[src]
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> From<T> for T
[src]
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> 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> 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>,