Skip to content

Commit 167e015

Browse files
committed
chore(keyring examples): refactor keyring examples and deprecate master key provider examples
1 parent 2a35192 commit 167e015

File tree

66 files changed

+59
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+59
-59
lines changed

examples/src/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License"). You
4-
# may not use this file except in compliance with the License. A copy of
5-
# the License is located at
6-
#
7-
# http://aws.amazon.com/apache2.0/
8-
#
9-
# or in the "license" file accompanying this file. This file is
10-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11-
# ANY KIND, either express or implied. See the License for the specific
12-
# language governing permissions and limitations under the License.
1+
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
133
"""Stub module indicator to make linter configuration simpler."""

examples/src/deprecated/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
"""Stub module indicator to make linter configuration simpler."""
File renamed without changes.
File renamed without changes.

examples/src/keyrings/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/test/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License"). You
4-
# may not use this file except in compliance with the License. A copy of
5-
# the License is located at
6-
#
7-
# http://aws.amazon.com/apache2.0/
8-
#
9-
# or in the "license" file accompanying this file. This file is
10-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11-
# ANY KIND, either express or implied. See the License for the specific
12-
# language governing permissions and limitations under the License.
1+
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
133
"""Stub module indicator to make linter configuration simpler."""

examples/test/deprecated/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
"""Stub module indicator to make linter configuration simpler."""

examples/test/examples_test_utils.py renamed to examples/test/deprecated/examples_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys
1616

1717
os.environ["AWS_ENCRYPTION_SDK_EXAMPLES_TESTING"] = "yes"
18-
sys.path.extend([os.sep.join([os.path.dirname(__file__), "..", "..", "test", "integration"])])
18+
sys.path.extend([os.sep.join([os.path.dirname(__file__), "..", "..", "..", "test", "integration"])])
1919

2020
static_plaintext = (
2121
b"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "

examples/test/test_i_basic_encryption.py renamed to examples/test/deprecated/test_i_basic_encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import botocore.session
1515
import pytest
1616

17-
from ..src.basic_encryption import cycle_string
17+
from ...src.deprecated.basic_encryption import cycle_string
1818
from .examples_test_utils import get_cmk_arn, static_plaintext
1919

2020

examples/test/test_i_basic_file_encryption_with_multiple_providers.py renamed to examples/test/deprecated/test_i_basic_file_encryption_with_multiple_providers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import botocore.session
1818
import pytest
1919

20-
from ..src.basic_file_encryption_with_multiple_providers import cycle_file
20+
from ...src.deprecated.basic_file_encryption_with_multiple_providers import cycle_file
2121
from .examples_test_utils import get_cmk_arn
2222
from .examples_test_utils import static_plaintext
2323

examples/test/test_i_basic_file_encryption_with_raw_key_provider.py renamed to examples/test/deprecated/test_i_basic_file_encryption_with_raw_key_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import pytest
1818

19-
from ..src.basic_file_encryption_with_raw_key_provider import cycle_file
19+
from ...src.deprecated.basic_file_encryption_with_raw_key_provider import cycle_file
2020
from .examples_test_utils import static_plaintext
2121

2222

examples/test/test_i_data_key_caching_basic.py renamed to examples/test/deprecated/test_i_data_key_caching_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""Unit test suite for the basic data key caching example in the AWS-hosted documentation."""
1414
import pytest
1515

16-
from ..src.data_key_caching_basic import encrypt_with_caching
16+
from ...src.deprecated.data_key_caching_basic import encrypt_with_caching
1717
from .examples_test_utils import get_cmk_arn
1818

1919

examples/test/test_i_discovery_kms_provider.py renamed to examples/test/deprecated/test_i_discovery_kms_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import botocore.session
1616
import pytest
1717

18-
from ..src.discovery_kms_provider import encrypt_decrypt
18+
from ...src.deprecated.discovery_kms_provider import encrypt_decrypt
1919
from .examples_test_utils import get_cmk_arn
2020
from .examples_test_utils import static_plaintext
2121

examples/test/test_i_mrk_aware_kms_provider.py renamed to examples/test/deprecated/test_i_mrk_aware_kms_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import pytest
1616

17-
from ..src.mrk_aware_kms_provider import encrypt_decrypt
17+
from ...src.deprecated.mrk_aware_kms_provider import encrypt_decrypt
1818
from .examples_test_utils import get_mrk_arn, get_second_mrk_arn
1919
from .examples_test_utils import static_plaintext
2020

examples/test/test_i_multiple_kms_cmk.py renamed to examples/test/deprecated/test_i_multiple_kms_cmk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import botocore.session
1616
import pytest
1717

18-
from ..src.multiple_kms_cmk import encrypt_decrypt
18+
from ...src.deprecated.multiple_kms_cmk import encrypt_decrypt
1919
from .examples_test_utils import get_cmk_arn, get_second_cmk_arn
2020
from .examples_test_utils import static_plaintext
2121

examples/test/test_i_one_kms_cmk.py renamed to examples/test/deprecated/test_i_one_kms_cmk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import botocore.session
1616
import pytest
1717

18-
from ..src.one_kms_cmk import encrypt_decrypt
18+
from ...src.deprecated.one_kms_cmk import encrypt_decrypt
1919
from .examples_test_utils import get_cmk_arn
2020
from .examples_test_utils import static_plaintext
2121

examples/test/test_i_one_kms_cmk_streaming_data.py renamed to examples/test/deprecated/test_i_one_kms_cmk_streaming_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import botocore.session
1818
import pytest
1919

20-
from ..src.one_kms_cmk_streaming_data import encrypt_decrypt_stream
20+
from ...src.deprecated.one_kms_cmk_streaming_data import encrypt_decrypt_stream
2121
from .examples_test_utils import get_cmk_arn, static_plaintext
2222

2323

examples/test/test_i_one_kms_cmk_unsigned.py renamed to examples/test/deprecated/test_i_one_kms_cmk_unsigned.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import botocore.session
1616
import pytest
1717

18-
from ..src.one_kms_cmk_unsigned import encrypt_decrypt
18+
from ...src.deprecated.one_kms_cmk_unsigned import encrypt_decrypt
1919
from .examples_test_utils import get_cmk_arn
2020
from .examples_test_utils import static_plaintext
2121

examples/test/test_i_set_commitment.py renamed to examples/test/deprecated/test_i_set_commitment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import botocore.session
1616
import pytest
1717

18-
from ..src.set_commitment import encrypt_decrypt
18+
from ...src.deprecated.set_commitment import encrypt_decrypt
1919
from .examples_test_utils import get_cmk_arn
2020
from .examples_test_utils import static_plaintext
2121

examples/test/keyrings/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/test/keyrings/test_i_aws_kms_discovery_keyring_example.py renamed to examples/test/test_i_aws_kms_discovery_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS Discovery keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_discovery_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_discovery_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_discovery_multi_keyring_example.py renamed to examples/test/test_i_aws_kms_discovery_multi_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS Discovery Multi keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_discovery_multi_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_discovery_multi_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_keyring_example.py renamed to examples/test/test_i_aws_kms_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_mrk_discovery_keyring_example.py renamed to examples/test/test_i_aws_kms_mrk_discovery_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS MRK Discovery keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_mrk_discovery_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_mrk_discovery_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_mrk_discovery_multi_keyring_example.py renamed to examples/test/test_i_aws_kms_mrk_discovery_multi_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS MRK Discovery Multi keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_mrk_discovery_multi_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_mrk_discovery_multi_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_mrk_keyring_example.py renamed to examples/test/test_i_aws_kms_mrk_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS MRK keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_mrk_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_mrk_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_mrk_multi_keyring_example.py renamed to examples/test/test_i_aws_kms_mrk_multi_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS MRK Multi keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_mrk_multi_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_mrk_multi_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_multi_keyring_example.py renamed to examples/test/test_i_aws_kms_multi_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS multi keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_multi_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_multi_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_aws_kms_rsa_keyring_example.py renamed to examples/test/test_i_aws_kms_rsa_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the AWS KMS RSA keyring example."""
44
import pytest
55

6-
from ...src.keyrings.aws_kms_rsa_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.aws_kms_rsa_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_file_streaming_example.py renamed to examples/test/test_i_file_streaming_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from ...src.keyrings.file_streaming_example import encrypt_and_decrypt_with_keyring
8+
from ..src.file_streaming_example import encrypt_and_decrypt_with_keyring
99

1010
pytestmark = [pytest.mark.examples]
1111

examples/test/keyrings/test_i_hierarchical_keyring_example.py renamed to examples/test/test_i_hierarchical_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the hierarchical keyring example."""
44
import pytest
55

6-
from ...src.keyrings.hierarchical_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.hierarchical_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_migration_set_commitment_policy_example.py renamed to examples/test/test_i_migration_set_commitment_policy_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the migration_set_commitment_policy_example."""
44
import pytest
55

6-
from ...src.keyrings.migration_set_commitment_policy_example import encrypt_and_decrypt_with_keyring
6+
from ..src.migration_set_commitment_policy_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_multi_keyring_example.py renamed to examples/test/test_i_multi_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the multi keyring example."""
44
import pytest
55

6-
from ...src.keyrings.multi_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.multi_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_raw_aes_keyring_example.py renamed to examples/test/test_i_raw_aes_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the Raw AES keyring example."""
44
import pytest
55

6-
from ...src.keyrings.raw_aes_keyring_example import encrypt_and_decrypt_with_keyring
6+
from ..src.raw_aes_keyring_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_raw_rsa_keyring_example.py renamed to examples/test/test_i_raw_rsa_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from ...src.keyrings.raw_rsa_keyring_example import encrypt_and_decrypt_with_keyring, generate_rsa_keys
8+
from ..src.raw_rsa_keyring_example import encrypt_and_decrypt_with_keyring, generate_rsa_keys
99

1010
pytestmark = [pytest.mark.examples]
1111

examples/test/keyrings/test_i_required_encryption_context_cmm.py renamed to examples/test/test_i_required_encryption_context_cmm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the required encryption context CMM example."""
44
import pytest
55

6-
from ...src.keyrings.required_encryption_context_cmm import encrypt_and_decrypt_with_keyring
6+
from ..src.required_encryption_context_cmm import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

examples/test/keyrings/test_i_set_encryption_algorithm_suite_example.py renamed to examples/test/test_i_set_encryption_algorithm_suite_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Test suite for the Set Algorithm Suite example for a Raw AES keyring."""
44
import pytest
55

6-
from ...src.keyrings.set_encryption_algorithm_suite_example import encrypt_and_decrypt_with_keyring
6+
from ..src.set_encryption_algorithm_suite_example import encrypt_and_decrypt_with_keyring
77

88
pytestmark = [pytest.mark.examples]
99

0 commit comments

Comments
 (0)