2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-21 10:43:15 +00:00

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.
This commit is contained in:
Peter Hamilton
2016-10-05 15:30:35 -04:00
parent bcb5e7d948
commit 894a7ac97d
3 changed files with 174 additions and 12 deletions

View File

@@ -52,6 +52,11 @@ class ManagedObject(sql.Base):
_names = relationship('ManagedObjectName', back_populates='mo',
cascade='all, delete-orphan')
names = association_proxy('_names', 'name')
operation_policy_name = Column(
'operation_policy_name',
String(50),
default='default'
)
__mapper_args__ = {
'polymorphic_identity': 'ManagedObject',
@@ -71,6 +76,7 @@ class ManagedObject(sql.Base):
self.unique_identifier = None
self.name_index = 0
self.names = list()
self.operation_policy_name = None
self._object_type = None
# All remaining attributes are not considered part of the public API
@@ -78,7 +84,6 @@ class ManagedObject(sql.Base):
self._application_specific_informations = list()
self._contact_information = None
self._object_groups = list()
self._operation_policy_name = None
# The following attributes are placeholders for attributes that are
# unsupported by kmip.core