pub trait AuthenticationManager: Send + Sync {
// Required methods
fn authenticate_rest_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 AuthenticationContext,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn authenticate_websocket<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_authentication_valid(&self) -> bool;
fn time_until_expiration(&self) -> Option<Duration>;
fn exchange_name(&self) -> &str;
fn api_key(&self) -> &str;
// Provided methods
fn authenticate_websocket_trading<'life0, 'async_trait>(
&'life0 self,
timestamp: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn refresh_authentication<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn supports_websocket_trading(&self) -> bool { ... }
fn requires_refresh(&self) -> bool { ... }
fn refresh_interval(&self) -> Option<Duration> { ... }
}Expand description
Unified authentication manager trait for all exchanges
Required Methods§
Sourcefn authenticate_rest_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 AuthenticationContext,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn authenticate_rest_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 AuthenticationContext,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate authentication for a REST API request
Sourcefn authenticate_websocket<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn authenticate_websocket<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate authentication for a WebSocket connection
Sourcefn is_authentication_valid(&self) -> bool
fn is_authentication_valid(&self) -> bool
Check if authentication is still valid
Sourcefn time_until_expiration(&self) -> Option<Duration>
fn time_until_expiration(&self) -> Option<Duration>
Get the time until authentication expires (if applicable)
Sourcefn exchange_name(&self) -> &str
fn exchange_name(&self) -> &str
Get the exchange name
Provided Methods§
Sourcefn authenticate_websocket_trading<'life0, 'async_trait>(
&'life0 self,
timestamp: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn authenticate_websocket_trading<'life0, 'async_trait>(
&'life0 self,
timestamp: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<AuthenticationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate WebSocket trading authentication (if supported)
Sourcefn refresh_authentication<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn refresh_authentication<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Refresh authentication if needed (for JWT-based exchanges)
Sourcefn supports_websocket_trading(&self) -> bool
fn supports_websocket_trading(&self) -> bool
Check if this authentication supports WebSocket trading
Sourcefn requires_refresh(&self) -> bool
fn requires_refresh(&self) -> bool
Check if this authentication requires periodic refresh
Sourcefn refresh_interval(&self) -> Option<Duration>
fn refresh_interval(&self) -> Option<Duration>
Get refresh interval (if applicable)