Orders post returns misleading error message

Bug #1482009 reported by Pradeep Kumar Singh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Medium
Pradeep Kumar Singh

Bug Description

curl -X POST http://localhost:9311/v1/orders/ -H 'X-Auth-Token:e0c5397774db42308c1f1a39290a41bd' -H 'content-type:application/json' -d '{"type":"key", "meta":{"algorithm": "AES"}}'
{"code": 400, "description": "Provided field value is not supported", "title": "Bad Request"}

bit_length is a required field in meta. So, this command should fail, but the returned message is misleading.

It should say "required field missing", not "provided field value not supported".

information type: Private Security → Public
Changed in barbican:
assignee: nobody → Pradeep Kumar Singh (pradeep-singh-u)
Revision history for this message
Dave McCowan (dave-mccowan) wrote :

bit_length is a required field in meta. So, this command should fail, but the returned message is wrong.
It should say "required field missing", not "providing field value no supported".

summary: - Orders post returns invalid error
+ Orders post returns misleading error message
description: updated
Changed in barbican:
status: New → Confirmed
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/235115

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

Reviewed: https://review.openstack.org/235115
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=96edecca111b29740cabc6d00a6563806fa1bc7d
Submitter: Jenkins
Branch: master

commit 96edecca111b29740cabc6d00a6563806fa1bc7d
Author: Pradeep Kumar Singh <email address hidden>
Date: Thu Oct 15 12:22:40 2015 +0530

    Correct the returned message when bit_length is absent

    bit_length is a required field in meta. So order creation
    should fail when bit_length is missing.This fix corrects
    the returned message.
    Before_fix:
    stack@devstack:~$ curl -X POST http://localhost:9311/v1/orders/ -H
    'X-Auth-Token:5c5b375d974d4391afb51c63b2ffa6dc'
    -H 'content-type:application/json'
    -d '{"type":"key", "meta":{"algorithm": "AES"}}';echo
    {"code": 400, "description": "Provided field value is not supported",
    "title": "Bad Request"}
    After_fix:
    stack@devstack:~$ curl -X POST http://localhost:9311/v1/orders/ -H
    'X-Auth-Token:5c5b375d974d4391afb51c63b2ffa6dc'
    -H 'content-type:application/json'
    -d '{"type":"key", "meta":{"algorithm": "AES"}}';echo
    {"code": 400, "description": "Provided object does not match schema
     'Order': 'bit_length' is required field for key type order.
    Invalid property: 'meta'", "title": "Bad Request"}
    Closes-Bug: #1482009

    Change-Id: Id8c67d00d19768e7479a2e548436dc9e71f0e5cc

Changed in barbican:
status: In Progress → Fix Committed
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/barbican 2.0.0.0b1

This issue was fixed in the openstack/barbican 2.0.0.0b1 development milestone.

Changed in barbican:
status: Fix Committed → Fix Released
Changed in barbican:
milestone: none → mitaka-1
importance: Undecided → Medium
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.