Repository navigation
fix(auth): hold scoped keys and lower roles to what they were granted - #2562
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 13, 2026 in 2m 54s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. Scope and role plumbing is the risk here; each of the five gates is pinned by a test that fails without it.
no findings · tests covered · risk high
Five authorization narrowings: scoped keys must hold a write scope to read monitor secrets or AWS setup, device keys can no longer be minted or used via MCP, Security Center telemetry needs security:manage, and demotion expires pending CLI/MCP approvals made above the new role.
canWriteMonitorsnow also requires the key'suptime_monitors:writescope- AWS
setuprequiresintegrations:writefor scoped keys V2ApiKeyCreateParams.kindaccepts onlystandardandmcpsecurityTenantgates the exposure and runtime tabs onsecurity:manage
What was checked
scopeAllowsreturns true for null/undefined scopes, so sessions and legacy keys keep access (v2/auth.ts:174)- Route family is
integrations(group prefix/v2/integrations/aws), matching the handler'sintegrations:writecheck highestRole([])reads as member, so an approval with no roles survives demotion (policy/roles.ts:72)
c892660 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading