Skip to content

Commit 6b21349

Browse files
committed
fix: make hashed idempotency key stable across status transitions
This protects against functions that inadvertently change the incoming event data
1 parent f50ec86 commit 6b21349

File tree

1 file changed

+2
-1
lines changed
  • aws_lambda_powertools/utilities/idempotency

1 file changed

+2
-1
lines changed

aws_lambda_powertools/utilities/idempotency/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
from typing import Any, Callable, Dict, Optional, Tuple
3+
from copy import deepcopy
34

45
from aws_lambda_powertools.utilities.idempotency.config import IdempotencyConfig
56
from aws_lambda_powertools.utilities.idempotency.exceptions import (
@@ -69,7 +70,7 @@ def __init__(
6970
Function keyword arguments
7071
"""
7172
self.function = function
72-
self.data = _prepare_data(function_payload)
73+
self.data = deepcopy(_prepare_data(function_payload))
7374
self.fn_args = function_args
7475
self.fn_kwargs = function_kwargs
7576

0 commit comments

Comments
 (0)