Skip to main content

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.

Casbin Hierarchical RBAC Maintenance: Static Structure vs. Dynamic Roles

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

A common misconception about using Casbin Hierarchical RBAC is that the entire policy storage must be updated every time a user performs an action or changes state. This is incorrect. The system is designed to separate the static, structural hierarchy (which rarely changes) from the dynamic user assignments (which change frequently).

The efficiency of Hierarchical RBAC lies in this separation, minimizing the required policy updates and reducing redundancy.

Casbin RBAC vs. Casbin RBAC with Hierarchical Roles

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

The choice between standard Casbin RBAC (Role-Based Access Control) and Casbin RBAC with Hierarchical Roles largely depends on the complexity of your application's user structure and the need for role inheritance.

Both models use a similar policy structure in Casbin's configuration files (models and policies), but the hierarchical model provides a powerful shortcut for managing permissions in complex organizations.

Postman clear cache response

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

While Postman doesn't have a single "Clear Cache" button that directly affects API results (as it doesn't cache external API responses), the core issue often lies in two areas that mimic caching: DNS resolution and request state persistence.

Check history of specific line in vscode

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

You can check the history of a specific line in VS Code using the built-in Git Blame feature or the Timeline view. For a much more powerful experience, the free GitLens extension is highly recommended.

How to squash commits

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

Squashing commits is a common Git operation that combines multiple commits into a single, cleaner commit. This is crucial for keeping your branch history tidy before merging into a main branch (like main or master), making the project history easier to read and revert [1].

The primary tool for squashing commits is interactive rebase (git rebase -i).

Google Cloud Workstations: Best Use Cases for Enterprise Development

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

Google Cloud Workstations, a fully managed service that provides secure, scalable, and customizable development environments in the cloud.

The best use cases for Google Cloud Workstations center around security, compliance, developer productivity, and managing complex or resource-intensive projects.

The Detached HEAD State: Why Git Won't Push and How to Fix It

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

This situation is known as being in a Detached HEAD state. It happens because when you use git checkout <commit-hash>, you're telling Git to look at that specific point in history, not a moving branch name.

The solution is to create a new branch at that commit before pushing.

Looking for more content?
Hrekov Blog contains 165 articles. Browse the blog archive or Explore the full timeline.