mirror of
https://github.com/openkmip/pykmip
synced 2025-12-14 23:33:19 +00:00
Adding support for the InitialDate attribute
This change updates the server and managed object set to support the InitialDate attribute. The InitialDate is set when the Create, CreateKeyPair, and Register operations are invoked and can be listed and retrieved with the GetAttributeList and GetAttributes operations respectively. The server unit tests have been updated to reflect these changes.
This commit is contained in:
@@ -737,7 +737,7 @@ class KmipEngine(object):
|
||||
elif attr_name == 'State':
|
||||
return managed_object.state
|
||||
elif attr_name == 'Initial Date':
|
||||
return None
|
||||
return managed_object.initial_date
|
||||
elif attr_name == 'Activation Date':
|
||||
return None
|
||||
elif attr_name == 'Process Start Date':
|
||||
@@ -997,6 +997,7 @@ class KmipEngine(object):
|
||||
|
||||
# TODO (peterhamilton) Set additional server-only attributes.
|
||||
managed_object._owner = self._client_identity
|
||||
managed_object.initial_date = int(time.time())
|
||||
|
||||
self._data_session.add(managed_object)
|
||||
|
||||
@@ -1164,7 +1165,9 @@ class KmipEngine(object):
|
||||
|
||||
# TODO (peterhamilton) Set additional server-only attributes.
|
||||
public_key._owner = self._client_identity
|
||||
public_key.initial_date = int(time.time())
|
||||
private_key._owner = self._client_identity
|
||||
private_key.initial_date = public_key.initial_date
|
||||
|
||||
self._data_session.add(public_key)
|
||||
self._data_session.add(private_key)
|
||||
@@ -1239,6 +1242,7 @@ class KmipEngine(object):
|
||||
|
||||
# TODO (peterhamilton) Set additional server-only attributes.
|
||||
managed_object._owner = self._client_identity
|
||||
managed_object.initial_date = int(time.time())
|
||||
|
||||
self._data_session.add(managed_object)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user