Skip to main content

CommandTokenVerifier

Trait CommandTokenVerifier 

Source
pub trait CommandTokenVerifier: Send + Sync {
    // Required methods
    fn verify_command_token(
        &self,
        token: &str,
        command_name: &str,
    ) -> Result<(), CommandTokenError>;
    fn verify_query_token(
        &self,
        token: &str,
        query_name: &str,
    ) -> Result<(), CommandTokenError>;

    // Provided methods
    fn verify_command_token_with_request(
        &self,
        token: &str,
        command_name: &str,
        _details: Option<&RequestValidationDetails>,
    ) -> Result<(), CommandTokenError> { ... }
    fn verify_query_token_with_request(
        &self,
        token: &str,
        query_name: &str,
        _details: Option<&RequestValidationDetails>,
    ) -> Result<(), CommandTokenError> { ... }
    fn verify_command_token_with_borrowed_request(
        &self,
        token: &str,
        command_name: &str,
        details: Option<&RequestValidationDetailsRef<'_>>,
    ) -> Result<(), CommandTokenError> { ... }
    fn verify_query_token_with_borrowed_request(
        &self,
        token: &str,
        query_name: &str,
        details: Option<&RequestValidationDetailsRef<'_>>,
    ) -> Result<(), CommandTokenError> { ... }
}
Expand description

Verifies command- and query-scoped bearer tokens.

Required Methods§

Source

fn verify_command_token( &self, token: &str, command_name: &str, ) -> Result<(), CommandTokenError>

Verifies a token for a command name.

Source

fn verify_query_token( &self, token: &str, query_name: &str, ) -> Result<(), CommandTokenError>

Verifies a token for a query name.

Provided Methods§

Source

fn verify_command_token_with_request( &self, token: &str, command_name: &str, _details: Option<&RequestValidationDetails>, ) -> Result<(), CommandTokenError>

Verifies a command token with optional request-bound validation details.

Source

fn verify_query_token_with_request( &self, token: &str, query_name: &str, _details: Option<&RequestValidationDetails>, ) -> Result<(), CommandTokenError>

Verifies a query token with optional request-bound validation details.

Source

fn verify_command_token_with_borrowed_request( &self, token: &str, command_name: &str, details: Option<&RequestValidationDetailsRef<'_>>, ) -> Result<(), CommandTokenError>

Verifies a command token without requiring an owned payload copy.

The default materializes the owned details and invokes Self::verify_command_token_with_request so existing implementations retain their request-aware behavior.

Source

fn verify_query_token_with_borrowed_request( &self, token: &str, query_name: &str, details: Option<&RequestValidationDetailsRef<'_>>, ) -> Result<(), CommandTokenError>

Verifies a query token without requiring an owned payload copy.

The default materializes the owned details and invokes Self::verify_query_token_with_request so existing implementations retain their request-aware behavior.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§