Attempting to get a text/plain secret from a created order should return a 406

Bug #1220957 reported by John Vrbanac on 2013-09-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
High
Bryan D. Payne

Bug Description

When we attempt to get the plain/text secret payload from a freshly created order we get a 500 internal server error.

Steps to replicate:

1) Create an order:
Request:
{
  "secret": {
    "name": "secretname",
    "algorithm": "aes",
    "payload_content_type": "application/octet-stream",
    "payload_content_encoding": "base64",
    "mode": "cbc",
    "bit_length": 256
  }
}

2) Get the order:
Response:
{
  "status": "ACTIVE",
  "secret_ref": "http://{host}/v1/test_tenant/secrets/6bcbd214-b1c6-4ce9-9a72-3d5f6b9d9944",
  "updated": "2013-09-04T23:27:23.821235",
  "created": "2013-09-04T23:27:23.787184",
  "secret": {
    "name": "secretname",
    "algorithm": "aes",
    "payload_content_type": "application/octet-stream",
    "expiration": null,
    "bit_length": 256,
    "mode": "cbc"
  },
  "order_ref": "http://{host}/v1/test_tenant/orders/28c46a3d-39ed-4fde-acd8-4fae08545863"
}

3) Get Secret:
Request:
GET '/v1/test_tenant/secrets/6bcbd214-b1c6-4ce9-9a72-3d5f6b9d9944'
Headers:
    'Content-Type': 'application/json',
    'Accept': 'text/plain',
    'User-Agent': 'python-requests/1.2.0 CPython/2.7.4 Linux/3.8.0-29-generic'

Expected Response: 406
Actual Response: 500

John Wood (john-wood-w) on 2013-10-17
Changed in cloudkeep:
importance: Undecided → High
milestone: none → havana
assignee: nobody → John Wood (john-wood-w)
assignee: John Wood (john-wood-w) → nobody
Bryan D. Payne (bdpayne) wrote :

I have a fix working for this. I'll polish it up with tests and such and submit a PR early next week.

Changed in cloudkeep:
assignee: nobody → Bryan D. Payne (bdpayne)
Changed in cloudkeep:
status: New → Fix Committed
John Vrbanac (john.vrbanac) wrote :

Automated test under: test_getting_secret_data_as_plain_text
Verified as fixed in: 0905323ccdf4a5880e6db36bb4ab5997c54085d8

tags: added: verified
Changed in barbican:
milestone: havana → icehouse-1
Changed in barbican:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers