Пример #1
0
 def test_bare_alias_is_not_valid_mrk_identifier(self):
     id_str = "alias/myAlias"
     # //= compliance/framework/aws-kms/aws-kms-key-arn.txt#2.9
     # //= type=test
     # //# If the input starts with "alias/", this an AWS KMS alias and not a
     # //# multi-Region key id and MUST return false.
     assert not is_valid_mrk_identifier(id_str)
Пример #2
0
 def test_bare_mrk_id_is_valid_mrk_identifier(self):
     # //= compliance/framework/aws-kms/aws-kms-key-arn.txt#2.9
     # //= type=test
     # //# If the input starts with "mrk-", this is a multi-Region key id and
     # //# MUST return true.
     id_str = "mrk-1234-5678-9012-34567890"
     assert is_valid_mrk_identifier(id_str)
Пример #3
0
 def test_bare_srk_id_is_not_valid_mrk_identifier(self):
     # //= compliance/framework/aws-kms/aws-kms-key-arn.txt#2.9
     # //= type=test
     # //# If
     # //# the input does not start with any of the above, this is a multi-
     # //# Region key id and MUST return false.
     id_str = "1234-5678-9012-34567890"
     assert not is_valid_mrk_identifier(id_str)
Пример #4
0
    def test_mrk_arn_is_valid_mrk_identifier(self):
        # //= compliance/framework/aws-kms/aws-kms-key-arn.txt#2.9
        # //= type=test
        # //# This function MUST take a single AWS KMS identifier

        # //= compliance/framework/aws-kms/aws-kms-key-arn.txt#2.9
        # //= type=test
        # //# If the input starts with "arn:", this MUST return the output of
        # //# identifying an an AWS KMS multi-Region ARN (aws-kms-key-
        # //# arn.md#identifying-an-an-aws-kms-multi-region-arn) called with this
        # //# input.
        id_str = "arn:aws:kms:us-east-1:222222222222:key/mrk-1234-5678-9012-34567890"
        assert is_valid_mrk_identifier(id_str)
Пример #5
0
 def test_srk_arn_is_not_valid_mrk_identifier(self):
     id_str = "arn:aws:kms:us-east-1:222222222222:key/1234-5678-9012-34567890"
     assert not is_valid_mrk_identifier(id_str)
Пример #6
0
 def test_alias_arn_is_not_valid_mrk_identifier(self):
     id_str = "arn:aws:kms:us-east-1:222222222222:alias/myAlias"
     assert not is_valid_mrk_identifier(id_str)