pub trait AuthenticationProvider: Send + Sync {
type Context: AuthenticationContext;
// Required methods
async fn initialize(
&mut self,
config: AuthConfig,
metadata_service: Option<Arc<dyn Any + Send + Sync>>,
) -> AuthServiceResult<()>;
async fn authenticate(
&self,
context: &Self::Context,
) -> AuthServiceResult<()>;
fn new_context_from_metadata(
&self,
metadata: &HashMap<String, String>,
request: Box<dyn Any + Send>,
) -> Self::Context;
fn new_context_from_command(
&self,
command: &RemotingCommand,
) -> Self::Context;
}Expand description
Authentication provider trait.
Required Associated Types§
Sourcetype Context: AuthenticationContext
type Context: AuthenticationContext
Associated authentication context type.
Required Methods§
Sourceasync fn initialize(
&mut self,
config: AuthConfig,
metadata_service: Option<Arc<dyn Any + Send + Sync>>,
) -> AuthServiceResult<()>
async fn initialize( &mut self, config: AuthConfig, metadata_service: Option<Arc<dyn Any + Send + Sync>>, ) -> AuthServiceResult<()>
Initialize the provider.
Sourceasync fn authenticate(&self, context: &Self::Context) -> AuthServiceResult<()>
async fn authenticate(&self, context: &Self::Context) -> AuthServiceResult<()>
Authenticate a request.
Sourcefn new_context_from_metadata(
&self,
metadata: &HashMap<String, String>,
request: Box<dyn Any + Send>,
) -> Self::Context
fn new_context_from_metadata( &self, metadata: &HashMap<String, String>, request: Box<dyn Any + Send>, ) -> Self::Context
Create context from gRPC metadata.
Sourcefn new_context_from_command(&self, command: &RemotingCommand) -> Self::Context
fn new_context_from_command(&self, command: &RemotingCommand) -> Self::Context
Create context from remoting command.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".