0f9a607cf6
This patch simplifies the process for validating the request body for POST and PUT requests and preparing it for dispatching to plugins. In particular it removes the need for parsing the URL to find the resource identifier, and instead leverages Pecan's routing engine to extract it. As a result the attribute population hook now simply deals with request body validation, and has been renamed accordingly. The logic for loading the current state of the object from the plugin in order to enforce authZ policy on PUT requests has been moved to the appropriate hook, PolicyEnforcementHook. The logic for managing plural/singular names for resource has also been improved, and two helper functions to retrieve a resource's attributes have been added to neutron.api.v2.attributes The logic for aborting requests with unsupported HTTP methods has also been moved to the REST controllers. It used to be in PolicyEnforcementHook, which was probably not the right thing to do. This patch also unskips a functional test concerning ownership checks, and add functional tests for verifying correct request processing. Unit tests for the newly added helper functions are also provided. Related blueprint wsgi-pecan-switch Change-Id: Ib26998b37bdeec8af7a97f77b66d421b8cd271da |
||
---|---|---|
.. | ||
controllers | ||
hooks | ||
__init__.py | ||
app.py | ||
startup.py |