Course contentsShow
← Cloud and Infrastructure
Lesson 1624 of 2,98933. Service Mesh FeaturesFree lesson

Request-Level Authorization

Implementing fine-grained access control based on HTTP methods, paths, headers, and JWT claims.

Request-Level Authorization

What you'll learn: How to control service access based on specific request attributes like HTTP methods, paths, headers, and JWT claims for granular security.

Beyond "Who Can Connect"

In the previous lesson, you learned basic authorization policies that control which services can communicate. Request-level authorization takes this much further by examining what actions a service can perform based on the details of each individual request.

Think of it like a building security system: basic authorization is your keycard that gets you in the door, but request-level authorization determines which specific rooms you can enter, whether you can only read documents or also edit them, and whether access changes based on the time of day.

Fine-Grained Control Points

Request-level authorization inspects HTTP request attributes to make access decisions:

  • HTTP methods: Allow GET but deny POST/DELETE
  • Paths: Permit /api/public/* but block /api/admin/*
  • Headers: Require specific X-API-Version or X-Tenant-ID values
  • JWT claims: Extract user roles, groups, or permissions from authenticated tokens

For example, you might allow a service to read data (GET requests to /api/data/*) but only permit writes (POST/PUT to /api/data/*) if the JWT contains a role: editor claim.

How It Works in Practice

Your service mesh authorization policy evaluates each incoming request against rules you define. If a request matches conditions (like "path starts with /admin/ AND JWT claim admin=true"), the policy either allows or denies it. This happens transparently at the sidecar proxy level before traffic reaches your application.

Key Takeaway: Request-level authorization provides fine-grained access control by enforcing rules based on HTTP attributes and JWT claims, enabling sophisticated security policies like role-based access or operation-specific permissions within your service mesh.