refactor barbican controllers to match pecan recommended approach

Bug #1334872 reported by Venkat Sundaram
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Medium
Juan Antonio Osorio Robles

Bug Description

CR #1326054 was opened for the issue where Barbican would default to HTTP GET handler if there is no handler for the method specified in the request. The correct action is to return a "HTTP 405 Method Not Allowed" response with a "Allow" header listing the allowed methods.

A fix was proposed for this CR (https://review.openstack.org/#/c/100814/) but reviews on it resulted in opening a CR with Pecan(https://review.openstack.org/#/c/102839/).
The Pecan fix helps to automatically build the 'Allow' response header to be returned along with the HTTP 405 error response.

However, for this fix to work, the Barbican Pecan controllers has to be written in a manner recommended here: http://screens.objects.dreamhost.com/06-23-2014-17-45-31.png

All Barbican controllers currently use the generic "index" method as the HTTP GET handler. These controllers need to be refactored such that the GET handler code has to be moved from the "index" method to a separate "do_get" method.

Also, the requirements.txt has to be updated to use the correct version of pecan library that includes the fix for the 'Allow' header.

Tags: verified
Venkat Sundaram (tsv)
description: updated
description: updated
Revision history for this message
Ryan Petrello (ryan-petrello) wrote :

I'll be releasing the new version of pecan in the next week, so you all will need to pin pecan >= 0.6.0 in the fix for this bug.

Steve Heyman (sheyman)
Changed in barbican:
status: New → Confirmed
importance: Undecided → Medium
Changed in barbican:
milestone: none → juno-3
Changed in barbican:
milestone: juno-3 → juno-rc1
Changed in barbican:
milestone: juno-rc1 → kilo-1
Changed in barbican:
milestone: kilo-1 → none
Revision history for this message
Juan Antonio Osorio Robles (juan-osorio-robles) wrote :
Revision history for this message
John Vrbanac (john.vrbanac) wrote :

Juan, I believe that image was a suggestion from Ryan on a way to construct the controllers.

tags: added: verified
Changed in barbican:
assignee: nobody → Juan Antonio Osorio Robles (juan-osorio-robles)
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/144743

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/144743
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=d0949ae360f71002bd06045c64218572df41ec02
Submitter: Jenkins
Branch: master

commit d0949ae360f71002bd06045c64218572df41ec02
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Fri Jan 2 14:47:04 2015 +0200

    Make default action return 405 in the controllers

    Now the default action that controllers will take is HTTP 405 (Not
    Allowed) as stated in the pecan's recommended approach. This means
    that there is now a separate method in the controllers that
    specifically handles HTTP GET.

    Change-Id: Ib9291d4d4216f577e3f7af0fda5fa6dfe2f53cab
    Closes-bug: #1334872

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.