Skip to content

Add API key scoped permissions (read-only vs write) #219

Description

@Kingsman-99

Description

src/app/settings/api-keys/page.tsx creates API keys with full access — there's no way to issue a read-only key for safer third-party integrations. This issue adds scoped permissions per key.

Technical Context

Involves src/app/settings/api-keys/page.tsx. Each key gets a scope: "read" | "write" field set at creation, displayed in the key list, and enforced by src/app/api/* route handlers checking the scope before mutating operations.

Acceptance Criteria

  • Key creation form has a scope selector defaulting to "read"
  • Key list shows scope as a badge next to each key
  • Write-scope-required API routes reject read-only keys with 403 and a clear error body
  • Existing keys created before this change default to "write" (backward compatible) with a one-time banner suggesting review
  • Unit tests: read-only key rejected on write endpoint, write key allowed, default migration behavior

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions