Skip to content

Commit

Permalink
docs(data-masking): add docs for data masking utility (aws-powertools…
Browse files Browse the repository at this point in the history
  • Loading branch information
seshubaws authored Feb 1, 2024
1 parent b784598 commit ced0a3d
Show file tree
Hide file tree
Showing 73 changed files with 2,709 additions and 750 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ dev:
pip install --upgrade pip pre-commit poetry
poetry config --local virtualenvs.in-project true
@$(MAKE) dev-version-plugin
poetry install --extras "all datamasking-aws-sdk redis"
poetry install --extras "all redis"
pre-commit install

dev-gitpod:
pip install --upgrade pip poetry
@$(MAKE) dev-version-plugin
poetry install --extras "all datamasking-aws-sdk redis"
poetry install --extras "all redis"
pre-commit install

format:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Powertools for AWS Lambda (Python) is a developer toolkit to implement Serverles
* **[Event source data classes](https://docs.powertools.aws.dev/lambda/python/latest/utilities/data_classes/)** - Data classes describing the schema of common Lambda event triggers
* **[Parser](https://docs.powertools.aws.dev/lambda/python/latest/utilities/parser/)** - Data parsing and deep validation using Pydantic
* **[Idempotency](https://docs.powertools.aws.dev/lambda/python/latest/utilities/idempotency/)** - Convert your Lambda functions into idempotent operations which are safe to retry
* **[Data Masking](https://docs.powertools.aws.dev/lambda/python/latest/utilities/data_masking/)** - Protect confidential data with easy removal or encryption
* **[Feature Flags](https://docs.powertools.aws.dev/lambda/python/latest/utilities/feature_flags/)** - A simple rule engine to evaluate when one or multiple features should be enabled depending on the input
* **[Streaming](https://docs.powertools.aws.dev/lambda/python/latest/utilities/streaming/)** - Streams datasets larger than the available memory as streaming data.

Expand Down
12 changes: 10 additions & 2 deletions aws_lambda_powertools/shared/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,18 @@ def resolve_env_var_choice(

def base64_decode(value: str) -> bytes:
try:
logger.debug("Decoding base64 record item before parsing")
logger.debug("Decoding base64 item to bytes")
return base64.b64decode(value)
except (BinAsciiError, TypeError):
raise ValueError("base64 decode failed")
raise ValueError("base64 decode failed - is this base64 encoded string?")


def bytes_to_base64_string(value: bytes) -> str:
try:
logger.debug("Encoding bytes to base64 string")
return base64.b64encode(value).decode()
except TypeError:
raise ValueError(f"base64 encoding failed - is this bytes data? type: {type(value)}")


def bytes_to_string(value: bytes) -> str:
Expand Down
174 changes: 0 additions & 174 deletions aws_lambda_powertools/utilities/_data_masking/base.py

This file was deleted.

5 changes: 0 additions & 5 deletions aws_lambda_powertools/utilities/_data_masking/constants.py

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions aws_lambda_powertools/utilities/_data_masking/provider/base.py

This file was deleted.

This file was deleted.

Loading

0 comments on commit ced0a3d

Please sign in to comment.