Skip to content

Commit 4c3c910

Browse files
committed
docs: qualify all admin bypass statements by token type
Fix remaining stale references that described admin bypass without distinguishing API/legacy tokens from session tokens: - AGENTS.md:112 — security invariant now references both normalize_token_teams() and resolve_session_teams() - multitenancy.md:1247 — enforcement summary now qualifies admin bypass per token type - rbac.md:246 — "Explicit Admin Bypass" section split by token type - rbac.md:639 — scoping strategy table corrected for session tokens Closes #3003 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
1 parent ef23603 commit 4c3c910

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ ContextForge implements a **two-layer security model**:
109109
- Keep the two-layer model on every path:
110110
- Layer 1: token scoping controls what a caller can see.
111111
- Layer 2: RBAC controls what a caller can do.
112-
- Do not re-implement token team interpretation logic; always use `normalize_token_teams()` in `mcpgateway/auth.py`.
112+
- Do not re-implement token team interpretation logic; use `normalize_token_teams()` for API/legacy tokens and `resolve_session_teams()` for session tokens (both in `mcpgateway/auth.py`).
113113
- Do not accept inbound client auth tokens via URL query parameters.
114114
- Legacy `INSECURE_ALLOW_QUERYPARAM_AUTH` is interop-only for outbound peer auth and must remain opt-in and host-restricted.
115115
- High-risk transports must be feature-flagged and disabled by default.

docs/docs/architecture/multitenancy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ These behaviors are enforced consistently across all access paths:
12441244

12451245
1. `normalize_token_teams()` is the canonical interpreter of JWT team claims; `resolve_session_teams()` is the single policy point for session tokens (always DB-resolved)
12461246
2. Missing `teams` key always returns `[]` (public-only, secure default)
1247-
3. Admin bypass requires BOTH `teams: null` AND `is_admin: true`, and both `token_teams=None` AND `user_email=None` in the service layer
1247+
3. Admin bypass for API/legacy tokens requires BOTH `teams: null` AND `is_admin: true`; for session tokens, admin bypass is DB-derived (`is_admin` flag). In both cases the service layer requires `token_teams=None` AND `user_email=None` for unrestricted queries
12481248
4. Empty teams list (`[]`) results in public-only access, even for admins
12491249
5. All list endpoints pass `token_teams` to the service layer
12501250
6. Service layer applies visibility filtering based on `token_teams` via `BaseService._apply_access_control()`

docs/docs/manage/rbac.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ Key points:
243243

244244
2. **Explicit Admin Bypass**
245245

246-
- Admin bypass requires explicit `teams: null` AND `is_admin: true`
247-
- Empty teams `[]` disables bypass even for admins
246+
- API/legacy tokens: admin bypass requires explicit `teams: null` AND `is_admin: true`
247+
- Session tokens: admin bypass is DB-derived (DB `is_admin` flag); JWT `teams` only narrows non-admin sessions
248+
- Empty teams `[]` disables bypass even for admins (API/legacy tokens)
248249

249250
3. **Scoped Automation Tokens**
250251

@@ -636,7 +637,7 @@ When `AUTH_REQUIRED=false`:
636637

637638
| Use Case | Recommended Token Scope |
638639
|----------|------------------------|
639-
| Admin UI access | Session token (`teams: null` + `is_admin: true`) |
640+
| Admin UI access | Session token (admin bypass is DB-derived; no `teams` claim needed) |
640641
| CI/CD pipeline | `teams: []` (public-only) |
641642
| Service integration | Specific team(s) |
642643
| Developer access | Personal team + project teams |

0 commit comments

Comments
 (0)