Some params should be necessary when we use "barbican secret store" command

Bug #1602984 reported by Jeremy Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-barbicanclient
Invalid
Undecided
Unassigned

Bug Description

When you store a secret without payload, and then try to retrieve that secret's payload, you will get
raise StorePluginNotAvailableOrMisconfigured(plugin_name)
StorePluginNotAvailableOrMisconfigured: The requested Store Plugin None is not currently available. This is probably a server misconfiguration.

Which is misleading exception and it needs to report proper error/info message, clearly telling user that the "payload is not found" or "No Payload present"

steps to reproduce the issue
1. barbican secret store
2. barbican secret get <Secret_href>
3. barbican secret get <Secret_href> --payload

Get the following trace
Traceback (most recent call last):
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/api/controllers/__init__.py", line 103, in handler
    return fn(inst, *args, **kwargs)
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/api/controllers/__init__.py", line 89, in enforcer
    return fn(inst, *args, **kwargs)
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/api/controllers/secrets.py", line 184, in payload
    **kwargs
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/api/controllers/secrets.py", line 162, in _on_get_secret_payload
    transport_key)
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/plugin/resources.py", line 132, in get_secret
    secret_metadata.get('plugin_name'))
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/plugin/interface/secret_store.py", line 489, in _check_plugins_configured
    return plugin_related_function(self, *args, **kwargs)
  File "/opt/stack/service/barbican-api-20160520T213237Z/venv/lib/python2.7/site-packages/barbican/plugin/interface/secret_store.py", line 557, in get_plugin_retrieve_delete
    raise StorePluginNotAvailableOrMisconfigured(plugin_name)
StorePluginNotAvailableOrMisconfigured: The requested Store Plugin None is not currently available. This is probably a server misconfiguration.

Actually, if we use "barbican secret store" command without providing a "payload", that doesn't make any sense.
So I'm going to make the "payload" param necessary when we use "barbican secret store" command.

Jeremy Liu (liujiong)
description: updated
Jeremy Liu (liujiong)
Changed in python-barbicanclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.