35
35
)
36
36
from aws_encryption_sdk .identifiers import USER_AGENT_SUFFIX
37
37
from aws_encryption_sdk .internal .arn import arn_from_str , is_valid_mrk_identifier
38
+ from aws_encryption_sdk .internal .deprecation import deprecated
38
39
from aws_encryption_sdk .internal .str_ops import to_str
39
40
from aws_encryption_sdk .key_providers .base import MasterKey , MasterKeyConfig , MasterKeyProvider , MasterKeyProviderConfig
40
41
from aws_encryption_sdk .structures import DataKey , EncryptedDataKey , MasterKeyInfo
@@ -143,6 +144,7 @@ class DiscoveryFilter(object):
143
144
144
145
145
146
@attr .s (hash = True )
147
+ @deprecated ("Use KMS keyrings from the aws-cryptographic-material-providers library." )
146
148
class KMSMasterKeyConfig (MasterKeyConfig ):
147
149
"""Configuration object for KMSMasterKey objects.
148
150
@@ -170,6 +172,7 @@ def client_default(self):
170
172
return boto3 .session .Session (** kwargs ).client ("kms" , config = botocore_config )
171
173
172
174
175
+ @deprecated ("Use KMS keyrings from the aws-cryptographic-material-providers library." )
173
176
class KMSMasterKey (MasterKey ):
174
177
"""Master Key class for KMS CMKs.
175
178
@@ -383,6 +386,7 @@ def _validate_allowed_to_decrypt(self, edk_key_id):
383
386
384
387
385
388
@attr .s (hash = True )
389
+ @deprecated ("Use KMS MRK keyrings from the aws-cryptographic-material-providers library." )
386
390
class MRKAwareKMSMasterKeyConfig (MasterKeyConfig ):
387
391
"""Configuration object for MRKAwareKMSMasterKey objects. Mostly the same as KMSMasterKey, except the
388
392
client parameter is required rather than optional.
@@ -405,6 +409,7 @@ class MRKAwareKMSMasterKeyConfig(MasterKeyConfig):
405
409
)
406
410
407
411
412
+ @deprecated ("Use KMS MRK keyrings from the aws-cryptographic-material-providers library." )
408
413
class MRKAwareKMSMasterKey (KMSMasterKey ):
409
414
"""Master Key class for KMS MRKAware CMKs. The logic for this class is almost entirely the same as a normal
410
415
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):
515
520
516
521
517
522
@attr .s (hash = True )
523
+ @deprecated ("Use KMS keyrings from the aws-cryptographic-material-providers library." )
518
524
class KMSMasterKeyProviderConfig (MasterKeyProviderConfig ):
519
525
"""Configuration object for KMSMasterKeyProvider objects.
520
526
@@ -551,6 +557,7 @@ class KMSMasterKeyProviderConfig(MasterKeyProviderConfig):
551
557
552
558
553
559
@six .add_metaclass (abc .ABCMeta )
560
+ @deprecated ("Use KMS keyrings from the aws-cryptographic-material-providers library." )
554
561
class BaseKMSMasterKeyProvider (MasterKeyProvider ):
555
562
"""Master Key Provider for KMS.
556
563
@@ -739,6 +746,7 @@ def _new_master_key_impl(self, key_id):
739
746
)
740
747
741
748
749
+ @deprecated ("Use KMS keyrings from the aws-cryptographic-material-providers library." )
742
750
class StrictAwsKmsMasterKeyProvider (BaseKMSMasterKeyProvider ):
743
751
"""Strict Master Key Provider for KMS. It is configured with an explicit list of AWS KMS master keys that
744
752
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):
805
813
)
806
814
807
815
816
+ @deprecated ("Use KMS MRK keyrings from the aws-cryptographic-material-providers library." )
808
817
class MRKAwareStrictAwsKmsMasterKeyProvider (StrictAwsKmsMasterKeyProvider ):
809
818
"""A Strict Master Key Provider for KMS that has smarts for handling Multi-Region keys.
810
819
@@ -874,6 +883,7 @@ def validate_unique_mrks(self):
874
883
)
875
884
876
885
886
+ @deprecated ("Use KMS discovery keyrings from the aws-cryptographic-material-providers library." )
877
887
class DiscoveryAwsKmsMasterKeyProvider (BaseKMSMasterKeyProvider ):
878
888
"""Discovery Master Key Provider for KMS. This can only be used for decryption. It is configured with an optional
879
889
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):
929
939
)
930
940
931
941
942
+ @deprecated ("Use KMS MRK keyrings from the aws-cryptographic-material-providers library." )
932
943
class MRKAwareDiscoveryAwsKmsMasterKeyProvider (DiscoveryAwsKmsMasterKeyProvider ):
933
944
"""Discovery Master Key Provider for KMS that has smarts for handling Multi-Region keys
934
945
0 commit comments