Merge "Adds secrets_retrieve to the list of available actions in barbican"
This commit is contained in:
commit
2c7056b709
@ -609,7 +609,8 @@ class BarbicanAction(base.OpenStackAction):
|
||||
|
||||
@classmethod
|
||||
def _get_client_method(cls, client):
|
||||
if cls.client_method_name != "secrets_store":
|
||||
if cls.client_method_name not in ["secrets_store",
|
||||
"secrets_retrieve"]:
|
||||
return super(BarbicanAction, cls)._get_client_method(client)
|
||||
|
||||
method = getattr(cls, cls.client_method_name)
|
||||
@ -635,8 +636,8 @@ class BarbicanAction(base.OpenStackAction):
|
||||
mode=None, expiration=None):
|
||||
"""Create and Store a secret in Barbican.
|
||||
|
||||
:param client: the Zaqar client
|
||||
:type client: zaqarclient.queues.client
|
||||
:param client: the Barbican client
|
||||
:type client: barbicanclient.client
|
||||
|
||||
:param name: A friendly name for the Secret
|
||||
:type name: string
|
||||
@ -677,6 +678,19 @@ class BarbicanAction(base.OpenStackAction):
|
||||
|
||||
return entity._get_formatted_entity()
|
||||
|
||||
@staticmethod
|
||||
def secrets_retrieve(client, secret_ref):
|
||||
"""Retrieve the payload from a secret in Barbican.
|
||||
|
||||
:param client: the Barbican client
|
||||
:type client: barbicanclient.client
|
||||
|
||||
:param secret_ref: Full HATEOAS reference to a Secret
|
||||
:type name: string
|
||||
"""
|
||||
|
||||
return client.secrets.get(secret_ref).payload
|
||||
|
||||
|
||||
class DesignateAction(base.OpenStackAction):
|
||||
_service_type = 'dns'
|
||||
|
@ -1000,7 +1000,8 @@
|
||||
"secrets_delete": "secrets.delete",
|
||||
"secrets_get": "secrets.get",
|
||||
"secrets_list": "secrets.list",
|
||||
"secrets_total": "secrets.total"
|
||||
"secrets_total": "secrets.total",
|
||||
"secrets_retrieve": "secrets_retrieve"
|
||||
},
|
||||
"mistral": {
|
||||
"_comment": "It uses mistralclient.v2.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user