Skip to main content

4 posts tagged with "authorization"

authorization 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.

Implement Casbin sidecar pattern

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

1. The Casbin Sidecar Pattern

A sidecar is a helper container that runs alongside your main application container (the Flask app) inside the same Kubernetes Pod [4]. The sidecar, in this case, is the Envoy Proxy, which intercepts all incoming and outgoing traffic for your Flask application.

Centralized Authorization on GCP: Casbin, Envoy, and API Gateway

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

Centralized Authorization on GCP: Casbin, Envoy, and API Gateway

Implementing authorization within a web application, especially in a microservices environment, can quickly lead to duplicated or inconsistent security logic. By leveraging the External Authorization Pattern using Envoy Proxy and Casbin, you can decouple security checks from your Flask application, making your architecture cleaner, more secure, and scalable.

This strategy is particularly effective on Google Cloud Platform (GCP) when using services like API Gateway or Cloud Endpoints as the entry point, and Firestore as the persistent policy backend.