Skip to content

Commit f06014e

Browse files
Merge pull request #401 from OpenKMIP/feat/add-register-name
Update ProxyKmipClient register to support name attributes
2 parents 742b24c + f145662 commit f06014e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

kmip/pie/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ def register(self, managed_object):
353353
managed_object.operation_policy_name
354354
)
355355
object_attributes.append(opn_attribute)
356+
if hasattr(managed_object, 'names'):
357+
if managed_object.names:
358+
for name in managed_object.names:
359+
name_attribute = self.attribute_factory.create_attribute(
360+
enums.AttributeType.NAME,
361+
name
362+
)
363+
object_attributes.append(name_attribute)
356364

357365
template = cobjects.TemplateAttribute(attributes=object_attributes)
358366
object_type = managed_object.object_type

kmip/tests/integration/services/test_proxykmipclient.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ def test_symmetric_key_register_get_destroy(self):
111111
enums.CryptographicAlgorithm.AES,
112112
128,
113113
(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E'
114-
b'\x0F'))
114+
b'\x0F'),
115+
name="Test Symmetric Key"
116+
)
115117

116118
uid = self.client.register(key)
117119
self.assertIsInstance(uid, six.string_types)

0 commit comments

Comments
 (0)