Overview
RadarOS provides built-in JWT authentication and RBAC middleware for the Express transport layer. Both are plug-and-play — just add config toRouterOptions.
Quick Start
JWT Configuration
| Option | Type | Default | Description |
|---|---|---|---|
secret | string | required | JWT signing secret |
algorithm | string | — | Algorithm (HS256, RS256, etc.) |
issuer | string | — | Expected token issuer |
audience | string | — | Expected token audience |
extractFrom | "header" | "cookie" | "header" | Where to find the token |
cookieName | string | "token" | Cookie name (when extractFrom is “cookie”) |
npm install jsonwebtoken
RBAC Configuration
| Option | Type | Default | Description |
|---|---|---|---|
scopeField | string | "scopes" | JWT payload field containing scopes |
defaultScopes | Record<string, string[]> | Built-in map | Route-to-scope mapping |
agentScopes | Record<string, string[]> | — | Per-agent scope requirements |
Built-in Scope Map
| Route | Required Scopes |
|---|---|
POST /agents/:name/run | agents:run |
POST /agents/:name/stream | agents:run |
GET /agents | agents:read |
POST /teams/:name/run | teams:run |
GET /teams | teams:read |
POST /workflows/:name/run | workflows:run |
GET/POST/DELETE /admin/* | admin:* |
Token Format
* or admin:* grants access to all routes.