2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-21 02:33:33 +00:00

Add UniqueIdentifier filtering support for the Locate operation

This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the object's Unique
Identifier. 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 Unique Identifier filtering. Simply use the
"--unique-identifier" flag to specify a Unique Identifier string
value for the Locate script to filter on.
This commit is contained in:
Peter Hamilton
2019-07-31 15:37:25 -04:00
committed by Peter Hamilton
parent 8441bb4302
commit 9e95d14e08
7 changed files with 218 additions and 0 deletions

View File

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