Liking cljdoc? Tell your friends :D

stroopwafel.pdp.replay

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.
raw docstring

checkclj

(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.
raw docstring

check-freshnessclj

(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.
raw docstring

check-replayclj

(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.
raw docstring

create-replay-guardclj

(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>}.
raw docstring

evict-expired!clj

(evict-expired! {:keys [cache freshness-ms]})

Remove cache entries older than the freshness window.

Remove cache entries older than the freshness window.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close