Skip to main content

AuthHandler

Trait AuthHandler 

Source
pub trait AuthHandler {
    // Required method
    fn respond(
        &self,
        target: AuthTarget,
        url: &Url,
        challenges: &[Challenge],
        request: &Request,
        response: &Response,
    ) -> Result<AuthDecision, NanoGetError>;
}
Expand description

Callback interface for custom authentication schemes.

Required Methods§

Source

fn respond( &self, target: AuthTarget, url: &Url, challenges: &[Challenge], request: &Request, response: &Response, ) -> Result<AuthDecision, NanoGetError>

Chooses how to respond to a challenge set.

Return AuthDecision::UseHeaders to retry with credentials, AuthDecision::NoMatch to leave the response unchanged, or AuthDecision::Abort to stop with an error.

Implementors§