1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use async_trait::async_trait;
use fluvio_future::net::TcpStream;
use crate::tls::DefaultServerTlsStream;
#[async_trait]
pub trait Authenticator: Send + Sync {
async fn authenticate(
&self,
incoming_tls_stream: &DefaultServerTlsStream,
target_tcp_stream: &TcpStream,
) -> Result<bool, std::io::Error>;
}
pub(crate) struct NullAuthenticator;
#[async_trait]
impl Authenticator for NullAuthenticator {
async fn authenticate(
&self,
_: &DefaultServerTlsStream,
_: &TcpStream,
) -> Result<bool, std::io::Error> {
Ok(true)
}
}