Book 3 · Lesson 3.9

ABAC and role scoping

  • Define attribute-based access control
  • Map team_radar:manager scope to routes
  • Design a read-only scope extension

Prerequisites: 3.2

Authentication asks who; authorization asks what they may do.

Gateway middleware:

if claims.claims.scope != "team_radar:manager" {
    return Err(StatusCode::FORBIDDEN);
}

AbacRoleMatrix — try paths /api/metrics/summary vs /api/webhooks/hello.

ABAC attributes

AttributeExample
Subjectsub: manager-dev
Scopeteam_radar:manager
Resource/api/metrics/*
ActionGET vs POST

Teach-back prompt

How would you add team_radar:read without breaking manager POST?

Manager role at gateway

Lesson 3.9 check

1. Gateway checks JWT…