incorrect PolicyNotAuthorized message

Bug #1673859 reported by Matthew Edmonds
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo.policy
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

https://review.openstack.org/#/c/388683/ changed the message for PolicyNotAuthorized exceptions to say something that is actually incorrect. It now says "%(target)s is disallowed by policy rule %(rule)s with %(creds)s ", but it isn't the target that is disallowed... it is the action (called the "rule" here).

This string is also too verbose and confusing if/when presented to a user. Nova and cinder present a much simpler message that is actually more useful to a user. They just say "Policy doesn't allow %(action)s to be performed." Ideally oslo.policy would return the same string for consistency and for the improved clarity. Yes, this omits target and credential information, which could be useful to someone. Log that if you think it might be useful, but don't return it in the exception message. It makes the message too long and too hard to read. The message is a string, and target and credentials are dicts. Not only do they make the message very ugly and hard for a human to parse, but they are giving information that is typically unnecessary and won't be understood by most users.

Changed in oslo.policy:
status: New → Confirmed
assignee: nobody → ChangBo Guo(gcb) (glongwave)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.policy 1.23.0

This issue was fixed in the openstack/oslo.policy 1.23.0 release.

Revision history for this message
Lance Bragstad (lbragstad) wrote :

Strange - this bug wasn't closed even though the fix merged.

Changed in oslo.policy:
status: Confirmed → Fix Released
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.