Function get_auth_checker

Source
pub fn get_auth_checker(
    config: &'static Config,
) -> impl Fn(Request<()>) -> Result<Request<()>, Status> + Clone
Expand description

Get a function that checks authentication/authorization of an incoming grpc API call.

The incoming request is checked for the auth metadata value, which should be a shared secret string value, that is simply compared to the one configured. It is critical that this value is kept secret and never exposed publicly!

ยงErrors

Returns the UNAUTHENTICATED status code if the token is not provided or is invalid.