Coffrify.Runtime.WebhookReplay behaviour (Coffrify v0.9.0)

View Source

Replay-protection store for webhook deliveries — prevents double-processing when a sender retries a delivery.

Use one of:

The behaviour exposes a single seen?/3 that returns true if the id was already recorded, false otherwise (and atomically records it).

Summary

Callbacks

Has this event id been seen before? Returns true to deduplicate.

Callbacks

seen?(any, id, ttl_ms)

@callback seen?(any(), id :: String.t(), ttl_ms :: pos_integer()) :: boolean()

Has this event id been seen before? Returns true to deduplicate.

Functions

seen?(state, id, ttl)

@spec seen?(any(), String.t(), pos_integer()) :: boolean()

Dispatch helper used by Coffrify.Phoenix.WebhookController.