Storage backend. Use memoryBackend() for tests, pgBackend(pool) for production.
OptionalttlReplay window in seconds. MUST be between 3600 (1h) and 604800 (7d)
per spec. Out-of-range values throw at construction — silent clamping
would hide operator misconfiguration (e.g., 60 meaning "one minute"
becoming 3600 and getting declared to buyers as a 1h replay window).
Defaults to 86400 (24h).
OptionalclockClock-skew tolerance in seconds. A key is treated as still valid for this many seconds past its actual expiry, to avoid spurious IDEMPOTENCY_EXPIRED rejections when the buyer's clock drifts forward. Defaults to 60 (1 minute).
Configuration for
createIdempotencyStore.Cached responses at rest — handler responsibility. The store caches whatever the handler returned as the response payload, then
JSON.stringify-s it into the configured backend for the declaredttlSeconds(default 24h, max 7d). The hash-exclusion list stripsidempotency_key,governance_context, andpush_notification_config.authentication.credentialsfrom the hash so a rotated credential on retry doesn't false-conflict, but the stored response is the handler's verbatim output.If a handler returns a response that includes:
push_notification_config.authentication.credentials(a buyer- supplied write-only secret — the contract is that sellers MUST NOT echo it back; receipt correlation usespush_notification_config.tokeninstead),those secrets sit at rest in the backend for
ttlSeconds. On Redis without TLS, they're also plaintext over the wire. The framework does not scrub responses before caching — the AdCP spec doesn't require it of either party, and a built-in scrubber would change the wire shape of legitimate adopter responses without warning.Practical guidance:
push_notification_config.credentialsin particular is write-only —tokenis the field a seller uses to confirm receipt.IdempotencyBackendthat transforms entries on the write path.See also
docs/guides/CTX-METADATA-SAFETY.mdfor related guidance on what NOT to put inctx_metadata(which has its own caching surface with the same at-rest concern).