commit 085631b71bcaa30176c109681285b97a76234e75
Author: Hongbin Lu <email address hidden>
Date: Mon Jan 4 20:01:57 2016 -0500
Fixed the incorrect policy enforcement
In API controller, "@expose.expose" should be on top of
"@policy.enforce_wsgi". Otherwise, the output won't have the correct
format and status code. That is because "@expose.expose" will format
the exception before sending the response.
In "enforce_wsgi", use decorator module instead of "functools.wraps".
That is because decorator is signature preserving, which is
necessary for other decorator to work.
Also, added unit tests to ensure the correct error message and status
code will return if the request cannot pass the policy check.
Reviewed: https:/ /review. openstack. org/263505 /git.openstack. org/cgit/ openstack/ magnum/ commit/ ?id=085631b71bc aa30176c1096812 85b97a76234e75
Committed: https:/
Submitter: Jenkins
Branch: master
commit 085631b71bcaa30 176c109681285b9 7a76234e75
Author: Hongbin Lu <email address hidden>
Date: Mon Jan 4 20:01:57 2016 -0500
Fixed the incorrect policy enforcement
In API controller, "@expose.expose" should be on top of enforce_ wsgi". Otherwise, the output won't have the correct
"@policy.
format and status code. That is because "@expose.expose" will format
the exception before sending the response.
In "enforce_wsgi", use decorator module instead of "functools.wraps".
That is because decorator is signature preserving, which is
necessary for other decorator to work.
Also, added unit tests to ensure the correct error message and status
code will return if the request cannot pass the policy check.
Change-Id: I8b77ba95124c13 dd1a46700bc6010 5bc7e33a579
Related-Bug: #1520311