- Notifications
You must be signed in to change notification settings - Fork1k
feat: add allow_list to resource-scoped API tokens#19964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
ThomasK33 commentedSep 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
4522801
to5050f89
Compare01e4d20
to84dc70d
Compare5050f89
to6451b31
Compare26fbd88
tod90697e
Compare30352b6
to5e9b41c
Compared90697e
toe6d4c8c
Compare5e9b41c
to30352b6
Comparee6d4c8c
tod90697e
Compare30352b6
todeba62d
Compared90697e
to2463c7f
Comparedeba62d
toff0d568
Compare2547799
to71ff7de
Compareff0d568
to4ec061d
Comparec7ec9c6
tobf0f8e8
Compareaf2c645
to5dd3400
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The intersection code is a good pattern 👍 In Lines 238 to 239 in5dd3400
Lines 295 to 296 in5dd3400
|
5dd3400
to5a6e8cc
Comparebf0f8e8
to515bfd7
Compare5a6e8cc
to73a65fa
Compare515bfd7
to5884dbd
Compare5884dbd
tob60ae0a
Compare73a65fa
to7d422aa
Compare49af2b4
tofa53285
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Minor comments, will approve after this round 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fa53285
tod7df2aa
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Last changes, then let's merge 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Expose allow_list targets on CreateTokenRequest and persist them in thedatabase so API keys can be scoped to resources.Introduce codersdk and rbac helpers to parse, validate, and normalizeallow lists to enforce consistent wildcard handling.Regenerate OpenAPI documentation, API typing outputs, and TypeScriptbindings with stable serialization ordering for generated files.
d7df2aa
toa1346f5
Compare
Uh oh!
There was an error while loading.Please reload this page.
Add API key allow_list for resource-scoped tokens
This PR adds support for API key allow lists, enabling tokens to be scoped to specific resources. The implementation:
allow_list
field to theCreateTokenRequest
struct, allowing clients to specify resource-specific scopes when creating API tokensAPIAllowListTarget
type to represent resource targets in the format<type>:<id>
with support for wildcardsAPIKeyEffectiveScope
that merges API key scopes with allow list restrictionsThis feature enables creating tokens that are limited to specific resources (like workspaces or templates) by ID, making it possible to create more granular API tokens with limited access.