[][src]Trait rocket_simple_authorization::SimpleAuthorization

pub trait SimpleAuthorization<'a, 'r, E = &'a str> {
    fn has_authority(
        request: &'a Request<'r>,
        key: Option<&'a str>
    ) -> Option<Option<E>>;
fn create_auth(key: Option<E>) -> Self; }

The trait for an authorizer.

Required methods

fn has_authority(
    request: &'a Request<'r>,
    key: Option<&'a str>
) -> Option<Option<E>>

Check whether the key is valid or not. And a generic type can also be returned to help create an auth instance.

fn create_auth(key: Option<E>) -> Self

Create an auth instance.

Loading content...

Implementors

Loading content...