Commit Graph

237 Commits

Author SHA1 Message Date
Jonathan Seawright 10030cd173 Fix pep8 errors 2016-12-05 13:29:09 -06:00
Jonathan Seawright 7b25780a4e Created test suite for `attribute_factory`
Resolves CR changes for #208
2016-12-05 13:14:22 -06:00
Jonathan Seawright 9ba479e4d3 Add optional 'name' argument to create and create_key_pair functions
The ProxyKmipClient now allows you to optionally provide a name
when performing a `Create` or a `Create Key Pair`. If not specified,
the name is excluded from the request.

 * For `create`, users specify `name`
 * For `create_key_pair`, users specify `private_name` and `public_name`

Resolves #208
2016-12-03 21:37:35 -06:00
Peter Hamilton 94aacc1897 Fixes premature server shutdown on receiving invalid certificate
This change fixes a bug with the server where the server would
prematurely shutdown upon receiving a client connection using an
invalid certificate. The server will now withstand bad client
connections. The impacted server unit tests have been updated to
reflect the bug fix.
2016-12-01 14:40:30 -05:00
Peter Hamilton 38e7635fc7 Fixes configuration settings override by default script values
This change fixes a bug with parameter handling when invoking
the server's main routine. The default values provided for the
parameters would override any configuration file settings if
the main routine was used to run the server. To fix this, the
default values were removed, requiring the user to explicitly
specify parameter values if they want them to override the
configuration settings. The parameter doc strings have been
updated to match these changes.

Fixes #217
2016-12-01 11:44:43 -05:00
Peter Hamilton 181b34b6cb Updating payload factories to reflect new KMIP operations
This change updates the payload factories, adding placeholder
support for operations added in KMIP 1.3. It also updates old
placeholders with now supported payloads. The corresponding
unit test suites have been updated to match the additions.
2016-11-29 15:42:05 -05:00
Peter Hamilton 381e072bb7 Updating the server to allow optional policy_path values
This change updates the server, updating how it processes config
values and allowing it to handle optional or ommitted policy_path
values. This fixes a bug where users could not leave the
policy_path config file unset, in addition to a bug that forced
users to use '/etc/pykmip/policies' as their policy directory.

Fixes #210
2016-11-28 13:49:19 -05:00
Peter Hamilton 0b69a0ac17 Adding payloads for the GetAttributes operation
This change adds the request and response payloads needed for the
GetAttributes operation. Test cases included.
2016-11-27 12:33:33 -05:00
Peter Hamilton b36c730f22 Adding string utilites to the Attribute object
This change adds str and repr utilities to the Attribute object. A
new test suite for Attribute object tests is included, however only
the tests for the string utilities are included with this patch.
The remaining Attribute tests will be implemented in a later patch.
2016-11-27 12:21:11 -05:00
Peter Hamilton a55310368f Updating the ApplicationSpecificInformation attribute
This change adds some utility methods, including equality operators
and string methods, to the ApplicationSpecificInformation attribute.
Unit tests covering the changes are included.
2016-11-27 11:23:11 -05:00
Peter Hamilton 23f6a05a54 Fixing minor pep8 whitespace error in test utilities 2016-11-17 15:09:21 -05:00
Peter Hamilton b7cc542d9a Adding server support for the Activate operation
This change adds support for the Activate operation to the server,
including additional server unit tests, a new IllegalOperation
exception, and updated state attribute support in Pie objects.

Fixes #186
2016-11-12 16:37:20 -05:00
Peter Hamilton aae1577e3c Fixing potential undefined variable error in client open
This change reorganizes some of the error handling code in the
client open routine, preventing the generation of an undefined
variable error. The net effect of the client open routine is
unchanged.

Fixes #199
2016-11-11 14:49:07 -05:00
Peter Hamilton 78f16e208a Fixing a client socket shutdown bug when unconnected
This change fixes a minor bug with the client shutdown routine,
where an error would get thrown when attempting to call shutdown
on an unconnected socket. This error is now caught and suppressed,
since the client is already shutting down. A new client unit test
is included to cover this change.
2016-11-11 12:51:39 -05:00
Peter Hamilton a9264e612f Merge pull request #198 from OpenKMIP/feat/add-operation-policy-loading
Adding dynamic operation policy loading to the KMIP server
2016-11-10 10:48:59 -05:00
Peter Hamilton 4a3769e113 Adding dynamic operation policy loading to the KMIP server
This change adds support for dynamic operation policy loading.
The server config file now supports a 'policy_path' option that
points to a filesystem directory. Each file in the directory
should contain a JSON policy object. The KMIP server will scan
this directory and attempt to load all valid policies it finds.
The results of this process will be logged.
2016-11-10 10:39:16 -05:00
Peter Hamilton 799891ea6b Merge pull request #197 from OpenKMIP/feat/add-object-ownership
Adding operation policy enforcement to the KMIP server engine
2016-10-20 12:28:27 -04:00
Peter Hamilton e0b0a5c7bf Adding operation policy enforcement to the KMIP server engine
This change adds enforcement of KMIP operation policies to the
server engine, specifically to the Get and Destroy operations.
Explicit object ownership is enforced as a result, with ownership
now a tracked internal server property of managed objects. Tests
for this new functionality are included.
2016-10-14 12:59:12 -04:00
Peter Hamilton 4d6ba8a964 Add server persistence for operation policy names
This change updates the KMIP engine to process and persist the
value of the operation policy name attribute when creating or
registering new managed objects. Tests are included for these
changes.
2016-10-06 09:36:19 -04:00
Peter Hamilton 894a7ac97d Adding operation policy name support to the client
This change adds operation policy name support to the pie client,
allowing you to optionally specify the policy name when creating
new symmetric keys and asymmetric key pairs. The operation policy
name can also be set on any pie object and will be sent with the
corresponding register request for new objects. Tests for these
additions are included.
2016-10-05 15:33:06 -04:00
Peter Hamilton bcb5e7d948 Merge pull request #192 from OpenKMIP/feat/add-client-cert-auth
Adding session extraction of client identity from certificates
2016-10-04 14:55:14 -04:00
Peter Hamilton 91606db711 Fixing server failure on missing request credential
This change fixes a bug in the KMIP server engine where a missing
request credential would cause the session to prematurely
terminate. Credential handling may require session termination
for missing credentials, but that decision should be made by
credential processing not request processing.

Fixes #193
2016-10-03 11:10:42 -04:00
Peter Hamilton 8fd6349152 Adding session extraction of client identity from certificates
This change updates the KmipSession, allowing it to extract client
identity from the client certificate of a TLS connection. The
certificate subject common name is used as the client identity if
the certificate has client authentication set in the extended key
usage extension.

This change breaks backwards compatibility. If a client certificate
does not define a client identity, the session will reject it and
shutdown the connection. Any client certificates used to connect
with the software server in the past will need to be replaced with
certificates that define a suitable client identity.
2016-09-13 15:30:08 -04:00
Peter Hamilton 765df8340a Adding default KMIP operation policies
This change adds enumerations and policy objects to support the
specification and enforcement of KMIP operation policies. A new
module, kmip.core.policy, is added to define the default policy
objects required by the KMIP specification.
2016-09-09 14:45:34 -04:00
Peter Hamilton f122f19621 Updating KMIP enumerations to support KMIP 1.2
This change updates the set of supported enumerations to include
all enumerations included in KMIP 1.2. Existing enumerations are
updated where required.
2016-08-30 14:34:16 -04:00
Peter Hamilton 65ad4c6111 Adding support for the State attribute
This change adds the State attribute, updating the attribute
factory to support creating it.
2016-08-27 17:13:47 -04:00
Peter Hamilton a8e1854953 Adding the State enumeration
This change adds the State enumeration to the enumerations set.
2016-08-27 16:39:42 -04:00
Peter Hamilton 35fb5c0c9b Merge pull request #163 from OpenKMIP/ver/prep-release-0-5-0
PyKMIP - Release 0.5.0
2016-04-14 08:06:16 -04:00
Peter 600479fd7c PyKMIP - Release 0.5.0
This update includes a new implementation of the PyKMIP software server,
in addition to other minor features and bug fixes:
* Add KmipServer server implementation
* Add KmipSession to manage threaded client/server connections
* Add KmipEngine for processing core server application logic
* Add KmipEngine support for CRUD operations for managed objects
* Add SQLAlchemy/SQLite support for KmipEngine data storage
* Add CryptographyEngine component for all cryptographic operations
* Add pending deprecation warning for Python 2.6 support
* Add pending deprecation warning for the KMIPServer implementation
* Add support for building Sphinx documentation
* Add support for SQLAlchemy tables to all Pie objects
* Add Python magic methods to Attribute and Name objects
* Add Attribute class unit tests
* Add bin script to run the KmipServer
* Add setup entry points to run the KmipServer
* Update DiscoverVersions demo with optional versions argument
* Update all demo scripts to setup their own logging infrastructure
* Update README with information on the KmipServer implementation
* Remove expired certificate files from the integration test suite
* Remove default package log configuration and configuration file
* Fix bug with Locate payload parsing optional values
* Fix bug with DateTime string tests and move to UTC representation
2016-04-14 07:58:09 -04:00
Nathan Reller 7096ed63f3 Added KMIP Server Entry Point
Added console_scripts to setup.py, and added an entry for
pykmip-server. The pykmip-server application will run the PyKMIP
server. The two command line options below will run the server.

python -m kmip.services.server.server
pykmip-server
2016-04-11 10:27:57 -04:00
Peter Hamilton 7c57416249 Merge pull request #162 from OpenKMIP/maint/add-server-logging
Updating the KmipEngine logging for operation handling
2016-04-07 11:05:39 -04:00
Peter 477669f620 Updating the KmipEngine logging for operation handling
This change adds some additional logging statements when processing
individual KMIP operations, providing additional information on
operation input and output. The associated tests have been updated
accordingly.
2016-04-07 10:04:33 -04:00
Peter 80d56453a5 Fixing bug with primary key reuse by SQLAlchemy
This change fixes a bug with the Pie object table definitions used by
SQLAlchemy to store managed objects and attributes for the PyKMIP
software server. While primary keys are specified for all tables, they
do not by default auto-increment with SQLAlchemy/SQLite, causing
collisions and uniqueness constraint violations when bulk testing with
the server. Add an explicit SQLite auto-increment tag to each table
prevents this from happening.
2016-04-07 09:46:01 -04:00
Peter Hamilton 6080a72084 Merge pull request #151 from viktorTarasov/fix/messages/error-response-without-operation
core messages: response batch item without 'operation'
2016-04-05 14:36:52 -04:00
Peter Hamilton 0ed92a1ea4 Merge pull request #150 from viktorTarasov/fix/service-client/batch-item-of-error-response
fix: kmip-client: batch item of error response
2016-04-05 14:28:34 -04:00
Peter Hamilton 9362abbce5 Merge pull request #156 from OpenKMIP/maint/remove-library-logging
Removing default log configuration and usage
2016-04-05 14:11:08 -04:00
Peter Hamilton b152941b68 Merge pull request #159 from OpenKMIP/bug/fix-early-close
Fixing bug terminating connection prematurely
2016-04-05 14:09:41 -04:00
Peter Hamilton 21b4731118 Merge pull request #160 from OpenKMIP/feat/use-file-based-backend
Fixing bug with in-memory SQLite storage
2016-04-05 14:07:49 -04:00
Peter 7374bcda25 Fixing bug with DateTime str test
An issue with local daylight savings time causes a comparison error in
some locales when checking against a hard-coded expected time string.
The DateTime primitive string representation has been updated to output
only UTC time strings.

Fixes #124
2016-04-05 14:00:14 -04:00
Peter Hamilton 0f7157536b Merge pull request #158 from OpenKMIP/maint/remove-old-certs
Removing out-of-date certificate files
2016-04-05 12:12:52 -04:00
Peter 4bc27425be Removing default log configuration and usage
This change removes the use of default logging settings in
kmip.__init__.py as well as the bundled logconfig.ini file. Logging
settings should be set by applications, not by underlying software
libraries. All demos have been updated to set their own logging
settings and to log at appropriate levels.
2016-04-05 11:49:27 -04:00
Peter 9a994637d9 Fixing bug with in-memory SQLite storage
This change swaps out the in-memory SQLite database for file-based data
storage. SQLAlchemy support for in-memory SQLite storage does not work
across threads. The new storage scheme stores all PyKMIP server data in
/tmp.
2016-04-05 09:57:50 -04:00
Peter b2714002b6 Fixing bug terminating connection prematurely
This change fixes a bug with the KmipSession connection handling logic
that would terminate the connection before actually receiving a
termination from the client. The corresponding unit tests have been
updated to reflect this fix.
2016-04-05 08:58:40 -04:00
Peter Hamilton 77f1b1223c Merge pull request #155 from OpenKMIP/maint/add-server-deprecate
Adding a pending deprecation warning to old server
2016-04-04 15:58:54 -04:00
Peter ec83ff6abe Removing out-of-date certificate files
This change removes the testing certificate files. They are expired.
2016-04-04 13:48:10 -04:00
Peter edf4e4dcc9 Integrating the KmipEngine with the KmipSession
This change adds KmipEngine support to the KmipSession. The session will
now pass on received requests for processing by the engine, handling any
results or errors that occur. The KmipSession test suite has been
updated to reflect this change.
2016-04-04 10:48:53 -04:00
Peter e01a9142e5 Linking the loggers for the different KmipServer components
This change renames the loggers for different KmipServer components,
ensuring that all server logs are processed by the same kmip.server
logger.
2016-04-04 10:39:06 -04:00
Peter ab17f672ce Adding a pending deprecation warning to old server
This change adds a simple warning that is triggered whenever the
KMIPServer class is instantiated. It advises the user to use the newer
KmipServer class. The KMIPServer will be removed in a future version of
PyKMIP.
2016-03-31 10:47:11 -04:00
Peter 702ba77715 Adding the KmipServer
This change adds the KmipServer, the front-end of the KMIP software
server. The KmipServer is in charge of loading configuration settings,
creating all major server components, and serving and managing client
connections. A KmipServerConfig tool is included to handle configuration
settings. Test cases for all new code are included.
2016-03-30 16:55:44 -04:00
Peter 934fc7b93e Adding KmipEngine support for CreateKeyPair
This change adds support for the CreateKeyPair operation to the
KmipEngine. New exceptions and test cases are included.
2016-03-29 08:09:29 -04:00