Skip to main content

TokenVerifier

Trait TokenVerifier 

Source
pub trait TokenVerifier<P: PeerId>:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn verify(&self, token: &str, request: &PeerRequest<P>) -> Decision;
}
Expand description

A check of the token a peer presents, which returns what the token authorizes.

A verifier is synchronous, since checking a signature is CPU work. Wrap it in Verify to use it as a Policy.

Required Methods§

Source

fn verify(&self, token: &str, request: &PeerRequest<P>) -> Decision

Verifies token for the request’s peer and returns what it authorizes.

The token is an argument of its own, so a token that does not come from the session’s setup can go through the same verifier.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§