8000 Bug: Encrypt and decrypt fails when using encryption context in data masking · Issue #6073 · aws-powertools/powertools-lambda-python · GitHub
[go: up one dir, main page]

Skip to content
Bug: Encrypt and decrypt fails when using encryption context in data masking #6073
Closed
@leandrodamascena

Description

@leandrodamascena

Expected Behaviour

I'd expect to encrypt and decrypt data with encryption_context

Current Behaviour

When using encrypt or decrypt operation it fails because encrypt_context is now a generic kwargs.

Code snippet

from __future__ import annotations

from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
    AWSEncryptionSDKProvider,
)

encryption_provider = AWSEncryptionSDKProvider(keys=["ARN"])  
data_masker = DataMasking(prov
66B2
ider=encryption_provider)


data: dict = {"leandro": "x"}

encrypted = data_masker.encrypt(data)

print(encrypted)

Possible Solution

Fix it.

Steps to Reproduce

Run the code.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.13

Packaging format used

Lambda Layers, PyPi

Debugging logs

Metadata

Metadata

Labels

bugSomething isn't workingdata-maskingSensitive Data Masking feature

Type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0