Replay protection for signed requests.
Uses UUIDv7 request-ids as both timestamp (freshness) and nonce (replay). Factory pattern: create-replay-guard returns an independent guard instance with its own cache and configurable freshness window.
Replay protection for signed requests. Uses UUIDv7 request-ids as both timestamp (freshness) and nonce (replay). Factory pattern: create-replay-guard returns an independent guard instance with its own cache and configurable freshness window.
(check guard request-id)Combined freshness + replay check. Returns nil if OK, or error string.
Combined freshness + replay check. Returns nil if OK, or error string.
(check-freshness {:keys [freshness-ms]} request-id)Check that the request-id's embedded UUIDv7 timestamp is within the freshness window. Returns nil if OK, or error string.
Check that the request-id's embedded UUIDv7 timestamp is within the freshness window. Returns nil if OK, or error string.
(check-replay {:keys [cache]} request-id)Check that the request-id has not been seen before. Returns nil if OK, or error string.
Check that the request-id has not been seen before. Returns nil if OK, or error string.
(create-replay-guard & {:keys [freshness-ms] :or {freshness-ms 120000}})Create a replay guard with configurable freshness window. Returns {:cache (atom {}) :freshness-ms <ms>}.
Create a replay guard with configurable freshness window.
Returns {:cache (atom {}) :freshness-ms <ms>}.(evict-expired! {:keys [cache freshness-ms]})Remove cache entries older than the freshness window.
Remove cache entries older than the freshness window.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |