debug message never includes identity values

Bug #1408602 reported by Alistair Coles on 2015-01-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystonemiddleware
Medium
Alistair Coles

Bug Description

auth_token debug log generates the following output i.e. all identity attribute values are shown as 'None' even when identity attributes are populated in the request environment:

  Jan 8 10:10:17 localhost proxy-server: Received request from user: user_id None, project_id None, roles None service: user_id None, project_id None, roles None

The root cause is that the _fmt_msg() function constructs a debug message using
identity attributes from the request environ dict, but
accesses these using keys such as X_USER_ID, when the
correct key should be HTTP_X_USER_ID. Consequently no
identity attribute values are ever included in the debug
log message.

Changed in keystonemiddleware:
assignee: nobody → Alistair Coles (alistair-coles)
status: New → In Progress
Dolph Mathews (dolph) on 2015-01-08
Changed in keystonemiddleware:
importance: Undecided → Medium

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

commit dcce0d6367ca326c79269a9be143efee519a3174
Author: Alistair Coles <email address hidden>
Date: Wed Jan 7 13:52:06 2015 +0000

    Fix environ keys missing HTTP_ prefix

    The _fmt_msg() function constructs a debug message using
    identity attributes from the request environ dict, but
    accesses these using keys such as X_USER_ID, when the
    correct key should be HTTP_X_USER_ID. Consequently no
    identity attribute values are ever included in the debug
    log message.

    This patch adds the missing HTTP_ prefix to the keys and
    adds an assertion to the unit tests to verify that the debug
    log is generated as expected.

    Closes-Bug: 1408602
    Change-Id: Ib309abcb3d0f15a20ae581105de1f8964497e5a2

Changed in keystonemiddleware:
status: In Progress → Fix Committed
Changed in keystonemiddleware:
milestone: none → 1.4.0
Changed in keystonemiddleware:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers