Changelog¶
0.2.0 (2017-02-14)¶
aclmiddleware:- Add
setupfunction foraclmiddleware to install it in aiohttp fashion. - Fix bug in
acl_requireddecorator. - Fix a possible security issue with
aclgroups. The issue is follow: the default behavior is to adduser_idto groups for authenticated users by the acl middleware, but ifuser_idis equal to some of acl groups that user suddenly has the permissions he is not allowed for. So to avoid this kind of issueuser_idis not added to groups any more. - Introduce
AbstractACLGroupsCallbackclass inaclmiddleware to make it possible easily create callable object by inheriting from the abstract class and implementingacl_groupsmethod. It can be useful to store additional information (such database connection etc.) within such class. An instance of this subclass can be used in place ofacl_groups_callbackparameter.
- Add
authmiddleware:- Add
setupfunction forauthmiddleware to install it in aiohttp fashion. auth.auth_requiredraised now aweb.HTTPUnauthorizedinstead of aweb.HTTPForbidden.
- Add
- Introduce generic authorization middleware
autzthat performs authorization through the same interface (autz.permitcoroutine andautz_requireddecorator) but using different policies. Middleware has the ACL authorization as the built in policy which works in the same way asaclmiddleware. Users are free to add their own custom policies or to modify ACL one. - Add global
aiohttp_auth.setupfunction to installauthandautzmiddlewares at once in aiohttp fashion. - Add docs.
- Rewrite tests using
pytestandpytest-aiohttp.