Trait Authenticate

Source
pub trait Authenticate {
    // Required methods
    fn describe(&self) -> Result<AuthenticatorInfo>;
    fn authenticate(
        &self,
        auth: &RequestAuth,
        meta: Option<ConnectionMetadata>,
    ) -> Result<Application>;
}
Expand description

Authentication interface

Interface that must be implemented for each authentication type available for the service.

Required Methods§

Source

fn describe(&self) -> Result<AuthenticatorInfo>

Return a description of the authenticator.

The descriptions are gathered in the Core Provider and returned for a ListAuthenticators operation.

Source

fn authenticate( &self, auth: &RequestAuth, meta: Option<ConnectionMetadata>, ) -> Result<Application>

Authenticates a RequestAuth payload and returns the Application if successful. A optional ConnectionMetadata object is passed in too, since it is sometimes possible to perform authentication based on the connection’s metadata (i.e. as is the case for UNIX domain sockets with Unix peer credentials).

§Errors

If the authentification fails, returns a ResponseStatus::AuthenticationError.

Implementors§