Secrets created via Asymmetric Order do not have a content_type

Bug #1383930 reported by Douglas Mendizábal
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Low
Adam Harwell

Bug Description

When an Order of type "asymmetric" is submitted, the resulting Secrets do not have content_types attributes in their metadata. This produces inconsistent responses when listing secrets, and also affects client functionality that expects content_types to be available.

Steps to recreate:

POST v1/orders

{
  "type": "asymmetric",
  "meta": {
    "name": "secretname",
    "algorithm": "RSA",
    "bit_length": 2048,
    "expiration": "2015-02-28T19:14:44.180394",
    "payload_content_type": "application/octet-stream"
  }
}

GET v1/secrets

{
    "secrets": [
        ... SNIP ...
        {
            "status": "ACTIVE",
            "secret_ref": "http://localhost:9311/v1/secrets/a2292306-6da0-4f60-bd8a-84fc8d692716",
            "updated": "2014-10-21T17:15:50.863680",
            "name": "secretname",
            "algorithm": "aes",
            "created": "2014-10-21T17:15:50.852563",
            "content_types": {
                "default": "application/octet-stream"
            },
            "mode": "cbc",
            "bit_length": 256,
            "expiration": "2015-02-28T19:14:44.180394"
        },
        {
            "status": "ACTIVE",
            "updated": "2014-10-21T17:16:35.334273",
            "name": "secretname",
            "algorithm": "RSA",
            "created": "2014-10-21T17:16:35.314332",
            "secret_ref": "http://localhost:9311/v1/secrets/e8f0c101-bc45-4aa8-aac6-dfdb80633f71",
            "mode": null,
            "bit_length": 2048,
            "expiration": "2015-02-28T19:14:44.180394"
        },
        {
            "status": "ACTIVE",
            "updated": "2014-10-21T17:16:35.338193",
            "name": "secretname",
            "algorithm": "RSA",
            "created": "2014-10-21T17:16:35.329184",
            "secret_ref": "http://localhost:9311/v1/secrets/63bf7774-8fa8-48fc-9cd4-d0d66e355128",
            "mode": null,
            "bit_length": 2048,
            "expiration": "2015-02-28T19:14:44.180394"
        }
    ],
    "total": 5
}

Note how the bottom two secrets do not have "content_types"

Tags: verified
Changed in barbican:
status: New → Confirmed
Changed in barbican:
importance: Undecided → Low
tags: added: verified
Changed in barbican:
assignee: nobody → Adam Harwell (adam-harwell)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to barbican (master)

Fix proposed to branch: master
Review: https://review.openstack.org/142895

Changed in barbican:
status: Confirmed → In Progress
Changed in barbican:
status: In Progress → Fix Committed
Revision history for this message
Adam Harwell (adam-harwell) wrote :

Leaving the workflow alone from now on, letting Gerrit handle it.

Changed in barbican:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to barbican (master)

Reviewed: https://review.openstack.org/142895
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=8399b28d5492600be07ad0dc46a6b04cf5c838b5
Submitter: Jenkins
Branch: master

commit 8399b28d5492600be07ad0dc46a6b04cf5c838b5
Author: Adam Harwell <email address hidden>
Date: Thu Dec 18 11:59:10 2014 -0800

    Fix content_type loading to be consistent

    Store content_type alongside secret data for HSM-style plugins, but
    attempt to load content_type from secret_metadata to support other types
    of secret store plugins.

    Change-Id: I480f1c1c2d9b923a6858ebfcc380779b41689312
    Closes-Bug: 1383930

Changed in barbican:
status: In Progress → Fix Committed
Changed in barbican:
milestone: none → kilo-2
Thierry Carrez (ttx)
Changed in barbican:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in barbican:
milestone: kilo-2 → 2015.1.0
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.