From f6f8cfe29676b0e111fdf763d9bac1884a476c58 Mon Sep 17 00:00:00 2001 From: Gary Sassano <10464497+garysassano@users.noreply.github.com> Date: Fri, 20 Sep 2024 03:39:05 +0200 Subject: [PATCH 1/2] fix descriptions in advanced table --- docs/utilities/idempotency.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/utilities/idempotency.md b/docs/utilities/idempotency.md index e14fe864fb..7713c24f41 100644 --- a/docs/utilities/idempotency.md +++ b/docs/utilities/idempotency.md @@ -569,16 +569,16 @@ When using DynamoDB as a persistence layer, you can alter the attribute names by Idempotent decorator can be further configured with **`IdempotencyConfig`** as seen in the previous examples. These are the available options for further configuration -| Parameter | Default | Description | -| ----------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| **eventKeyJmespath** | `''` | JMESPath expression to extract the idempotency key from the event | -| **payloadValidationJmespath** | `''` | JMESPath expression to validate whether certain parameters have changed in the event while the event payload | -| **throwOnNoIdempotencyKey** | `false` | Throw an error if no idempotency key was found in the request | -| **expiresAfterSeconds** | 3600 | The number of seconds to wait before a record is expired | -| **useLocalCache** | `false` | Whether to locally cache idempotency results | -| **localCacheMaxItems** | 256 | Max number of items to store in local cache | -| **hashFunction** | `md5` | Function to use for calculating hashes, as provided by the [crypto](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options){target="_blank"} module in the standard library. | -| **responseHook** | `undefined` | Function to use for processing the stored Idempotent response. This function hook is called when an existing idempotent response is found. See [Manipulating The Idempotent Response](idempotency.md#manipulating-the-idempotent-response) | +| Parameter | Default | Description | +| ----------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **eventKeyJmespath** | `''` | JMESPath expression to extract the idempotency key from the event record using [built-in functions](./jmespath.md#built-in-jmespath-functions){target="_blank"} | +| **payloadValidationJmespath** | `''` | JMESPath expression to validate whether specific parameters have remained the same for a matched idempotency key across multiple requests (e.g., to ensure consistency in critical fields like transaction amounts, or to detect tampered payloads) | +| **throwOnNoIdempotencyKey** | `false` | Throw an error if no idempotency key was found in the request | +| **expiresAfterSeconds** | 3600 | The number of seconds to wait before a record is expired, allowing a new transaction with the same idempotency key | +| **useLocalCache** | `false` | Whether to cache idempotency results in-memory to save on persistence storage latency and costs | +| **localCacheMaxItems** | 256 | Max number of items to store in local cache | +| **hashFunction** | `md5` | Function to use for calculating hashes, as provided by the [crypto](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options){target="_blank"} module in the standard library. | +| **responseHook** | `undefined` | Function to use for processing the stored Idempotent response. This function hook is called when an existing idempotent response is found. See [Manipulating The Idempotent Response](idempotency.md#manipulating-the-idempotent-response) | ### Handling concurrent executions with the same payload From d52a4fc141891a4e57205155de57575e0e048843 Mon Sep 17 00:00:00 2001 From: Gary Sassano <10464497+garysassano@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:48:24 +0200 Subject: [PATCH 2/2] update description --- docs/utilities/idempotency.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/utilities/idempotency.md b/docs/utilities/idempotency.md index 7713c24f41..75a9618f00 100644 --- a/docs/utilities/idempotency.md +++ b/docs/utilities/idempotency.md @@ -569,16 +569,16 @@ When using DynamoDB as a persistence layer, you can alter the attribute names by Idempotent decorator can be further configured with **`IdempotencyConfig`** as seen in the previous examples. These are the available options for further configuration -| Parameter | Default | Description | -| ----------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **eventKeyJmespath** | `''` | JMESPath expression to extract the idempotency key from the event record using [built-in functions](./jmespath.md#built-in-jmespath-functions){target="_blank"} | -| **payloadValidationJmespath** | `''` | JMESPath expression to validate whether specific parameters have remained the same for a matched idempotency key across multiple requests (e.g., to ensure consistency in critical fields like transaction amounts, or to detect tampered payloads) | -| **throwOnNoIdempotencyKey** | `false` | Throw an error if no idempotency key was found in the request | -| **expiresAfterSeconds** | 3600 | The number of seconds to wait before a record is expired, allowing a new transaction with the same idempotency key | -| **useLocalCache** | `false` | Whether to cache idempotency results in-memory to save on persistence storage latency and costs | -| **localCacheMaxItems** | 256 | Max number of items to store in local cache | -| **hashFunction** | `md5` | Function to use for calculating hashes, as provided by the [crypto](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options){target="_blank"} module in the standard library. | -| **responseHook** | `undefined` | Function to use for processing the stored Idempotent response. This function hook is called when an existing idempotent response is found. See [Manipulating The Idempotent Response](idempotency.md#manipulating-the-idempotent-response) | +| Parameter | Default | Description | +| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **eventKeyJmespath** | `''` | JMESPath expression to extract the idempotency key from the event record using [built-in functions](./jmespath.md#built-in-jmespath-functions){target="_blank"} | +| **payloadValidationJmespath** | `''` | JMESPath expression to validate that the specified fields haven't changed across requests for the same idempotency key _e.g., payload tampering._ | +| **throwOnNoIdempotencyKey** | `false` | Throw an error if no idempotency key was found in the request | +| **expiresAfterSeconds** | 3600 | The number of seconds to wait before a record is expired, allowing a new transaction with the same idempotency key | +| **useLocalCache** | `false` | Whether to cache idempotency results in-memory to save on persistence storage latency and costs | +| **localCacheMaxItems** | 256 | Max number of items to store in local cache | +| **hashFunction** | `md5` | Function to use for calculating hashes, as provided by the [crypto](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options){target="_blank"} module in the standard library. | +| **responseHook** | `undefined` | Function to use for processing the stored Idempotent response. This function hook is called when an existing idempotent response is found. See [Manipulating The Idempotent Response](idempotency.md#manipulating-the-idempotent-response) | ### Handling concurrent executions with the same payload