Add support for KMS key rotation operations
This adds support for the following KMS endpoints: * EnableKeyRotation * DisableKeyRotation * GetKeyRotationStatus Signed-off-by: Jesse Szwedko <jesse.szwedko@getbraintree.com>
This commit is contained in:
parent
32dd72f6b7
commit
f1566cecf4
3 changed files with 122 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ class Key(object):
|
|||
self.enabled = True
|
||||
self.region = region
|
||||
self.account_id = "0123456789012"
|
||||
self.key_rotation_status = False
|
||||
|
||||
@property
|
||||
def arn(self):
|
||||
|
|
@ -68,6 +69,16 @@ class KmsBackend(BaseBackend):
|
|||
def get_all_aliases(self):
|
||||
return self.key_to_aliases
|
||||
|
||||
def enable_key_rotation(self, key_id):
|
||||
self.keys[key_id].key_rotation_status = True
|
||||
|
||||
def disable_key_rotation(self, key_id):
|
||||
self.keys[key_id].key_rotation_status = False
|
||||
|
||||
def get_key_rotation_status(self, key_id):
|
||||
return self.keys[key_id].key_rotation_status
|
||||
|
||||
|
||||
kms_backends = {}
|
||||
for region in boto.kms.regions():
|
||||
kms_backends[region.name] = KmsBackend()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue