Skip to content

Commit 693b776

Browse files
deprecated
1 parent c66938f commit 693b776

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/aws_encryption_sdk/key_providers/base.py

+5
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,23 @@
2525
InvalidKeyIdError,
2626
MasterKeyProviderError,
2727
)
28+
from aws_encryption_sdk.internal.deprecation import deprecated
2829
from aws_encryption_sdk.internal.str_ops import to_bytes
2930
from aws_encryption_sdk.structures import MasterKeyInfo
3031

3132
_LOGGER = logging.getLogger(__name__)
3233

3334

3435
@attr.s(hash=True)
36+
@deprecated("Use keyrings from the aws-cryptographic-material-providers library.")
3537
class MasterKeyProviderConfig(object):
3638
"""Provides a common ancestor for MasterKeyProvider configuration objects
3739
and a stand-in point if common params are needed later.
3840
"""
3941

4042

4143
@six.add_metaclass(abc.ABCMeta)
44+
@deprecated("Use keyrings from the aws-cryptographic-material-providers library.")
4245
class MasterKeyProvider(object):
4346
"""Parent interface for Master Key Provider classes.
4447
@@ -325,6 +328,7 @@ def decrypt_data_key_from_list(self, encrypted_data_keys, algorithm, encryption_
325328

326329

327330
@attr.s(hash=True)
331+
@deprecated("Use keyrings from the aws-cryptographic-material-providers library.")
328332
class MasterKeyConfig(object):
329333
"""Configuration object for MasterKey objects.
330334
@@ -342,6 +346,7 @@ def __attrs_post_init__(self):
342346

343347

344348
@six.add_metaclass(abc.ABCMeta)
349+
@deprecated("Use keyrings from the aws-cryptographic-material-providers library.")
345350
class MasterKey(MasterKeyProvider):
346351
"""Parent interface for Master Key classes.
347352

src/aws_encryption_sdk/key_providers/kms.py

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
)
3636
from aws_encryption_sdk.identifiers import USER_AGENT_SUFFIX
3737
from aws_encryption_sdk.internal.arn import arn_from_str, is_valid_mrk_identifier
38+
from aws_encryption_sdk.internal.deprecation import deprecated
3839
from aws_encryption_sdk.internal.str_ops import to_str
3940
from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig, MasterKeyProvider, MasterKeyProviderConfig
4041
from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo
@@ -143,6 +144,7 @@ class DiscoveryFilter(object):
143144

144145

145146
@attr.s(hash=True)
147+
@deprecated("Use KMS keyrings from the aws-cryptographic-material-providers library.")
146148
class KMSMasterKeyConfig(MasterKeyConfig):
147149
"""Configuration object for KMSMasterKey objects.
148150
@@ -170,6 +172,7 @@ def client_default(self):
170172
return boto3.session.Session(**kwargs).client("kms", config=botocore_config)
171173

172174

175+
@deprecated("Use KMS keyrings from the aws-cryptographic-material-providers library.")
173176
class KMSMasterKey(MasterKey):
174177
"""Master Key class for KMS CMKs.
175178
@@ -383,6 +386,7 @@ def _validate_allowed_to_decrypt(self, edk_key_id):
383386

384387

385388
@attr.s(hash=True)
389+
@deprecated("Use KMS MRK keyrings from the aws-cryptographic-material-providers library.")
386390
class MRKAwareKMSMasterKeyConfig(MasterKeyConfig):
387391
"""Configuration object for MRKAwareKMSMasterKey objects. Mostly the same as KMSMasterKey, except the
388392
client parameter is required rather than optional.
@@ -405,6 +409,7 @@ class MRKAwareKMSMasterKeyConfig(MasterKeyConfig):
405409
)
406410

407411

412+
@deprecated("Use KMS MRK keyrings from the aws-cryptographic-material-providers library.")
408413
class MRKAwareKMSMasterKey(KMSMasterKey):
409414
"""Master Key class for KMS MRKAware CMKs. The logic for this class is almost entirely the same as a normal
410415
KMSMasterKey ("single-region key"). The primary difference is that this class is more flexible in what ciphertexts
@@ -515,6 +520,7 @@ def owns_data_key(self, data_key):
515520

516521

517522
@attr.s(hash=True)
523+
@deprecated("Use KMS keyrings from the aws-cryptographic-material-providers library.")
518524
class KMSMasterKeyProviderConfig(MasterKeyProviderConfig):
519525
"""Configuration object for KMSMasterKeyProvider objects.
520526
@@ -551,6 +557,7 @@ class KMSMasterKeyProviderConfig(MasterKeyProviderConfig):
551557

552558

553559
@six.add_metaclass(abc.ABCMeta)
560+
@deprecated("Use KMS keyrings from the aws-cryptographic-material-providers library.")
554561
class BaseKMSMasterKeyProvider(MasterKeyProvider):
555562
"""Master Key Provider for KMS.
556563
@@ -739,6 +746,7 @@ def _new_master_key_impl(self, key_id):
739746
)
740747

741748

749+
@deprecated("Use KMS keyrings from the aws-cryptographic-material-providers library.")
742750
class StrictAwsKmsMasterKeyProvider(BaseKMSMasterKeyProvider):
743751
"""Strict Master Key Provider for KMS. It is configured with an explicit list of AWS KMS master keys that
744752
should be used for encryption and decryption. On encryption, the plaintext will be encrypted with all configured
@@ -805,6 +813,7 @@ def validate_config(self):
805813
)
806814

807815

816+
@deprecated("Use KMS MRK keyrings from the aws-cryptographic-material-providers library.")
808817
class MRKAwareStrictAwsKmsMasterKeyProvider(StrictAwsKmsMasterKeyProvider):
809818
"""A Strict Master Key Provider for KMS that has smarts for handling Multi-Region keys.
810819
@@ -874,6 +883,7 @@ def validate_unique_mrks(self):
874883
)
875884

876885

886+
@deprecated("Use KMS discovery keyrings from the aws-cryptographic-material-providers library.")
877887
class DiscoveryAwsKmsMasterKeyProvider(BaseKMSMasterKeyProvider):
878888
"""Discovery Master Key Provider for KMS. This can only be used for decryption. It is configured with an optional
879889
Discovery Filter containing AWS account ids and partitions that should be trusted for decryption. If a ciphertext
@@ -929,6 +939,7 @@ def validate_config(self):
929939
)
930940

931941

942+
@deprecated("Use KMS MRK keyrings from the aws-cryptographic-material-providers library.")
932943
class MRKAwareDiscoveryAwsKmsMasterKeyProvider(DiscoveryAwsKmsMasterKeyProvider):
933944
"""Discovery Master Key Provider for KMS that has smarts for handling Multi-Region keys
934945

src/aws_encryption_sdk/key_providers/raw.py

+4
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
import aws_encryption_sdk.internal.formatting.serialize
2323
from aws_encryption_sdk.identifiers import EncryptionType
2424
from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey
25+
from aws_encryption_sdk.internal.deprecation import deprecated
2526
from aws_encryption_sdk.key_providers.base import MasterKey, MasterKeyConfig, MasterKeyProvider, MasterKeyProviderConfig
2627
from aws_encryption_sdk.structures import DataKey, RawDataKey
2728

2829
_LOGGER = logging.getLogger(__name__)
2930

3031

3132
@attr.s(hash=True)
33+
@deprecated("Use raw keyrings from the aws-cryptographic-material-providers library.")
3234
class RawMasterKeyConfig(MasterKeyConfig):
3335
"""Configuration object for RawMasterKey objects.
3436
@@ -46,6 +48,7 @@ class RawMasterKeyConfig(MasterKeyConfig):
4648
wrapping_key = attr.ib(hash=True, validator=attr.validators.instance_of(WrappingKey))
4749

4850

51+
@deprecated("Use raw keyrings from the aws-cryptographic-material-providers library.")
4952
class RawMasterKey(MasterKey):
5053
"""Raw Master Key.
5154
@@ -189,6 +192,7 @@ def _decrypt_data_key(self, encrypted_data_key, algorithm, encryption_context):
189192

190193

191194
@six.add_metaclass(abc.ABCMeta)
195+
@deprecated("Use raw keyrings from the aws-cryptographic-material-providers library.")
192196
class RawMasterKeyProvider(MasterKeyProvider):
193197
"""Raw Master Key Provider.
194198

0 commit comments

Comments
 (0)