Skip to content

Commit 90606ec

Browse files
feat: Adds the CachingMostRecentProvider. Deprecates MostRecentProvider.
Time-based key re-authorization logic in MostRecentProvider did not re-authorize the use of the key after key usage permissions were changed at the key provider (for example AWS Key Management Service). This created the potential for keys to be used in the DynamoDB Encryption Client after permissions to do so were revoked. The MostRecentProvider is deprecated. It is removed in 2.0.0. New deployments should use the CachingMostRecentProvider, and existing deployments should upgrade as soon as possible. See https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/most-recent-provider.html#mrp-versions for more details.
1 parent f133fc2 commit 90606ec

Some content is hidden

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

47 files changed

+5307
-170
lines changed

CHANGELOG.rst

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
Changelog
33
*********
44

5+
1.3.0 -- 2021-02-04
6+
===================
7+
Adds the CachingMostRecentProvider and deprecates MostRecentProvider.
8+
9+
Time-based key reauthorization logic in MostRecentProvider did not reauthorize
10+
the use of the key after key usage permissions were changed at the key provider
11+
(for example AWS Key Management Service). This created the potential for keys
12+
to be used in the DynamoDB Encryption Client after permissions to do so were revoked.
13+
14+
CachingMostRecentProvider replaces MostRecentProvider and provides a cache entry
15+
TTL to reauthorize the key with the key provider.
16+
17+
MostRecentProvider is now deprecated, and is removed in 2.0.0. See
18+
https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/most-recent-provider.html
19+
for more details.
20+
21+
522
1.2.0 -- 2019-10-10
623
===================
724

examples/src/most_recent_provider_encrypted_table.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
"""Example showing use of MostRecentProvider backed by a MetaStore using an AWS KMS CMP, with EncryptedTable."""
13+
"""Example showing use of CachingMostRecentProvider backed by a MetaStore using an AWS KMS CMP, with EncryptedTable."""
1414
import boto3
1515
from boto3.dynamodb.types import Binary
1616

1717
from dynamodb_encryption_sdk.encrypted.table import EncryptedTable
1818
from dynamodb_encryption_sdk.identifiers import CryptoAction
1919
from dynamodb_encryption_sdk.material_providers.aws_kms import AwsKmsCryptographicMaterialsProvider
20-
from dynamodb_encryption_sdk.material_providers.most_recent import MostRecentProvider
20+
from dynamodb_encryption_sdk.material_providers.most_recent import CachingMostRecentProvider
2121
from dynamodb_encryption_sdk.material_providers.store.meta import MetaStore
2222
from dynamodb_encryption_sdk.structures import AttributeActions
2323

@@ -47,7 +47,7 @@ def encrypt_item(table_name, aws_cmk_id, meta_table_name, material_name):
4747
# Create a meta store using the AWS KMS crypto materials provider.
4848
meta_store = MetaStore(table=meta_table, materials_provider=aws_kms_cmp)
4949
# Create a most recent provider using the meta store.
50-
most_recent_cmp = MostRecentProvider(
50+
most_recent_cmp = CachingMostRecentProvider(
5151
provider_store=meta_store,
5252
material_name=material_name,
5353
version_ttl=600.0, # Check for a new material version every five minutes.

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ markers =
2121
integ: mark a test as an integration test (requires network access)
2222
ddb_integ: mark a test as an integration test that requires a real DynamoDB table (requires network access and not used in CI)
2323
accept: mark a test as an acceptance test (requires network access)
24+
generate: mark a test as a generator of test vectors (requires network access)
2425
examples: mark a test as an examples test (requires network access)
2526
hypothesis: mark a test as using hypothesis (will run many times for each pytest call)
2627
hypothesis_strategy: mark a test as testing a hypothesis strategy

src/dynamodb_encryption_sdk/identifiers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from enum import Enum
1515

1616
__all__ = ("LOGGER_NAME", "CryptoAction", "EncryptionKeyType", "KeyEncodingType")
17-
__version__ = "1.2.0"
17+
__version__ = "1.3.0"
1818

1919
LOGGER_NAME = "dynamodb_encryption_sdk"
2020
USER_AGENT_SUFFIX = "DynamodbEncryptionSdkPython/{}".format(__version__)

0 commit comments

Comments
 (0)