pub trait WebhookReplayGuard: Send + Sync {
// Required method
fn first_seen<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
keep_until: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<bool, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Available on crate feature
webhooks only.Expand description
Remembers accepted webhook-ids so a replay inside the timestamp tolerance is refused.
A replay outside the tolerance already fails WebhookVerifier::verify, so an id
needs to be kept for twice the tolerance only. Use a shared backend when several
replicas receive the same endpoint’s deliveries.
Required Methods§
Sourcefn first_seen<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
keep_until: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<bool, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn first_seen<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
keep_until: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<bool, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Records id until keep_until and returns true when it was not already recorded.
§Errors
Returns an error when the backing store cannot be reached; callers refuse the delivery so the sender retries.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".