boltr 0.1.1

Pure-Rust Bolt v5.x wire protocol library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Authentication validator trait for Bolt servers.

use crate::error::BoltError;
use crate::server::AuthCredentials;

/// Validates authentication credentials during the LOGON phase.
#[async_trait::async_trait]
pub trait AuthValidator: Send + Sync + 'static {
    /// Validate the given credentials.
    /// Return `Ok(())` to accept, or `Err(BoltError)` to reject.
    async fn validate(&self, credentials: &AuthCredentials) -> Result<(), BoltError>;
}