2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-27 21:53:39 +00:00

Add CertificateType filtering support for Locate

This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the object's
Certificate Type. Unit tests and integration tests have
been added to test and verify the correctness of this feature.

Additionally, the Locate demo scripts have also been updated to
support Certificate Type filtering. Simply use the
"--certificate-type" flag to specify a Certificate Type
enumeration values for the Locate script to filter on.
This commit is contained in:
Peter Hamilton
2019-08-16 16:53:15 -04:00
committed by Peter Hamilton
parent b5a8739157
commit 44d55f2550
9 changed files with 376 additions and 5 deletions

View File

@@ -1762,6 +1762,20 @@ class KmipEngine(object):
break
if not add_object:
break
elif name == "Certificate Type":
value = value.value
if value != attribute:
self._logger.debug(
"Failed match: "
"the specified certificate type ({}) "
"does not match the object's certificate "
"type ({}).".format(
value.name,
attribute.name
)
)
add_object = False
break
elif name == enums.AttributeType.INITIAL_DATE.value:
initial_date["value"] = attribute
self._track_date_attributes(