You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, an access policy can be added to a specific resources using router::add_policy(). However, I think that this approach is somewhat limiting.
Instead, I would recommend using an approach similar to the request filters: an optional argument to the various router:add*() functions which accepts a policy.
This would also remove the need for the newly introduced and very fuckly router::set_policy().
The text was updated successfully, but these errors were encountered:
This changes the way that policies are handled. Basically we're performing the policy check as the very first thing inside router::handle_request(). This ensures that we can also apply policies to entire sub-routers. Prior to this change, policies were only checked/handled within router::handle_http_request() which meant that sub-routers could not be policy protected. As a workaround, router::set_policy() was introduced to provide a router-wide policy.
This change fixes all of those problems. One can now simply use router::add_policy() and it will work for sub-router protection as well.
Ref #96
After taking some time to think about this properly, I think the router::add_policy() mechanism is sufficient for now.
The only change necessary to make this work well for sub-router protection is to perform the policy check as early as possible (i.e. within router::handle_request() rather than router::handle_http_request() to ensure that policy checks happen before sub-router resource matching.
Currently, an access policy can be added to a specific resources using
router::add_policy()
. However, I think that this approach is somewhat limiting.Instead, I would recommend using an approach similar to the request filters: an optional argument to the various
router:add*()
functions which accepts a policy.This would also remove the need for the newly introduced and very fuckly
router::set_policy()
.The text was updated successfully, but these errors were encountered: