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
{{ message }}
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
Starlette provides an endpoint decorator to check for permissions. However, this endpoint is tied to Starlette's view system and may not be reusable in all situations.
Solution you'd like
To free ourselves from the constraint on how views are implemented, we need to use ASGI. Assuming that routes are ASGI applications themselves (this is a potential blocker, but most ASGI frameworks work like this anyway), we could write an ASGI route decorator as follows:
Problem
Starlette provides an endpoint decorator to check for permissions. However, this endpoint is tied to Starlette's view system and may not be reusable in all situations.
Solution you'd like
To free ourselves from the constraint on how views are implemented, we need to use ASGI. Assuming that routes are ASGI applications themselves (this is a potential blocker, but most ASGI frameworks work like this anyway), we could write an ASGI route decorator as follows:
Usage with Starlette:
The text was updated successfully, but these errors were encountered: