Class WebhookReplayNonceStorage
- Namespace
- FlowOrchestrator.Core.Storage
- Assembly
- FlowOrchestrator.Core.dll
The one bound every built-in IWebhookReplayStore applies to a replay nonce before it is stored or looked up, so SQL Server, PostgreSQL and the in-memory store register the same key.
public static class WebhookReplayNonceStorage
- Inheritance
-
WebhookReplayNonceStorage
- Inherited Members
Remarks
On the unsigned path the nonce is the raw value of a caller-chosen header (e.g. X-Delivery-Id) and
nothing upstream caps its length, while the SQL Server / PostgreSQL nonce columns hold
MaxStoredLength characters. A nonce that would not fit is stored as DigestPrefix +
the lower-case hex SHA-256 of its UTF-8 bytes (71 characters): the same long nonce still maps to the same
row, so it keeps its replay protection, and no schema change is needed. Nonces of
MaxStoredLength characters or fewer are stored exactly as before (no trimming, no case
folding — a nonce is an opaque token). ReplayProtectionGate applies it before calling the store,
so custom stores receive bounded nonces; the built-in stores apply it again for direct callers.
Fields
DigestPrefix
Prefix marking a stored nonce as the digest of a longer one.
public const string DigestPrefix = "sha256:"
Field Value
MaxStoredLength
Length of the nonce columns of the built-in SQL Server and PostgreSQL schemas.
public const int MaxStoredLength = 256
Field Value
Methods
ToStorageForm(string)
Returns nonce unchanged when it fits MaxStoredLength, and its digest
form otherwise.
public static string ToStorageForm(string nonce)
Parameters
noncestringThe nonce the replay gate derived for a delivery.
Returns
- string
A string of at most MaxStoredLength characters; idempotent.
Exceptions
- ArgumentNullException
nonceis null.