Repository navigation
fix(auth): hold scoped keys and lower roles to what they were granted - #2562
Conversation
A read-scoped API key resolves with the default key role, so checks that looked at the role alone treated it as a writer. - Uptime monitors: header values and the heartbeat URL are shown only to a caller who may write monitors, by role and by scope. - AWS connection setup: the rendered setup holds the stream's access key, so a scoped key needs integrations:write to read it. - API keys: a device credential can no longer be created by name, and the MCP server refuses one. - Security Center: the exposure and runtime tabs check security:manage on the server, like the findings do. - Demotion: approvals made at the old role and not yet redeemed are removed with the credentials already pinned above the new role.
This comment has been minimized.
This comment has been minimized.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…above the new role
This comment has been minimized.
This comment has been minimized.
Maple review🟢 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. 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
|
What
Part of a pass over every API surface. Five places where a credential could do slightly more than it was granted. None crosses organizations.
integrations:writeto fetch it. Sessions and unscoped keys are unchanged.POST /v2/api_keysacceptsstandardandmcponly. Device credentials are issued to an installation by their own endpoints, and the MCP server now refuses one.security:manageon the server, as the findings already do. Until now only the web app hid them.Verification
uptime-monitors.http.test.ts,integrations-aws.http.test.ts,api-keys.http.test.ts,security-tenant.test.ts,MembershipRevocationService.test.ts,resolve-tenant.scopes.test.ts.widget-credentials.http.test.ts, the domain v2 contract tests and the provider contract test still pass.@maple/api,@maple/ai,@maple/web,@maple/domain. Lint with the CI config on the touched directories.ios:openapi:checkis up to date.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
integrations:writescope for scoped API keys.