agent/php
Snider 599544010e feat(agent/mcp): McpContext::getScopes() + hasScope() (HIGH)
McpContext exposes the authenticated session's authorisation scopes
via getScopes(): array and hasScope(string): bool.

Resolution order:
1. Explicit scope source passed to constructor
2. Session-like object linked to an API key
3. Authenticated Laravel request context (mcp_workspace_context,
   agent_api_key, api_key)
4. Empty array (default) — never null

Dedupes scope strings, normalises separators in hasScope() matching.

Closes the OFM MCP tool gap where scope-gated tools currently return
empty/incorrect handling. No call-site stubs found needing update in
this worktree — call sites pick up the new method directly.

Pest covers: session scopes returned, hasScope present/missing, empty
session defaults to [], request-context regression against real MCP
auth shape.

Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=1014
2026-04-25 19:04:35 +01:00
..
Actions fix(brain): close openbrain audit gaps — org scoping + index cleanup + reindex flags + MCP schemas + circuit layer 2026-04-24 08:14:06 +01:00
Agentic feat(agentic): implement §9 Services (FleetService + CreditService + SessionService) (#849) 2026-04-25 05:28:49 +01:00
Configs revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Console/Commands fix(brain): close openbrain audit gaps — org scoping + index cleanup + reindex flags + MCP schemas + circuit layer 2026-04-24 08:14:06 +01:00
Controllers feat(api): implement §3 fleet+credits+subscription+sync+agent-auth routes (#848) 2026-04-25 05:43:51 +01:00
docs revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Facades revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Jobs feat(brain): add DeleteFromIndex job 2026-04-23 12:55:45 +01:00
Lang/en_GB revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Mcp feat(agent/mcp): McpContext::getScopes() + hasScope() (HIGH) 2026-04-25 19:04:35 +01:00
Middleware revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Migrations fix(brain): close openbrain audit gaps — org scoping + index cleanup + reindex flags + MCP schemas + circuit layer 2026-04-24 08:14:06 +01:00
Mod/Mcp/Services feat(mcp): implement extended RFC services + transport (#842) 2026-04-25 05:50:16 +01:00
Models fix(brain): close openbrain audit gaps — org scoping + index cleanup + reindex flags + MCP schemas + circuit layer 2026-04-24 08:14:06 +01:00
Pipeline feat(pipeline): add MetaReader contract + Forgejo-backed implementation 2026-04-23 18:09:54 +01:00
resources feat(mcp): implement extended RFC services + transport (#842) 2026-04-25 05:50:16 +01:00
Routes feat(api): implement §3 fleet+credits+subscription+sync+agent-auth routes (#848) 2026-04-25 05:43:51 +01:00
Service revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Services fix(agent/brain): cap remember()/recall()/forget() input field sizes 2026-04-25 18:58:41 +01:00
Support revert fcb9c189e5 2026-04-23 12:32:57 +01:00
tests feat(agent/mcp): McpContext::getScopes() + hasScope() (HIGH) 2026-04-25 19:04:35 +01:00
View revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Website/Mcp/Middleware feat(mcp): implement §4 Middleware (5 middleware classes) (#852) 2026-04-25 05:25:09 +01:00
.DS_Store revert fcb9c189e5 2026-04-23 12:32:57 +01:00
agentic.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AGENTS.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Boot.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
config.php fix(brain): wire Qdrant api-key header from BRAIN_QDRANT_API_KEY 2026-04-24 05:21:15 +01:00
FINDINGS.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00
GEMINI.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00
TODO.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00