pub trait Authenticator: Send + Sync {
// Required method
fn authenticate(&self, bearer: &str) -> Result<Principal, AuthError>;
}Expand description
Turns a presented bearer token into a Principal, or rejects it.
Implementations must deny by default: an empty or unrecognised bearer is an error, never an anonymous pass. A transport calls this before it routes to a handler, so an unauthenticated request never reaches business logic with a forged identity.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".