Generic variable support for projects

Bug #1665237 reported by Jim Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
craton
Fix Released
Critical
Thomas Maddox

Bug Description

To support completion of bug #1648626, which mixes in variables with
projects, we need to resolve the following, as reported in
https://review.openstack.org/#/c/427777/

1) Removing the RBAC stuff in favor of consuming generic variables
(which doesn't support the RBAC lite that was used for Projects),
caused oslo_db's generic multi-tenancy to be evaluated, which blows up
because the Project table doesn't have 'project_id'.

2) LOG = ... was missing from variables.py. This is used by the
craton.api.v1.base module to introspect the variables module and
execute with its logger.

(Interestingly there's a recent patch proposed
https://review.openstack.org/#/c/434665/ which attempts to remove LOG
for other modules, causing some tests to blow up. Maybe we can add a
some annotation stating what the LOG module-level variable is used
for?)

The problem can be readily reproduced by doing a query like so:

$ curl http://127.0.0.1:8080/v1/projects/b9f10eca-66ac-4c27-9c13-9d01e65f96b4/variables -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"

This results in

{
  "message": "Unknown Error",
  "status": 500
}

A related query appears to be causing a similar error:

$ curl http://127.0.0.1:8080/v1/projects/b9f10eca-66ac-4c27-9c13-9d01e65f96b4 -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"
A server error occurred. Please contact the administrator.

Note no JSON error response in this case however! See bug #1665015

Revision history for this message
Thomas Maddox (thomas-maddox) wrote :
Changed in craton:
assignee: nobody → Thomas Maddox (thomas-maddox)
importance: Undecided → Critical
Revision history for this message
Thomas Maddox (thomas-maddox) wrote :
Revision history for this message
Thomas Maddox (thomas-maddox) wrote :

Starting work on #1.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to craton (master)

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

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

Reviewed: https://review.openstack.org/434976
Committed: https://git.openstack.org/cgit/openstack/craton/commit/?id=bf1cdf474033becc9c1a1df62be5763fef4daffb
Submitter: Jenkins
Branch: master

commit bf1cdf474033becc9c1a1df62be5763fef4daffb
Author: Thomas Maddox <email address hidden>
Date: Thu Feb 16 15:36:21 2017 +0000

    RBAC-Lite for generic resources implementation

    This patch re-applies RBAC-lite to the /projects
    endpoint. For the top-level /projects endpoint,
    permissions have been narrowed to only root
    project users. Anything pertaining to a specific
    project has been narrowed to project admin users.

    This patch implements a decorator to afford us the
    same features for the generic resources functions
    that @require_project_admin_context and
    @require_admin_context decorators afforded us
    piecemeal for other DB API functions.

    Change-Id: I875a9a8cb68c76d27f613bac6f4b87f3a1e2b411
    Closes-Bug: 1665237
    Closes-Bug: 1648626

Changed in craton:
status: In Progress → Fix Released
Changed in craton:
milestone: none → v0.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.