aio-libs / aiohttp-security

auth and permissions for aiohttp
Apache License 2.0
229 stars 68 forks source link

Replace API functions #677

Open Dreamsorcerer opened 11 months ago

Dreamsorcerer commented 11 months ago

Problem

The API functions don't support static typing well. For example:

Solution

I'm thinking the best approach will be to remove the API functions (everything in api.py), and then use the IdentityPolicy and AuthorizationPolicy classes directly.

A few tweaks will need to be made, but this should make it much easier to subclass and implement these with precise types.

Most of these functions are just calling the methods anyway, so there's not really any extra complexity to just call the methods directly.