Course contentsShow
← System Design
Lesson 854 of 1,91922. Service MeshFree lesson

Request-Level Authorization

Enforce fine-grained access control policies based on service identity, headers, or request attributes.

Request-Level Authorization

What you'll learn: How service meshes enforce fine-grained access control based on service identity, headers, and request attributes—beyond basic mutual TLS authentication.

The Core Idea

While mutual TLS (mTLS) proves who is calling your service, request-level authorization decides what they're allowed to do. Think of mTLS as checking someone's ID at a building entrance, while request-level authorization is like checking their badge permissions at each individual room—not everyone who enters the building should access every door.

In a service mesh, the sidecar proxy intercepts every request and can evaluate authorization policies before forwarding traffic. These policies can examine:

  • Service identity: "Only the checkout service can call /payments"
  • HTTP headers: "Requests must include a valid JWT token with 'admin' role"
  • Request attributes: "Only GET requests allowed from external-facing services"
  • Path or method: "Service A can POST to /orders but not DELETE"

Why It Matters

Without request-level authorization, you'd need to implement access control logic in every microservice—duplicating code, creating inconsistencies, and missing the polyglot advantage of service meshes. The mesh centralizes these policies in the control plane, and the data plane proxies enforce them uniformly.

For example, you might allow the mobile-api service to call user-service's /profile endpoint, but block it from accessing /admin/users—all configured declaratively without changing application code.

How It Works in Practice

The control plane distributes authorization policies to sidecar proxies. When a request arrives, the proxy evaluates rules before forwarding to the application. Denied requests receive immediate 403 responses without ever reaching your service code.

Key Takeaway: Request-level authorization in a service mesh provides centralized, fine-grained access control based on service identity and request attributes, enforced transparently by sidecar proxies without application code changes.