Public API doesn't work after appending json/xml extension to the URI

Bug #1251880 reported by Vitalii Lebedynskyi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Roman Prykhodchenko

Bug Description

Public API specification specifies several public endpoints using strings.
Need to change those specs to regular expressions in order to be able to append json/xml extensions to the URI to change output format.

Tags: api
Changed in ironic:
importance: Undecided → Medium
assignee: nobody → Roman Prykhodchenko (romcheg)
Revision history for this message
aeva black (tenbrae) wrote :

Vetal or Roman, could you provide some more detail on this bug? Perhaps an example of what URI is causing an error and what the error is?

Changed in ironic:
status: New → Incomplete
importance: Medium → Undecided
Revision history for this message
Roman Prykhodchenko (romcheg) wrote :

This url works /v1 as public:
These ones require authentication: /v1.json and /v1.xml

Revision history for this message
aeva black (tenbrae) wrote :

Once I changed auth_strategy=keystone in /etc/ironic/ironic.conf, then I was able to confirm this .....

$ curl http://192.0.2.2:6385/v1.json
Authentication required

$ curl http://192.0.2.2:6385/v1.xml
Authentication required

$ curl http://192.0.2.2:6385/v1
{"media_types": [{"base": "application/json", "type": "application/vnd.openstack.ironic.v1+json"}], "links": [{"href": "http://192.0.2.2:6385/v1/", "rel": "self"}, {"href": "http://docs.openstack.org/developer/ironic/dev/api-spec-v1.html", "type": "text/html", "rel": "describedby"}], "drivers": [{"href": "http://192.0.2.2:6385/v1/drivers/", "rel": "self"}, {"href": "http://192.0.2.2:6385/drivers/", "rel": "bookmark"}], "ports": [{"href": "http://192.0.2.2:6385/v1/ports/", "rel": "self"}, {"href": "http://192.0.2.2:6385/ports/", "rel": "bookmark"}], "chassis": [{"href": "http://192.0.2.2:6385/v1/chassis/", "rel": "self"}, {"href": "http://192.0.2.2:6385/chassis/", "rel": "bookmark"}], "nodes": [{"href": "http://192.0.2.2:6385/v1/nodes/", "rel": "self"}, {"href": "http://192.0.2.2:6385/nodes/", "rel": "bookmark"}], "id": "v1"}

Changed in ironic:
status: Incomplete → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

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

Reviewed: https://review.openstack.org/66621
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=de3de047d1163775cebda55ef04603e0a93777b2
Submitter: Jenkins
Branch: master

commit de3de047d1163775cebda55ef04603e0a93777b2
Author: Roman Prykhodchenko <email address hidden>
Date: Tue Jan 14 18:14:32 2014 +0200

    Process public API list as regular expressions

    In order to allow flexible patterns for public API specification
    and to speed up the process of checking whether some request is
    performed against the public API, it's reasonable to interpret the
    list of public endpoints as regular expressions.

    This patch changes the logic of checking whether a request requires
    authorisation from searching the endpoint in the set to checking the
    endpoint against a list of regular expressions.

    Closes-bug: #1251880
    Change-Id: I638ca0e20fa7e44fbeeae0d1e4c2f4188fb597a5

Changed in ironic:
status: In Progress → Fix Committed
Changed in ironic:
milestone: none → juno-1
aeva black (tenbrae)
tags: removed: authentication
Thierry Carrez (ttx)
Changed in ironic:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: juno-1 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

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.