create secret - content type should be case insensitive

Bug #1252453 reported by Steve Heyman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Low
Sig Sigler

Bug Description

Found in: dev

Description: Running create secret tests with content type of TEXT/plain. Should succeed as RFC 1341 specifically mentions that type and subtype are not case sensive - see http://www.w3.org/Protocols/rfc1341/4_Content-Type.html

Test Case: test_creating_secret_normalize_content_type_text_caps_plain

Reproduction Steps:

1) create a secret with a content type of 'TEXT/plain'

   POST http://.../v1/{tenant_id}/secrets

Request:
<Secret object>
name = None
algorithm = None
payload_content_type = TEXT/plain
payload_content_encoding = None
content_types = None
expiration = None
bit_length = None
payload = testdata
mode = None

Actual Response:
http 400 error
{
    "title": "Provided object does not match schema 'Secret': u'TEXT/plain' is not one of ['text/plain', 'text/plain;charset=utf-8', 'text/plain; charset=utf-8', 'application/octet-stream']\n\nFailed validating 'enum' in schema['properties']['payload_content_type']:\n {'enum': ['text/plain',\n 'text/plain;charset=utf-8',\n 'text/plain; charset=utf-8',\n 'application/octet-stream'],\n 'type': 'string'}\n\nOn instance['payload_content_type']:\n u'TEXT/plain, charset=utf-8'"
}

Expected Response:
http 201 (successful creation)

Steve Heyman (sheyman)
Changed in barbican:
status: New → Confirmed
John Wood (john-wood-w)
Changed in barbican:
milestone: none → icehouse-3
importance: Undecided → Low
Changed in barbican:
assignee: nobody → Aleksandra Bezborodova (bezborodovaam)
John Wood (john-wood-w)
Changed in barbican:
milestone: icehouse-3 → icehouse
Changed in barbican:
assignee: Aleksandra Bezborodova (bezborodovaam) → Sig Sigler (roysigler)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to barbican (master)

Reviewed: https://review.openstack.org/79154
Committed: https://git.openstack.org/cgit/stackforge/barbican/commit/?id=dbcc1d9408851b58109780dcaa4cd24fb4ce003a
Submitter: Jenkins
Branch: master

commit dbcc1d9408851b58109780dcaa4cd24fb4ce003a
Author: Sig Sigler <email address hidden>
Date: Sat Mar 8 09:11:52 2014 -0600

    Create secret - case insensitive Content-Type check

    Allows for upper case and mixed case types, subtypes, and parameters
    in the Content-Type header field as per RFC 1341. More details can
    be found at http://www.w3.org/Protocols/rfc1341/4_Content-Type.html.

    Closes-Bug: #1252453
    Change-Id: I400a05593e0c622de93a47a0fe0394793eb777f1

Changed in barbican:
status: Confirmed → Fix Committed
Changed in barbican:
status: Fix Committed → Fix Released
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.