Skip to content

Commit 917843c

Browse files
Merge branch 'develop' into drop-python37
2 parents 4811ac4 + 61223e1 commit 917843c

File tree

8 files changed

+101
-110
lines changed

8 files changed

+101
-110
lines changed

CHANGELOG.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,16 @@
44
<a name="unreleased"></a>
55
# Unreleased
66

7-
## Bug Fixes
8-
9-
* **event-handler:** strip whitespace from Content-Type headers during OpenAPI schema validation ([#3677](https://github.com/aws-powertools/powertools-lambda-python/issues/3677))
10-
11-
## Documentation
127

13-
* **metrics:** fix empty metric warning filter ([#3660](https://github.com/aws-powertools/powertools-lambda-python/issues/3660))
14-
* **proccess:** add versioning and maintenance policy ([#3682](https://github.com/aws-powertools/powertools-lambda-python/issues/3682))
15-
16-
## Features
8+
<a name="v2.33.0"></a>
9+
## [v2.33.0] - 2024-02-02
10+
## Bug Fixes
1711

18-
* **event_handler:** add support for multiValueQueryStringParameters in OpenAPI schema ([#3667](https://github.com/aws-powertools/powertools-lambda-python/issues/3667))
12+
* **data-masking:** fix and improve e2e tests for DataMasking ([#3695](https://github.com/aws-powertools/powertools-lambda-python/issues/3695))
1913

2014
## Maintenance
2115

22-
* **deps:** bump codecov/codecov-action from 3.1.4 to 3.1.5 ([#3674](https://github.com/aws-powertools/powertools-lambda-python/issues/3674))
23-
* **deps:** bump squidfunk/mkdocs-material from `58eef6c` to `9aad7af` in /docs ([#3670](https://github.com/aws-powertools/powertools-lambda-python/issues/3670))
24-
* **deps:** bump squidfunk/mkdocs-material from `9aad7af` to `a4a2029` in /docs ([#3679](https://github.com/aws-powertools/powertools-lambda-python/issues/3679))
25-
* **deps:** bump the layer-balancer group in /layer/scripts/layer-balancer with 1 update ([#3665](https://github.com/aws-powertools/powertools-lambda-python/issues/3665))
26-
* **deps:** bump codecov/codecov-action from 3.1.5 to 3.1.6 ([#3683](https://github.com/aws-powertools/powertools-lambda-python/issues/3683))
27-
* **deps:** bump pydantic from 1.10.13 to 1.10.14 ([#3655](https://github.com/aws-powertools/powertools-lambda-python/issues/3655))
28-
* **deps-dev:** bump aws-cdk from 2.123.0 to 2.124.0 ([#3678](https://github.com/aws-powertools/powertools-lambda-python/issues/3678))
29-
* **deps-dev:** bump sentry-sdk from 1.39.2 to 1.40.0 ([#3684](https://github.com/aws-powertools/powertools-lambda-python/issues/3684))
30-
* **deps-dev:** bump ruff from 0.1.13 to 0.1.14 ([#3656](https://github.com/aws-powertools/powertools-lambda-python/issues/3656))
31-
* **deps-dev:** bump ruff from 0.1.14 to 0.1.15 ([#3685](https://github.com/aws-powertools/powertools-lambda-python/issues/3685))
32-
* **deps-dev:** bump aws-cdk from 2.122.0 to 2.123.0 ([#3673](https://github.com/aws-powertools/powertools-lambda-python/issues/3673))
16+
* version bump
3317

3418

3519
<a name="v2.32.0"></a>
@@ -4303,7 +4287,8 @@
43034287
* Merge pull request [#5](https://github.com/aws-powertools/powertools-lambda-python/issues/5) from jfuss/feat/python38
43044288

43054289

4306-
[Unreleased]: https://github.com/aws-powertools/powertools-lambda-python/compare/v2.32.0...HEAD
4290+
[Unreleased]: https://github.com/aws-powertools/powertools-lambda-python/compare/v2.33.0...HEAD
4291+
[v2.33.0]: https://github.com/aws-powertools/powertools-lambda-python/compare/v2.32.0...v2.33.0
43074292
[v2.32.0]: https://github.com/aws-powertools/powertools-lambda-python/compare/v2.31.0...v2.32.0
43084293
[v2.31.0]: https://github.com/aws-powertools/powertools-lambda-python/compare/v2.30.2...v2.31.0
43094294
[v2.30.2]: https://github.com/aws-powertools/powertools-lambda-python/compare/v2.30.1...v2.30.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Exposes version constant to avoid circular dependencies."""
22

3-
VERSION = "2.32.0"
3+
VERSION = "2.33.0"

docs/index.md

Lines changed: 71 additions & 71 deletions
Large diffs are not rendered by default.

examples/logger/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Globals:
1414
Layers:
1515
# Find the latest Layer version in the official documentation
1616
# https://docs.powertools.aws.dev/lambda/python/latest/#lambda-layer
17-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:60
17+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:61
1818

1919
Resources:
2020
LoggerLambdaHandlerExample:

examples/metrics/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Globals:
1515
Layers:
1616
# Find the latest Layer version in the official documentation
1717
# https://docs.powertools.aws.dev/lambda/python/latest/#lambda-layer
18-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:60
18+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:61
1919

2020
Resources:
2121
CaptureLambdaHandlerExample:

examples/tracer/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Globals:
1313
Layers:
1414
# Find the latest Layer version in the official documentation
1515
# https://docs.powertools.aws.dev/lambda/python/latest/#lambda-layer
16-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:60
16+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:61
1717

1818
Resources:
1919
CaptureLambdaHandlerExample:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "aws_lambda_powertools"
3-
version = "2.32.0"
3+
version = "2.33.0"
44
description = "Powertools for AWS Lambda (Python) is a developer toolkit to implement Serverless best practices and increase developer velocity."
55
authors = ["Amazon Web Services"]
66
include = ["aws_lambda_powertools/py.typed", "THIRD-PARTY-LICENSES"]

tests/e2e/data_masking/test_e2e_data_masking.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22
from uuid import uuid4
33

44
import pytest
5-
from aws_encryption_sdk.exceptions import DecryptKeyError
65

76
from aws_lambda_powertools.utilities.data_masking import DataMasking
8-
from aws_lambda_powertools.utilities.data_masking.exceptions import DataMaskingContextMismatchError
7+
from aws_lambda_powertools.utilities.data_masking.exceptions import (
8+
DataMaskingContextMismatchError,
9+
DataMaskingDecryptKeyError,
10+
)
911
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
1012
AWSEncryptionSDKProvider,
1113
)
1214
from tests.e2e.utils import data_fetcher
1315

1416

17+
@pytest.fixture
18+
def security_context():
19+
return {"this": "is_secure"}
20+
21+
1522
@pytest.fixture
1623
def basic_handler_fn(infrastructure: dict) -> str:
1724
return infrastructure.get("BasicHandler", "")
@@ -53,36 +60,35 @@ def test_encryption(data_masker):
5360

5461

5562
@pytest.mark.xdist_group(name="data_masking")
56-
def test_encryption_context(data_masker):
63+
def test_encryption_context(data_masker, security_context):
5764
# GIVEN an instantiation of DataMasking with the AWS encryption provider
5865

5966
value = [1, 2, "string", 4.5]
60-
context = {"this": "is_secure"}
6167

6268
# WHEN encrypting and then decrypting the encrypted data with an encryption_context
63-
encrypted_data = data_masker.encrypt(value, encryption_context=context)
64-
decrypted_data = data_masker.decrypt(encrypted_data, encryption_context=context)
69+
encrypted_data = data_masker.encrypt(value, **security_context)
70+
decrypted_data = data_masker.decrypt(encrypted_data, **security_context)
6571

6672
# THEN the result is the original input data
6773
assert decrypted_data == value
6874

6975

7076
@pytest.mark.xdist_group(name="data_masking")
71-
def test_encryption_context_mismatch(data_masker):
77+
def test_encryption_context_mismatch(data_masker, security_context):
7278
# GIVEN an instantiation of DataMasking with the AWS encryption provider
7379

7480
value = [1, 2, "string", 4.5]
7581

7682
# WHEN encrypting with a encryption_context
77-
encrypted_data = data_masker.encrypt(value, encryption_context={"this": "is_secure"})
83+
encrypted_data = data_masker.encrypt(value, **security_context)
7884

7985
# THEN decrypting with a different encryption_context should raise a ContextMismatchError
8086
with pytest.raises(DataMaskingContextMismatchError):
81-
data_masker.decrypt(encrypted_data, encryption_context={"not": "same_context"})
87+
data_masker.decrypt(encrypted_data, this="different_context")
8288

8389

8490
@pytest.mark.xdist_group(name="data_masking")
85-
def test_encryption_no_context_fail(data_masker):
91+
def test_encryption_no_context_fail(data_masker, security_context):
8692
# GIVEN an instantiation of DataMasking with the AWS encryption provider
8793

8894
value = [1, 2, "string", 4.5]
@@ -92,7 +98,7 @@ def test_encryption_no_context_fail(data_masker):
9298

9399
# THEN decrypting with an encryption_context should raise a ContextMismatchError
94100
with pytest.raises(DataMaskingContextMismatchError):
95-
data_masker.decrypt(encrypted_data, encryption_context={"this": "is_secure"})
101+
data_masker.decrypt(encrypted_data, **security_context)
96102

97103

98104
@pytest.mark.xdist_group(name="data_masking")
@@ -106,7 +112,7 @@ def test_encryption_decryption_key_mismatch(data_masker, kms_key2_arn):
106112
# THEN when decrypting with a different key it should fail
107113
data_masker_key2 = DataMasking(provider=AWSEncryptionSDKProvider(keys=[kms_key2_arn]))
108114

109-
with pytest.raises(DecryptKeyError):
115+
with pytest.raises(DataMaskingDecryptKeyError):
110116
data_masker_key2.decrypt(encrypted_data)
111117

112118

0 commit comments

Comments
 (0)