2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-21 10:43:15 +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

@@ -41,6 +41,7 @@ if __name__ == '__main__':
object_type = opts.object_type
cryptographic_algorithm = opts.cryptographic_algorithm
cryptographic_length = opts.cryptographic_length
unique_identifier = opts.unique_identifier
attribute_factory = AttributeFactory()
credential_factory = CredentialFactory()
@@ -163,6 +164,13 @@ if __name__ == '__main__':
)
client.close()
sys.exit(-6)
if unique_identifier:
attributes.append(
attribute_factory.create_attribute(
enums.AttributeType.UNIQUE_IDENTIFIER,
unique_identifier
)
)
result = client.locate(attributes=attributes, credential=credential)
client.close()