Skip to content

Bug: Encrypt and decrypt fails when using encryption context in data masking #6073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leandrodamascena opened this issue Feb 11, 2025 · 3 comments · Fixed by #6074
Closed
Assignees
Labels
bug Something isn't working data-masking Sensitive Data Masking feature

Comments

@leandrodamascena
Copy link
Contributor

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(provider=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

@leandrodamascena leandrodamascena added bug Something isn't working triage Pending triage from maintainers labels Feb 11, 2025
@leandrodamascena leandrodamascena self-assigned this Feb 11, 2025
@leandrodamascena leandrodamascena removed the triage Pending triage from maintainers label Feb 11, 2025
@leandrodamascena leandrodamascena moved this from Triage to Working on it in Powertools for AWS Lambda (Python) Feb 11, 2025
@leandrodamascena leandrodamascena added the data-masking Sensitive Data Masking feature label Feb 11, 2025
@leandrodamascena
Copy link
Contributor Author

Closed as complete via #6074

@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (Python) Feb 11, 2025
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Feb 11, 2025
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Copy link
Contributor

This is now released under 3.7.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Feb 25, 2025
@leandrodamascena leandrodamascena moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data-masking Sensitive Data Masking feature
Projects
Status: Shipped
1 participant