Create project with invalid domain_id

Bug #1426496 reported by Rodrigo Duarte
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Raildo Mascena de Sousa Filho

Bug Description

Right now it is possible to create a project with an invalid domain_id (we do not check if the domain_id exists in the create_project method) if we are using engines that not support foreign keys, such as sqllite: https://github.com/openstack/keystone/blob/master/keystone/resource/core.py#L87-L116

If we are using engines that support foreign keys, the error returned is not really helpfull:

{
    "error": {
        "code": 500,
        "message": "An unexpected error occurred when trying to store project (Disable debug mode to suppress these details.)",
        "title": "Internal Server Error"
    }
}

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

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

Changed in keystone:
assignee: nobody → Rodrigo Duarte (rodrigodsousa)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by Rodrigo Duarte (<email address hidden>) on branch: master
Review: https://review.openstack.org/160446
Reason: abandoning since it is only valid for sqlite

David Stanek (dstanek)
Changed in keystone:
importance: Undecided → Medium
Changed in keystone:
assignee: Rodrigo Duarte (rodrigodsousa) → Telles Mota Vidal Nóbrega (tellesmvn)
Changed in keystone:
assignee: Telles Mota Vidal Nóbrega (tellesmvn) → Raildo Mascena de Sousa Filho (raildo)
Changed in keystone:
assignee: Raildo Mascena de Sousa Filho (raildo) → Telles Mota Vidal Nóbrega (tellesmvn)
Changed in keystone:
assignee: Telles Mota Vidal Nóbrega (tellesmvn) → Rodrigo Duarte (rodrigodsousa)
Changed in keystone:
assignee: Rodrigo Duarte (rodrigodsousa) → Raildo Mascena de Sousa Filho (raildo)
Changed in keystone:
assignee: Raildo Mascena de Sousa Filho (raildo) → Henrique Truta (henriquetruta)
Changed in keystone:
assignee: Henrique Truta (henriquetruta) → Raildo Mascena de Sousa Filho (raildo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/159944
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=a0a2f637ee3ba58d64dd12d33303abbd454a5213
Submitter: Jenkins
Branch: master

commit a0a2f637ee3ba58d64dd12d33303abbd454a5213
Author: Rodrigo Duarte Sousa <email address hidden>
Date: Fri Feb 27 15:35:12 2015 -0300

    Add domain_id checking in create_project

    It was possible to create a project with invalid domain_id if
    we are using engines that do not support foreign keys (such
    as sqlite). If the engine being used supports foreign keys
    the returned error was a generic Internal Server Error.

    This patch adds a check in the create_project() method in
    order to verify if the domain_id is valid (there is a domain
    with such id), returning DomainNotFound error if it is case.

    Co-Authored-By: Hugo Nicodemos <email address hidden>
    Co-Authored-By: Raildo Mascena <email address hidden>
    Co-Authored-By: Erickson Santos <email address hidden>

    Change-Id: I8f394f46ab915844228de00c5a9223c1e3fb6be1
    Closes-Bug: 1426496

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: liberty-1 → 8.0.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.