Commit Graph

950 Commits

Author SHA1 Message Date
Peter Hamilton 01eb144243 Add ApplicationSpecificInformation support to the server
This change adds ApplicationSpecificInformation attribute support
to the server, allowing for the storage and retrieval of the new
attribute in addition to object filtering based on its value. New
unit tests have been added to cover the new changes.
2019-10-03 17:00:05 -04:00
Peter Hamilton 3f84a20a0c Add ApplicationSpecificInformation to the database model
This change adds a new SQLAlchemy object to the database model
representing the ApplicationSpecificInformation attribute. The
new object is linked to the base ManagedObject object, allowing
ApplicationSpecificInformation attributes to be associated with
any managed object. This also represents how KMIP attributes
should be supported going forward. A new unit test suite has
been added to verify the new object functionality and to confirm
that the object can be stored and retrieved from an in-memory
database.
2019-09-30 12:32:10 -04:00
Peter Hamilton b7d2cc1382 Update ApplicationSpecificInformation support to modern style
This change updates the ApplicationSpecificInformation attribute
implementation to reflect modern library style. Property methods
have been added alongside tighter read/write error checking. The
unit tests for the attribute have been updated to reflect all of
the new changes.
2019-09-27 11:15:33 -04:00
Peter Hamilton 0361bf9d44 Add a SplitKey register demo script
This change adds a demo script showing how to register SplitKey
objects. The existing Get and Destroy demo scripts also work with
the new SplitKey objects. Demo utilities for logging object info
have been updated and improved as well.

Closes #545
2019-09-20 15:22:42 -04:00
Peter Hamilton 29750cbda6 Add SplitKey server integration tests
This change adds integration tests that test registering,
retrieving, and destroying SplitKey objects with the server.
Minor updates are included for the client and server to ensure
that SplitKey operations function as expected.

Partially implements #545
2019-09-20 14:04:57 -04:00
Peter Hamilton a8713fc909 Add conversion utilities for SplitKey objects
This change adds conversion utilities for SplitKey objects,
allowing for conversions between the Pie and Core object spaces.
The server is also updated to recognize the new Pie SplitKey
object. Unit tests have been added and tweaked to accommodate
these changes.

Partially implements #545
2019-09-20 11:11:26 -04:00
Peter Hamilton 84ab77cd8d Add SQLAlchemy-based SplitKey support
This change adds a SQLAlchemy-based implementation of the SplitKey
object that will be used by the ProxyKmipClient and PyKMIP server
to store SplitKeys. A new unit test suite is included that checks
object fields and verifies it can be persisted to and retrieved
from an in-memory SQLAlchemy-managed database.

Partially implements #545
2019-09-13 16:35:49 -04:00
Peter Hamilton 5c117c9805 Remove basepython for non-default tox environments
This change removes the basepython setting for non-default tox
environments, allowing those environments to use the default
system Python instead of forcing the use of Python 2.7. This
will now allow various TravisCI test runs to use the right
version of Python.
2019-09-13 16:06:01 -04:00
Peter Hamilton 64d78dc8e3 Update encoding support for SplitKey objects
This change updates encoding support for SplitKey objects, bringing
it up-to-date with the modern conventions used in the rest of the
library. A new unit test suite has been added to cover the new
functionality.

Partially implements #545
2019-09-11 09:26:06 -04:00
Tom J ef57ece994 missing enums import 2019-09-09 09:05:53 -04:00
Tom J eee6f76ee4 missing comma in docs Python sample 2019-09-09 09:05:53 -04:00
ctil b8c19cfa0d Require enum-compat instead of enum34
The enum34 package is not compatible with python 3.4+. By
requiring enum-compat instead, this requirement will be a
noop when installing the dependencies from a python 3.4+ environment.

Closes: #450
2019-08-28 13:31:34 -04:00
Peter Hamilton c1b816bf04 Fix a bug with how key pair names are handled in the client
This change fixes a bug with how key pair names are handled by the
ProxyKmipClient. The original implementation stored key pair names
in the 'names' field of the various template attributes used to
define the key pair attributes. However, the 'names' field is
meant for the names of existing template objects that should be
used as another source for attribute values. Before KMIP 2.0
support was added, this worked because attributes and names were
encoded the same way and were interpreted by the server correctly.
The addition of KMIP 2.0 drops the 'names' field when handling
template attributes, dropping the names from being sent to the
server when creating new key pairs. This change fixes this and
updates relevant client unit tests to detect this error in the
future.

Fixes #560
2019-08-23 17:22:27 -04:00
oleksiys 16480bc9a2 Address PR comment 2019-08-21 08:32:45 -04:00
oleksiys c2bfd3e835 + Strip the tag to the requested tag_length.
+ Add GCM test.
2019-08-21 08:32:45 -04:00
oleksiys ead6c431bc Address PR comments 2019-08-21 08:32:45 -04:00
oleksiys fdf52a541a Address PR comments 2019-08-21 08:32:45 -04:00
oleksiys 26c1c71fff Add support for AES GCM mode. 2019-08-21 08:32:45 -04:00
Peter Hamilton 44d55f2550 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.
2019-08-16 17:31:42 -04:00
Peter Hamilton b5a8739157 Add CryptographicUsageMask filtering support for Locate
This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the object's
Cryptographic Usage Masks. 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 Usage Mask filtering. Simply use the
"--cryptographic-usage-mask" flag to specify one or more
Cryptographic Usage Mask enumeration values for the Locate script
to filter on.
2019-08-12 16:54:03 -04:00
Peter Hamilton 4a6a2eccc1 Add offset and maximum item filtering for the Locate operation
This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects using the offset and maximum item
constraints. The offset constraint tells the server how many
matching items should be skipped before results are returned. The
maximum items constraint tells the server how many matching items
should be returned. 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 offset and maximum item filtering. Simply use the
"--offset-items" and "--maximum-items" flags to specify offset and
maximum item values for the Locate script to filter on.

Fixes #562
2019-08-09 17:13:20 -04:00
Peter Hamilton 4938f82772 Sort the Locate matched objects by their creation date
This change updates the PyKMIP server's support for the Locate
operation, sorting the matched objects found by Locate by their
initial date, newest objects first. This matches the KMIP
specification's definition for how Locate results should be
ordered.
2019-08-09 11:42:31 -04:00
Peter Hamilton c3c03e5091 Fix a bug with the debug logging for Initial Date filtering
This change fixes a bug in the server engine unit tests that
check the debug logs for Locate filtering on the Initial Date
attribute. Specifically, time.asctime does not use the default
'%d' notation for stringifying numerical day values. This change
updates the string notation to match the format produced by
time.asctime.

Impacts #572
2019-08-09 11:04:42 -04:00
Peter Hamilton 942d55cca9 Add OperationPolicyName filtering support for Locate
This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the object's Operation
Policy Name. 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 Operation Policy Name filtering. Simply use the
"--operation-policy-name" flag to specify an Operation Policy Name
string value for the Locate script to filter on.
2019-08-01 09:06:09 -04:00
Peter Hamilton 9e95d14e08 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.
2019-07-31 16:30:47 -04:00
Peter Hamilton 8441bb4302 Add session encoding debug logging to the server
This change adds debug logging statements for the request and
response message encodings sent and received by the server
session. These provide direct visability into each message that
is handled by the server, facilitating debugging and correctness
checking. Given the content of these encodings may contain
sensitive information, debug logging should only be enabled when
testing or developing server features.
2019-07-31 15:03:08 -04:00
Peter Hamilton 6dcae13c5b 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.
2019-07-31 13:12:43 -04:00
Peter Hamilton bf518c8393 Add CryptographicAlgorithm filtering support for Locate
This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the object's
Cryptographic Algorithm. If an object's type does not support the
Cryptographic Algorithm attribute, that 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 Algorithm filtering. Simply use the
"--cryptographic-algorithm" flag to specify a Cryptographic
Algorithm enumeration for the Locate script to filter on.
2019-07-31 09:41:48 -04:00
Peter Hamilton d74b394261 Add ObjectType 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 Object 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 Object Type filtering. Simply use the "--object-type" flag
to specify an Object Type enumeration for the Locate script to
filter on.
2019-07-30 18:08:46 -04:00
Peter Hamilton e5de55c0a8 Add State 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 State. 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 State filtering. Simply use the "--state" flag to specify
a State enumeration for the Locate script to filter on.
2019-07-26 18:10:20 -04:00
Peter Hamilton da284e932b Add InitialDate filtering support for the Locate operation
This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the objects InitialDate
attribute value. Specifying a single InitialDate attribute in the
Locate request will perform an exact match on objects; specifying
two InitialDate attributes will perform a ranged 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 InitialDate filtering. Simply use the "--initial-date"
flag to provide one or more InitialDate values to the Locate
script to filter on those dates.
2019-07-26 16:31:37 -04:00
Peter Hamilton ee037408cf PyKMIP - Release 0.9.1
This update is a bug fix release for PyKMIP 0.9, including the
following changes:

* Fix a bug with Locate attribute handling for KMIP 2.0 clients
2019-06-21 17:08:30 -04:00
Peter Hamilton e52de92418 Update the CHANGELOG in preparation for the 0.9.1 release 2019-06-21 16:19:15 -04:00
Peter Hamilton df93c2f6e4 Fix Locate attribute handling for KMIP 2.0 clients
This change loosens the constraints on including attributes in
Locate messages for KMIP 2.0 clients. An early version of the KMIP
2.0 specification made attributes a required field for the Locate
payloads, breaking backwards compatibility with earlier versions
of the specification. A newer version of KMIP 2.0 reverses this
change. The library has been updated to reflect this newer version
of the specification. All relevant Locate unit tests have been
modified or removed to reflect this change.

Fixes #556
2019-06-21 15:36:36 -04:00
Peter Hamilton 8d89f19521 Bump the library version to 0.10.dev1
This change updates the library version to the next dev version
and updates the changelog to reflect this.
2019-06-20 11:23:47 -04:00
Peter Hamilton f8c76105c9 PyKMIP - Release 0.9.0
This update includes a library wide upgrade to support KMIP 2.0
for all currently supported KMIP operations. Additional changes
include documentation improvements, testing upgrades, and various
quality of life enhancements:

* Add support for Python 3.7
* Add KMIP 2.0 enumerations
* Add a new OrderedEnum subclass to handle sortable enumerations
* Add KMIP 2.0-style attribute handling
* Add utilities to convert TemplateAttributes and Attributes
* Add utilities to handle bit mask style enumerations
* Add positional argument handling for pytest calls when using tox
* Update the library documentation to include KMIP 2.0 information
* Update client exception handling / logging to simplify debugging
* Update library logging defaults to log at INFO but support DEBUG
* Update the Travis CI configuration to support Ubuntu 16.04
* Update the Travis CI configuration to output logs on failures
* Update the server to support KMIP 1.3, 1.4, and 2.0
* Update the PyKMIP clients to support changing their KMIP version
* Update server session logging for authentication failures
* Update the PyKMIP object hierarchy to propagate the KMIP version
* Update the server TLS handshake handling to avoid thread hanging
* Update the Create and Register payloads to support KMIP 2.0
* Update the Locate and CreateKeyPair payloads to support KMIP 2.0
* Update the DeriveKey / GetAttributes payloads to support KMIP 2.0
* Update the GetAttributeList / Query payloads to support KMIP 2.0
* Update attribute policy to handle KMIP 2.0 deprecated attributes
* Remove escape sequences to comply with Python 3.6 deprecations
* Fix various deprecation warnings caused by dependency upgrades
* Fix a bug decoding revocation messages for the Revoke operation
* Fix a bug specifying the function list in the Query demo script
2019-06-18 13:08:35 -04:00
Peter Hamilton f1b57d21fc Fix a bug with how the server retrieves attributes under KMIP 2.0
This change fixes a bug in the server attribute handling logic
that manifests when attributes are deprecated and removed in KMIP
2.0. Now these attributes are effectively ignored for KMIP 2.0
messages, complying with the KMIP 2.0 specification.
2019-06-18 11:43:21 -04:00
Peter Hamilton 4ebaa6f501 Fix a bug with the function list in the Query demo 2019-06-18 10:58:02 -04:00
Peter Hamilton 8fb05bd848 Fully enable KMIP 2.0 support for the server
This changes adds all of the final core updates necessary to allow
KMIP 2.0 message encoding/decoding support for the PyKMIP server.
Request and responses now dynamically adjust the KMIP version they
encode/decode under based on the KMIP version included in their
header segments. Extra server logging has also been added to show
the KMIP version specified by the client request.

Message tests have been updated to reflect these changes.
2019-06-18 09:02:10 -04:00
Peter Hamilton 1c879e2f49 Fix a bug with revocation message decoding
This change fixes a bug with revocation message decoding that
would cause client and server failures if the revocation message
was included in a Revoke operation call. With this fix, the client
can now send a revocation message with a Revoke request and the
revocation will occur as expected.

A ProxyKmipClient demo script for the Revoke operation has been
included to help test Revoke functionality.

Finally, an argument ordering bug with the original KMIPProxy demo
Revoke script has also been fixed.

Fixes #546
2019-06-17 16:49:15 -04:00
Peter Hamilton 5ac0c5d6dd Update the documentation to prepare for the PyKMIP 0.9 release 2019-06-17 15:04:14 -04:00
Peter Hamilton 9fac723b2e Update the server to nominally support KMIP 2.0 2019-06-17 13:09:48 -04:00
Peter Hamilton ffe5d7a86c Updating the Register payloads to properly use protection masks
This change updates the Register payloads to properly use the new
ProtectionStorageMasks structure. Unit tests have been updated to
reflect this change.
2019-05-10 16:08:09 -04:00
Peter Hamilton bc4e4e38bd Updating the Create payloads to properly use protection masks
This change updates the Create payloads to properly use the new
ProtectionStorageMasks structure. Unit tests have been updated to
reflect this change.
2019-05-10 15:27:04 -04:00
Peter Hamilton 7280ccb1eb Update the CreateKeyPair payloads to support protection masks
This change updates the CreateKeyPair payloads to support the new
protection storage masks fields introduced in KMIP 2.0. The payload
unit tests have been updated to reflect these changes.
2019-05-10 14:20:53 -04:00
Peter Hamilton 3b7d9bc21f Update the ResponseHeader to support the server hashed password
This change updates the ResponseHeader to support the new server
hashed password field added in KMIP 2.0. Unit tests have been
added to cover the change.
2019-05-10 09:22:20 -04:00
Peter Hamilton 4a9690165a Update the RequestBatchItem to support the ephemeral field
This change updates the RequestBatchItem to support the new
ephemeral field added in KMIP 2.0. Unit tests have been added to
cover the change.
2019-05-09 12:23:13 -04:00
Peter Hamilton a7f05ab7be Temporarily pin bandit to 1.5.1
A recent regression in bandit 1.6.0 permits the scanning of test
files for vulnerabilities even when those files should be excluded
using the '-x' flag. This change temporarily pins bandit to 1.5.1
in test-requirements.txt to get around this issue in the short
term.

This patch should be undone once bandit 1.6.1 is released, fixing
this issue.
2019-05-09 11:18:25 -04:00
Peter Hamilton cd16b20a6b Add support for the ProtectionStorageMasks structure
This change adds support for the ProtectionStorageMasks structure
which is a new addition in KMIP 2.0. A unit test suite has been
added for the new structure.
2019-05-03 16:48:07 -04:00
Peter Hamilton b4c3980da0 Update the Query payloads to rename Protection Storage Masks
This change makes a simple renaming update to the Query response
payload, correcting how Protection Storage Masks are used and
referenced. All related unit tests have been updated to reflect
this change.
2019-05-03 12:03:16 -04:00