Skip to content

Add API-key scoped permission enforcement tests and documentation #1293

Description

@nanaf6203-bit

Context

ApiKey model has permissions (JSON), ApiKeyAuthGuard validates keys, but key permissions aren't applied to endpoint authorization anywhere; docs/ (RBAC matrix) documents USER/AGENT/ADMIN roles, not key scopes.

Problem

API keys currently grant whatever the linked user can do - no scope limiting. An integration using a read-only key can mutate data. The permission column is stored but inert.

Proposed approach

Introduce a KeyPermissionsGuard that reads request.authUser (populated by ApiKeyAuthGuard) and enforces declared scopes against route metadata; update docs/RBAC_Permission_Matrix.md; add specs for allowed/denied scopes.

Acceptance criteria

  • Scoped API keys enforce read/write limits; docs match behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions