mirror of
https://github.com/openkmip/pykmip
synced 2025-12-16 00:04:26 +00:00
Add CryptographicLength 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 Cryptographic Length. If an object's type does not support the Cryptographic Length attribute, the object is not a match. 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 Cryptographic Length filtering. Simply use the "--cryptographic-length" flag to specify a Cryptographic Length integer value for the Locate script to filter on.
This commit is contained in:
committed by
Peter Hamilton
parent
bf518c8393
commit
6dcae13c5b
@@ -1701,6 +1701,20 @@ class KmipEngine(object):
|
||||
)
|
||||
add_object = False
|
||||
break
|
||||
elif name == "Cryptographic Length":
|
||||
value = value.value
|
||||
if value != attribute:
|
||||
self._logger.debug(
|
||||
"Failed match: "
|
||||
"the specified cryptographic length ({}) "
|
||||
"does not match the object's cryptographic "
|
||||
"length ({}).".format(
|
||||
value,
|
||||
attribute
|
||||
)
|
||||
)
|
||||
add_object = False
|
||||
break
|
||||
elif name == enums.AttributeType.INITIAL_DATE.value:
|
||||
initial_date["value"] = attribute
|
||||
self._track_date_attributes(
|
||||
|
||||
Reference in New Issue
Block a user