[][src]Trait parsec_service::authenticators::Authenticate

pub trait Authenticate {
    fn describe(&self) -> Result<AuthenticatorInfo>;
fn authenticate(
        &self,
        auth: &RequestAuth,
        meta: Option<ConnectionMetadata>
    ) -> Result<ApplicationName>; }

Authentication interface

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

Required methods

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.

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

Authenticates a RequestAuth payload and returns the ApplicationName 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.

Loading content...

Implementors

impl Authenticate for DirectAuthenticator[src]

impl Authenticate for UnixPeerCredentialsAuthenticator[src]

Loading content...