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