mirror of
https://github.com/openkmip/pykmip
synced 2025-12-23 19:53:24 +00:00
Add support for the Sensitive attribute
This change adds support for the Sensitive attribute, adding it to the attribute factory, the SQLAlchemy object hierarchy, and to the server attribute handling methods. The intent is to use this new attribute to test the new SetAttribute and ModifyAttribute operations coming in future commits. Unit tests have been added and modified to support the new additions.
This commit is contained in:
committed by
Peter Hamilton
parent
4d2d2ba4f1
commit
e313731692
@@ -1757,6 +1757,10 @@ class TestKmipEngine(testtools.TestCase):
|
||||
enums.CryptographicUsageMask.DECRYPT
|
||||
]
|
||||
)
|
||||
sensitive = attribute_factory.create_attribute(
|
||||
enums.AttributeType.SENSITIVE,
|
||||
True
|
||||
)
|
||||
managed_object = pie_objects.SymmetricKey(
|
||||
enums.CryptographicAlgorithm.AES,
|
||||
0,
|
||||
@@ -1771,6 +1775,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
)
|
||||
self.assertEqual(0, managed_object.cryptographic_length)
|
||||
self.assertEqual([], managed_object.cryptographic_usage_masks)
|
||||
self.assertFalse(managed_object.sensitive)
|
||||
|
||||
e._set_attribute_on_managed_object(
|
||||
managed_object,
|
||||
@@ -1809,6 +1814,13 @@ class TestKmipEngine(testtools.TestCase):
|
||||
managed_object.cryptographic_usage_masks
|
||||
)
|
||||
|
||||
e._set_attribute_on_managed_object(
|
||||
managed_object,
|
||||
("Sensitive", sensitive.attribute_value)
|
||||
)
|
||||
|
||||
self.assertTrue(managed_object.sensitive)
|
||||
|
||||
def test_set_attribute_on_managed_object_unsupported_features(self):
|
||||
"""
|
||||
Test that the right errors are generated when unsupported features
|
||||
|
||||
Reference in New Issue
Block a user