Skip to content

API: token create/list/update with scopes[] and allow_list[] #19853

@ThomasK33

Description

@ThomasK33

Description

  • Extend token management endpoints to accept and return scopes: string[] and allow_list: string[].
  • Validate requested scopes against the catalog; reject unknown names.
  • Enforce user’s role intersection: a scoped key cannot be used to mint a broader-scoped key than the caller is authorized to create.

Key files/areas

  • coderd/apikey.go handlers and request/response types.
  • Swagger annotations to update generated API docs.

Acceptance criteria

  • New request/response shapes reflected in docs/reference/api/* after generation.
  • Authorization tests cover “cannot mint elevated scopes”.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Chore.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions