Commit Graph

950 Commits

Author SHA1 Message Date
dsmith-qlik 155c05069f Update attribute_values.py 2023-02-07 17:51:52 -05:00
dsmith-qlik a339b97add Update enums.py 2023-02-07 17:51:52 -05:00
Daniel Garcia Moreno 652d5cab67 Add cryptography >= 39.0.0 support
The cryptography release 39.0.0 added a new parameter to the
backend.load_pem_private_key and backend.load_der_private_key
that's required. This patch uses the serialization method to load keys
because there the new parameter is optional.

https://cryptography.io/en/latest/changelog/#v39-0-0

This patch fixes the tests test_encrypt_decrypt_asymmetric
2023-01-30 15:16:30 -05:00
Grace Lombardi 0a3e39143f Updated app specific info to be a list of dictionaries, removed unneeded sudo in run.sh, updated server.conf to remove db, updated tests and comments to reflect app specific info being a list 2022-07-25 10:12:56 -04:00
Grace Lombardi 6bf55b98f5 Added app_specific_info to init comments 2022-07-25 10:12:56 -04:00
Grace Lombardi 5920dca210 Removed uneeded important and code cleanup 2022-07-25 10:12:56 -04:00
Grace Lombardi 124f7db5cb Updated test for App Specific Info for Symmetric Key and added test for App Specific Info for SecretData 2022-07-25 10:12:56 -04:00
Grace Lombardi 1773fba67c Updated client integration tests, Added test for Application Specific Information 2022-07-25 10:12:56 -04:00
gracelombardi 20f20b0e29 Code consistency updated 2022-07-25 10:12:56 -04:00
Pranathi Locula 95b54707f7 add app_specific_info 2022-07-25 10:12:56 -04:00
Pranathi Locula 19a901d0be add custom attribute support 2022-07-25 10:12:56 -04:00
Pranathi Locula 8a2289c9bd custom attributes for SymmetricKey 2022-07-25 10:12:56 -04:00
Satya Kommula a7a5f37755 Bump codeql action v1 tov2 2022-06-15 14:27:57 -04:00
Tim Burke b7814959a4 Copy README.rst to long_description
This should provide a useful project description on PyPI the next time
we publish a release.
2022-05-17 13:18:56 -04:00
Konstantin Trushin 4d1e9c633c Repair some demos
Pass the required argument to the `build_cli_parser` function where
it was missed. Pass the missed argument in the `objects.SecretData`
initialization.
2022-05-17 13:12:48 -04:00
arp102 69b127c24d Add a Subject Alternative Name to the example server cert.
This is often required for hostname verification.
2022-03-22 14:17:12 -04:00
Karthikeyan Singaravelan b38b805bf0 Use assertEqual instead of assertEquals for Python 3.11 compatibility. 2022-03-16 14:14:33 -04:00
Tim Burke c0c9803956 Fix tests to pass with SQLAlchemy>=1.4.0
I'm not *entirely* sure what's going on here, but it seems that when we
do something like

    obj = OpaqueObject(...)
    Session = sessionmaker(...)
    session = Session()
    ...
    session.add(obj)
    session.commit()

the primary key (and maybe some foreign relations?) aren't automatically
populated on `obj` following the commit, and will attempt to lazy-load
on next reference. Since expire_on_commit defaults to True, the session
attached to `obj` (which is no longer the `session` in locals!) is closed
out when we later do

    session = Session()
    get_obj = session.query(OpaqueObject).filter(
        ManagedObject.unique_identifier == obj.unique_identifier).one()

leading to a DetachedInstanceError.

There seem to be a few different ways we can fix this:

* Set expire_on_commit=False so the old session is still useful for the
  lazy-loading.
* Re-use the same session instead of creating a new one.
* Explicitly refresh added objects post-commit.

Generally prefer the first one; there's some prior art to follow in
services/server/test_engine.py. Curiously, that same file runs into
trouble despite already setting expire_on_commit=False -- so do the
explicit refresh, on the assumption that there was a reason we went to
the trouble of creating a fresh session.

Closes #649
2021-09-23 13:43:04 -04:00
locula 6c2bc6b3d5 Update client.py 2021-08-03 10:33:15 -04:00
Pranathi Locula a9d15eb253 create SecretData objects with custom attributes 2021-08-03 10:33:15 -04:00
Peter Hamilton 9403ff3d2a
Create codeql-analysis.yml
Add automated Python security scanning using CodeQL as recommended and provided by GitHub.
2021-03-31 13:15:47 -04:00
Joel Capitao 645cbf2ae9 Set the except clause as a parenthesized tuple 2020-09-15 10:24:17 -04:00
Peter Hamilton fe60ecf02d Bump the library version to 0.11.0dev1 2020-03-09 11:57:45 -04:00
Peter Hamilton 53fa326bd4 PyKMIP - Release 0.10.0
This update includes numerous improvements to the usage and support
of KMIP attributes across both the client and server, including new
attribute support and new attribute operation support. The library
also now officially supports SplitKey objects.

The changes in this release include:

* Add server debug logging for message encodings
* Add server Locate filtering for all supported attributes
* Add server Locate filtering using offset/max item constraints
* Add server cryptography engine support for AES GCM mode
* Add server support for the SplitKey object
* Add client/server support for ApplicationSpecificInformation
* Add client/server support for ObjectGroup and Sensitive attrs
* Add client/server support for the DeleteAttribute operation
* Add client/server support for the SetAttribute operation
* Add client/server support for the ModifyAttribute operation
* Add unit and integration tests to cover all new functionality
* Add ProxyKmipClient demo scripts to show use of new operations
* Add pending deprecation warnings for Python 2.7 and 3.4
* Update server Locate filtering to sort results by creation date
* Update encoding support for SplitKey objects
* Update the Travis CI config to support default Python versions
* Update dependencies to maintain Python 3.4 support
* Update library docs to reflect new features and security details
* Fix a bug with how key pair names are handled by the client
2020-02-25 11:05:27 -05:00
Peter Hamilton 5b7cb4f194 Add pending deprecation warnings for Python 2.7 and 3.4
This change adds pending deprecation warnings for both Python 2.7
and 3.4. Both of these Python versions have reached end-of-life
and no longer receive security updates. Future versions of PyKMIP
will drop support for both of these Python versions.
2020-02-25 08:58:38 -05:00
Peter Hamilton 43016fef20 Update the PyKMIP documentation in preparation for v0.10
This change updates the PyKMIP documentation in preparation for
the v0.10 release. Changes include added detail and improvements
to the client and server documentation, tweaks to the install,
index, and community pages, and a new security page with info on
PyKMIP security issues and known vulnerabilities.
2020-02-24 15:02:03 -05:00
Peter Hamilton e83da492e3 Pin PyYAML to <=5.2
This change pins PyYAML, an upstream dependency for bandit, to be
<=5.2. Version 5.3+ drops support for Python 3.4, which breaks any
tests run using Python 3.4. When PyKMIP drops support for Python
3.4, this change can be reverted.
2020-02-24 14:36:53 -05:00
Peter Hamilton ae05118804 Add integration tests for the Modify and DeleteAttribute operations
This change adds integration tests for the client and server for
the Modify and DeleteAttribute operations, proving they work in
tandem. Minor bug fixes in the client are included to enable
correct test execution.

Partially implements #547
2019-12-13 16:21:32 -05:00
Peter Hamilton 2015cf79ca Add the SetAttribute operation to the default server policy
This change adds entries for the SetAttribute operation for each
object type in the default server operation policy. This enables
future SetAttribute operation integration tests.

Partially implements #547
2019-12-13 15:42:39 -05:00
Peter Hamilton cd8d66fe91 Fix a bug with attribute index handling in ModifyAttribute
This changes fixes a minor bug with proper attribute index range
checking in the server implementation of ModifyAttribute. A corner
case that previously slipped through index checking and testing
has been closed. An existing unit test has been modified to fix
this bug.

Partially implements #547
2019-12-13 15:42:20 -05:00
Peter Hamilton e5281cbd35 Add ProxyKmipClient demos for the new attribute operations
This change adds ProxyKmipClient demos for the new Set, Modify,
and Delete Attribute operations. The demos are not intended for
general use but instead to show how the client can be used to
execute these new operations against a KMIP server. See the
demo scripts themselves for more information.

Partially implements #547
2019-12-13 14:04:07 -05:00
Peter Hamilton 48350a4166 Update the payload factories to support new attribute operations
This change updates the request and response payload factories to
add support for the Set, Modify, and DeleteAttribute payloads.
Unit tests have been added to cover the changes.

Partially implements #547
2019-12-13 13:08:44 -05:00
Peter Hamilton 4e59a8a1f0 Add ModifyAttribute support to the server
This change adds ModifyAttribute operation support to the PyKMIP
server, including additional attribute policy functionality to
check for certain attribute characteristics that preclude
ModifyAttribute operation functionality. New unit tests have been
added to cover these changes.

Partially implements #547
2019-12-09 10:27:51 -05:00
Peter Hamilton b4855be2b6 Pin tox to 3.14.1 and more_itertools to 7.2.0
This change pins the upstream tox dependency to version 3.14.1
and the more_itertools dependency to version 7.2.0. The latest
versions of these tools released in late November and early
December 2019 have begun to drop support for Python 3.4, breaking
various test builds on Ubuntu 12.04 LTS (at this time the updates
have only made their way into the upstream packages for this OS).
This will likely soon spread to all other Python 3.4 builds, so for
now, short cut the issue by avoiding newer library releases. Once
PyKMIP drops support for Python 3.4, this change can be undone.
2019-12-09 09:58:02 -05:00
Peter Hamilton 53308c346b Add ModifyAttribute support to the client
This change adds ModifyAttribute support to the ProxyKmipClient,
leveraging the new generic request capability in the underlying
KMIPProxy client. New unit tests have been added to cover the new
client additions.

Partially implements #547
2019-11-27 14:57:47 -05:00
Peter Hamilton 2d283e128c Add SetAttribute support to the client
This change adds SetAttribute support to the ProxyKmipClient,
leveraging the new generic request capability in the underlying
KMIPProxy client. New unit tests have been added to cover the new
client additions.

Partially implements #547
2019-11-22 18:01:23 -05:00
Peter Hamilton 3be219144a Add SetAttribute support to the server
This change adds SetAttribute operation support to the PyKMIP
server, including additional attribute policy functionality to
check for certain attribute characteristics that preclude
SetAttribute operation functionality. Specifically, the operation
cannot set the value of any multivalued attribute nor the value
of any attribute not modifiable by the client. New unit tests
have been added to cover these changes.

Partially implements #547
2019-11-22 16:29:51 -05:00
Peter Hamilton e313731692 Add support for the Sensitive attribute
This change adds support for the Sensitive attribute, adding it to
the attribute factory, the SQLAlchemy object hierarchy, and to the
server attribute handling methods. The intent is to use this new
attribute to test the new SetAttribute and ModifyAttribute
operations coming in future commits. Unit tests have been added
and modified to support the new additions.
2019-11-22 15:08:37 -05:00
Peter Hamilton 4d2d2ba4f1 Add the ModifyAttribute request and response payloads
This change adds support for the ModifyAttribute operation in the
form of request and response payload structures. These will be used
in future updates to the client and server to fully support the
ModifyAttribute operation. A new unit test suite has been added to
cover the new changes.

Partially Implements #547
2019-11-21 12:39:28 -05:00
Peter Hamilton 1bb314d523 Add the SetAttribute request and response payloads
This change adds support for the SetAttribute operation in the
form of request and response payload structures. These will be used
in future updates to the client and server to fully support the
SetAttribute operation. A new unit test suite has been added to
cover the new changes.

Partially Implements #547
2019-11-20 09:41:10 -05:00
Peter Hamilton 072d55a9c3 Add support for the NewAttribute structure
This change adds support for the NewAttribute structure added
in KMIP 2.0. The NewAttribute structure is a basic container
structure that contains a single attribute instance for use by
attribute operations. A new unit test suite has been added to cover
the new additions.

Partially implements #547
2019-11-18 10:12:33 -05:00
Peter Hamilton b045e08ce2 Add DeleteAttribute support to the client
This change adds DeleteAttribute support to the ProxyKmipClient,
leveraging the new generic request capability in the underlying
KMIPProxy client. Going forward all new attribute support will
leverage the new request capability and older supported operations
will be migrated to use it as well, with the ultimate vision
being a final merger of the two client classes into one easy to
use architecture. New unit tests have been added to cover the new
client additions.

Partially implements #547
2019-11-15 17:01:21 -05:00
Peter Hamilton 77d5b32ea4 Add payload base classes to prepare for simplifying the client
This change adds payload request and response base classes to
prepare for future simplification updates to the current client
architecture. No new tests are required for this change.
2019-11-12 17:43:57 -05:00
Peter Hamilton 676aaf5e72 Add DeleteAttribute support to the server
This change adds DeleteAttribute operation support to the PyKMIP
server, supporting functionality unique to KMIP 1.0 - 1.4 and the
newer KMIP 2.0. Due to the current list of attributes supported
by the server, only multivalued attributes can currently be
deleted from a stored KMIP object. Over a dozen unit tests have
been added to verify the functionality of the new additions.

Partially implements #547
2019-11-08 18:36:03 -05:00
Peter Hamilton e48aff7b9a Add the DeleteAttribute request and response payloads
This change adds support for the DeleteAttribute operation in the
form of request and response payload structures. These will be used
in a future updates by the client and server to fully support the
DeleteAttribute operation. A new unit test suite has been added to
cover the new changes.

Partially implements #547
2019-11-01 17:41:56 -04:00
Peter Hamilton 616e683370 Add support for the CurrentAttribute structure
This change adds support for the CurrentAttribute structure added
in KMIP 2.0. The CurrentAttribute structure is a basic container
structure that contains a single attribute instance for use by
attribute operations. A new unit test suite has been added to cover
the new additions.

Partially implements #547
2019-11-01 08:32:49 -04:00
Peter Hamilton cd1079afd5 Add integration tests for Locate using new attributes
This change adds integration tests that verify that objects can
be found by Locate when filtering off of the new ObjectGroup and
ApplicationSpecificInformation attributes. Some minor tweaks to
the database attribute models are included to simplify usage.
2019-10-11 16:45:50 -04:00
Peter Hamilton 009e8cecc9 Add ObjectGroup support to the server
This change ObjectGroup 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-11 09:58:10 -04:00
Peter Hamilton 1b81fff431 Add ObjectGroup to the database model
This change adds a new SQLAlchemy object to the database model
representing the ObjectGroup attribute. The new object is linked
to the base ManagedObject object, allowing ObjectGroup attributes
to be associated with any managed object. 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-10-10 16:33:39 -04:00
Peter Hamilton 89e9b22c34 Update how the ObjectGroup attribute is defined and used
This change updates the attribute factory, replacing the custom
ObjectGroup class with the proper usage of the TextString
primitive. ObjectGroup attribute usage and testing has been
updated across the library to reflect this change.
2019-10-07 13:52:17 -04:00