pub trait SigningStrategy: Send + Sync {
// Required methods
fn prepare_request<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut SigningContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_auth_headers(&self, headers: &mut HeaderMap, ctx: &SigningContext);
}Expand description
Trait for exchange-specific request signing strategies.
Implementors define how to:
- Generate timestamps in exchange-specific format
- Compute request signatures
- Add authentication headers
Required Methods§
Sourcefn prepare_request<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut SigningContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare_request<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut SigningContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Prepare the request for signing.
This method should:
- Generate timestamp in exchange-specific format
- Compute signature based on method, path, params, body
- Update ctx.timestamp and ctx.signature
- Optionally modify ctx.params (e.g., add timestamp param)
Sourcefn add_auth_headers(&self, headers: &mut HeaderMap, ctx: &SigningContext)
fn add_auth_headers(&self, headers: &mut HeaderMap, ctx: &SigningContext)
Add authentication headers to the request.
Called after prepare_request(). Should add all required authentication headers (API key, signature, timestamp, etc.)