- Notifications
You must be signed in to change notification settings - Fork1k
feat: add legacy API key scope compatibility#20021
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:thomask33/09-29-feat_typed_rbac_allow_list
Are you sure you want to change the base?
feat: add legacy API key scope compatibility#20021
Conversation
ThomasK33 commentedSep 29, 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.
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stackon Graphite.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
f38d137
tof8cddd7
Compare9c44c4f
tob11c4e8
Compareb11c4e8
to0d9e60a
Compare52770fc
to8390b78
Compare0d9e60a
to90528a2
Compare8390b78
tocb4f67c
Compare90528a2
toa3e10c2
Comparecb4f67c
tobc0acfc
Comparea3e10c2
to5058a5a
Comparebc0acfc
toc410a2c
Compare5058a5a
toa482459
Comparec410a2c
to696cc1d
Comparea482459
to5e55406
Compare
Don't we have a migration to update these scopes + allow lists to convert them to the new api key? Our customers get release by release, so there should be no window after the migration where the old api keys are created. |
ecdebc1
tob07d6f5
Compare4bb9040
tocc44d1c
Compare31570ef
toab61e4e
Comparecc44d1c
to4c9762e
Compareab61e4e
to009ef1c
Compare4c9762e
toc9ad043
Compare009ef1c
tof5bfb50
Comparec9ad043
to610e5e7
Comparef5bfb50
to5da9aa2
Compare5da9aa2
to2307d62
Compare14537db
tofd7df7c
Compare2307d62
tod7b29da
CompareThis change introduces backwards compatibility for API keys createdbefore the scopes and allow-lists feature.Previously, these legacy keys had empty scope and allow-listdefinitions in the database. They are now dynamically interpreted ashaving `coder:all` scope, granting them full access. This ensures thatold, unscoped tokens continue to function as they did before theintroduction of fine-grained permissions.
d7b29da
to2d313ef
Comparefd7df7c
to80f543a
Compare
Add legacy API key compatibility
This PR adds support for legacy API keys that were created before the scopes migration. It ensures that API keys with empty scopes and allow lists are properly expanded to have full access permissions, maintaining backward compatibility.
Key changes:
LegacyToken
to create API keys that mimic pre-migration database structurecoder:all
in the API key conversion logicThis maintains compatibility with older API keys while preserving the new scopes functionality.