Trait oxide_auth::code_grant::backend::GuardRequest [] [src]

pub trait GuardRequest {
    fn valid(&self) -> bool;
fn token(&self) -> Option<Cow<str>>; }

Required request methods for deciding on the rights to access a protected resource.

Required Methods

Received request might not be encoded correctly. This method gives implementors the chance to signal that a request was received but its encoding was generally malformed. If this is the case, then no other attribute will be queried. This method exists mainly to make frontends straightforward by not having them handle special cases for malformed requests.

The authorization used in the request.

Expects the complete Authorization HTTP-header, including the qualification as Bearer. In case the client included multiple forms of authorization, this method MUST return None and the request SHOULD be marked as invalid.

Implementors