Skip to content

Commit

Permalink
Remove itsdangerous
Browse files Browse the repository at this point in the history
  • Loading branch information
seshubaws committed Nov 14, 2023
1 parent 9fc33b4 commit e631581
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/data_masking/src/custom_data_masking_provider.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from itsdangerous.url_safe import URLSafeSerializer

import json
from aws_lambda_powertools.utilities._data_masking.provider import BaseProvider


class MyCustomEncryption(BaseProvider):
def __init__(self, secret):
super().__init__()
self.secret = URLSafeSerializer(secret)
self.secret = secret

def encrypt(self, data: str) -> str:
if data is None:
return data
return self.secret.dumps(data)
return json.dumps(data)

def decrypt(self, data: str) -> str:
if data is None:
return data
return self.secret.loads(data)
return json.loads(data)

0 comments on commit e631581

Please sign in to comment.