500 Error instead of 400 Bad Request when barbican secret get payload with missing payload_content_type
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Barbican |
Fix Released
|
Undecided
|
Jeremy Liu |
Bug Description
Barbican get secret payload call returns 500 internal server error when payload content type is missing. Client defaults to text/plain and in that case, server fails if initially stored secret content type is application/
Server code already generates 'SecretAcceptNo
Here is the sample for this error.
barbican secret store --payload 'gF6+lLoF3ohA9a
+------
| Field | Value |
+------
| Secret href | https:/
| Name | None |
| Created | 2016-05-27 20:18:27+00:00 |
| Status | ACTIVE |
| Content types | {u'default': u'application/
| Algorithm | aes |
| Bit length | 256 |
| Secret type | opaque |
| Mode | cbc |
| Expiration | None |
+------
barbican secret get https:/
gF6+lLoF3ohA9aP
Now with missing payload_
barbican secret get https:/
5xx Server error: Internal Server Error
Internal Server Error
Log:
2016-05-27 20:22:55,948 - barbican.
Traceback (most recent call last):
File "/opt/stack/
return fn(inst, *args, **kwargs)
File "/opt/stack/
return fn(inst, *args, **kwargs)
File "/opt/stack/
**kwargs
File "/opt/stack/
transport_key)
File "/opt/stack/
requesting_
File "/opt/stack/
raise s.SecretAcceptN
SecretAcceptNot
192.168.245.9:9311 - [27/May/
Changed in barbican: | |
assignee: | nobody → liujiong (liujiong) |
Fix proposed to branch: master /review. openstack. org/328716
Review: https:/