Cannot use audit middleware with Swift because cfg.CONF.project does not exist

Bug #1583690 reported by Guang Yee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystonemiddleware
Fix Released
Medium
Guang Yee

Bug Description

Audit assumes cfg.CONF.project is set.

https://github.com/openstack/keystonemiddleware/blob/master/keystonemiddleware/audit.py#L369

This is only true for services using oslo.config. But since Swift have no dependency on oslo.config, this option may not get registered or even exist. You may see an traceback in Swift which ends with something like this

"oslo_config.cfg.NoSuchOptError: no such option in group DEFAULT: project"

We need to follow the same pattern as auth_token to determine the project. See

https://github.com/openstack/keystonemiddleware/blob/master/keystonemiddleware/auth_token/__init__.py#L1021

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

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

Changed in keystonemiddleware:
assignee: nobody → Guang Yee (guang-yee)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystonemiddleware (master)

Reviewed: https://review.openstack.org/320123
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=619dbf3786f260b2a95704ef14e40f00a0ee555a
Submitter: Jenkins
Branch: master

commit 619dbf3786f260b2a95704ef14e40f00a0ee555a
Author: guang-yee <email address hidden>
Date: Mon May 23 13:04:42 2016 -0700

    Determine project name from oslo_config or local config

    For services such as Swift, which may not be utilizing oslo_config, we need
    to be able to determine the project name from local config. If project name
    is specified in both local config and oslo_config, the one in local config will
    be used instead.

    In case project is undetermined (i.e. not set), we use taxonomy.UNKNOWN
    as an indicator so operators can take corrective actions.

    Change-Id: Ia95cbc9974d0c39c6b77d966cffdef2885350d77
    Closes-Bug: 1583690

Changed in keystonemiddleware:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/keystonemiddleware 4.6.0

This issue was fixed in the openstack/keystonemiddleware 4.6.0 release.

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.