Skip to content

Commit

Permalink
Making utility public
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrodamascena committed Dec 20, 2023
1 parent d89cbcc commit 5d1687e
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 52 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Keep in mind that when we transition to General Availability (GA), there might be breaking changes introduced.
"""

from aws_lambda_powertools.utilities._data_masking.base import DataMasking
from aws_lambda_powertools.utilities.data_masking.base import DataMasking

__all__ = [
"DataMasking",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

from jsonpath_ng.ext import parse

from aws_lambda_powertools.utilities._data_masking.exceptions import (
from aws_lambda_powertools.utilities.data_masking.exceptions import (
DataMaskingFieldNotFoundError,
DataMaskingUnsupportedTypeError,
)
from aws_lambda_powertools.utilities._data_masking.provider import BaseProvider
from aws_lambda_powertools.utilities.data_masking.provider import BaseProvider

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from aws_lambda_powertools.utilities.data_masking.provider.base import BaseProvider

__all__ = [
"BaseProvider",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
from typing import Any, Callable, Iterable

from aws_lambda_powertools.utilities._data_masking.constants import DATA_MASKING_STRING
from aws_lambda_powertools.utilities.data_masking.constants import DATA_MASKING_STRING


class BaseProvider:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider

__all__ = [
"AWSEncryptionSDKProvider",
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
bytes_to_string,
)
from aws_lambda_powertools.shared.user_agent import register_feature_to_botocore_session
from aws_lambda_powertools.utilities._data_masking.constants import (
from aws_lambda_powertools.utilities.data_masking.constants import (
CACHE_CAPACITY,
ENCRYPTED_DATA_KEY_CTX_KEY,
MAX_BYTES_ENCRYPTED,
MAX_CACHE_AGE_SECONDS,
MAX_MESSAGES_ENCRYPTED,
)
from aws_lambda_powertools.utilities._data_masking.exceptions import (
from aws_lambda_powertools.utilities.data_masking.exceptions import (
DataMaskingContextMismatchError,
DataMaskingDecryptKeyError,
DataMaskingDecryptValueError,
DataMaskingEncryptKeyError,
DataMaskingUnsupportedTypeError,
)
from aws_lambda_powertools.utilities._data_masking.provider import BaseProvider
from aws_lambda_powertools.utilities.data_masking.provider import BaseProvider

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions examples/data_masking/src/advanced_custom_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import ujson

from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import (
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
AWSEncryptionSDKProvider,
)
from aws_lambda_powertools.utilities.typing import LambdaContext
Expand Down
4 changes: 2 additions & 2 deletions examples/data_masking/src/data_masking_function_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.getenv("KMS_KEY_ARN", "")
Expand Down
4 changes: 2 additions & 2 deletions examples/data_masking/src/getting_started_decrypt_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.getenv("KMS_KEY_ARN", "") # (1)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.getenv("KMS_KEY_ARN", "")
Expand Down
4 changes: 2 additions & 2 deletions examples/data_masking/src/getting_started_encrypt_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import (
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
AWSEncryptionSDKProvider,
)
from aws_lambda_powertools.utilities.typing import LambdaContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.getenv("KMS_KEY_ARN", "")
Expand Down
2 changes: 1 addition & 1 deletion examples/data_masking/src/getting_started_mask_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.typing import LambdaContext

logger = Logger()
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/data_masking/handlers/basic_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider

logger = Logger()

Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/data_masking/test_e2e_data_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pytest
from aws_encryption_sdk.exceptions import DecryptKeyError

from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.exceptions import DataMaskingContextMismatchError
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import (
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.exceptions import DataMaskingContextMismatchError
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
AWSEncryptionSDKProvider,
)
from tests.e2e.utils import data_fetcher
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/data_masking/test_aws_encryption_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import pytest

from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.constants import DATA_MASKING_STRING
from aws_lambda_powertools.utilities._data_masking.provider import BaseProvider
from aws_lambda_powertools.utilities._data_masking.provider.kms import (
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.constants import DATA_MASKING_STRING
from aws_lambda_powertools.utilities.data_masking.provider import BaseProvider
from aws_lambda_powertools.utilities.data_masking.provider.kms import (
AWSEncryptionSDKProvider,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.environ["KMS_KEY_ARN"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.environ["KMS_KEY_ARN"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.utilities._data_masking import DataMasking
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.data_masking import DataMasking
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import AWSEncryptionSDKProvider
from aws_lambda_powertools.utilities.typing import LambdaContext

KMS_KEY_ARN = os.environ["KMS_KEY_ARN"]
Expand Down
4 changes: 2 additions & 2 deletions tests/performance/data_masking/test_perf_data_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import pytest

from aws_lambda_powertools.utilities._data_masking.base import DataMasking
from aws_lambda_powertools.utilities.data_masking.base import DataMasking

DATA_MASKING_PACKAGE = "aws_lambda_powertools.utilities._data_masking"
DATA_MASKING_PACKAGE = "aws_lambda_powertools.utilities.data_masking"
DATA_MASKING_INIT_SLA: float = 0.002
DATA_MASKING_NESTED_ENCRYPT_SLA: float = 0.05

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/data_masking/test_kms_provider.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest

from aws_lambda_powertools.utilities._data_masking.exceptions import (
from aws_lambda_powertools.utilities.data_masking.exceptions import (
DataMaskingContextMismatchError,
DataMaskingUnsupportedTypeError,
)
from aws_lambda_powertools.utilities._data_masking.provider.kms.aws_encryption_sdk import (
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
KMSKeyProvider,
)

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/data_masking/test_unit_data_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pytest

from aws_lambda_powertools.utilities._data_masking.base import DataMasking
from aws_lambda_powertools.utilities._data_masking.constants import DATA_MASKING_STRING
from aws_lambda_powertools.utilities._data_masking.exceptions import (
from aws_lambda_powertools.utilities.data_masking.base import DataMasking
from aws_lambda_powertools.utilities.data_masking.constants import DATA_MASKING_STRING
from aws_lambda_powertools.utilities.data_masking.exceptions import (
DataMaskingFieldNotFoundError,
DataMaskingUnsupportedTypeError,
)
Expand Down

0 comments on commit 5d1687e

Please sign in to comment.