Skip to main content

2 posts tagged with "Middleware"

Middleware tag description

View All Tags

Authorization in the App Layer: Using Casbin Flask Middleware

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

If your deployment environment doesn't support a service mesh like Envoy or an external authorization server (common in simpler, monolithic, or traditional hosting setups), you can certainly move the Casbin authorization check into your Flask application using middleware or decorators.

This approach centralizes authorization logic within the Python code, relying on dedicated extensions like flask-authz or Flask-Casbin.