Credential backend doesn't use hints model

Bug #1353511 reported by Alexey Miroshkin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Wishlist
Alexey Miroshkin

Bug Description

The current implementation of credential.backends.sql.Credential work with filters directly: list_credentials def list_credentials(self, **filters):
..
if 'user_id' in filters:
        query = query.filter_by(user_id=filters.get('user_id'))

The most part of backends implementation follows hints model, considering any filters as hints, so the particular backend implementation has an option to process it or ignore it. It makes sense to update credential backend, for example:

def list_credentials(self, hints)

Changed in keystone:
assignee: nobody → Alexey Miroshkin (amirosh)
Revision history for this message
Henry Nash (henry-nash) wrote :

Since the ec2 credentials code calls list_credentials() with user_id as a param, I'd recommend you create a separate method for use by bits of keystone that require list of credentials by user, while, as you say, support the standard hints mechanism in list_credentials().

Changed in keystone:
importance: Undecided → Wishlist
status: New → Confirmed
Changed in keystone:
status: Confirmed → In Progress
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/113091

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

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

commit 8aa322236ac406dc82a8965da0ed0006d0c4a3e0
Author: Alexey Miroshkin <email address hidden>
Date: Sat Aug 9 18:57:25 2014 +0400

    Support the hints mechanism in list_credentials()

    This fix implements the hints mechanism, considering filters as hints,
    so the particular backend implementation has an option to process or
    ignore it. Since the EC2 credentials code calls list_credentials() with
    user_id as a param, a separate method list_credentials_for_user has been
    introduced to provide the compatibility while support the standard hints
    mechanism in list_credentials().

    This fix doesn't plug hints into the controller, it prepares the way for
    implementation of the bp filter-credentials-by-user to support filtering
    credentials by user in a follow on patch.

    Closes-Bug: #1353511

    Change-Id: Ibcf59aa45a8fc7e5cc66fd4edb91ae8fdc641d93

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