Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
ThomasK33 wants to merge1 commit intothomask33/09-29-feat_typed_rbac_allow_list
base:thomask33/09-29-feat_typed_rbac_allow_list
Choose a base branch
Loading
fromthomask33/09-29-feat_legacy_apikey_backcompat

Conversation

ThomasK33
Copy link
Member

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:

  • Added a test helperLegacyToken to create API keys that mimic pre-migration database structure
  • Implemented automatic expansion of empty scopes tocoder:all in the API key conversion logic
  • Added tests to verify that legacy tokens work correctly with the new scopes system
  • Ensured legacy tokens can be updated using the legacy scope field

This maintains compatibility with older API keys while preserving the new scopes functionality.

This was referencedSep 29, 2025
@ThomasK33Graphite App
Copy link
MemberAuthor

ThomasK33 commentedSep 29, 2025
edited
Loading

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.
Learn more

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ThomasK33ThomasK33 linked an issueSep 29, 2025 that may beclosed by this pull request
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromf38d137 tof8cddd7CompareSeptember 30, 2025 11:03
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from9c44c4f tob11c4e8CompareSeptember 30, 2025 11:03
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch fromb11c4e8 to0d9e60aCompareSeptember 30, 2025 11:14
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently from52770fc to8390b78CompareSeptember 30, 2025 13:04
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from0d9e60a to90528a2CompareSeptember 30, 2025 13:04
@ThomasK33ThomasK33 marked this pull request as ready for reviewSeptember 30, 2025 13:35
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch from8390b78 tocb4f67cCompareSeptember 30, 2025 14:02
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from90528a2 toa3e10c2CompareSeptember 30, 2025 14:02
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromcb4f67c tobc0acfcCompareOctober 1, 2025 13:56
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch froma3e10c2 to5058a5aCompareOctober 1, 2025 13:56
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch frombc0acfc toc410a2cCompareOctober 2, 2025 07:35
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from5058a5a toa482459CompareOctober 2, 2025 07:35
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromc410a2c to696cc1dCompareOctober 2, 2025 17:37
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch froma482459 to5e55406CompareOctober 2, 2025 17:37
@Emyrk
Copy link
Member

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.

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.

@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch 2 times, most recently fromecdebc1 tob07d6f5CompareOctober 6, 2025 09:42
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently from4bb9040 tocc44d1cCompareOctober 6, 2025 10:12
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch 2 times, most recently from31570ef toab61e4eCompareOctober 6, 2025 10:48
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromcc44d1c to4c9762eCompareOctober 6, 2025 10:48
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch fromab61e4e to009ef1cCompareOctober 6, 2025 11:24
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch from4c9762e toc9ad043CompareOctober 6, 2025 11:24
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from009ef1c tof5bfb50CompareOctober 6, 2025 11:57
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromc9ad043 to610e5e7CompareOctober 6, 2025 11:57
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch fromf5bfb50 to5da9aa2CompareOctober 6, 2025 13:30
@EmyrkEmyrk self-assigned thisOct 6, 2025
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from5da9aa2 to2307d62CompareOctober 6, 2025 21:16
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently from14537db tofd7df7cCompareOctober 6, 2025 21:40
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from2307d62 tod7b29daCompareOctober 6, 2025 21:40
This 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.
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch fromd7b29da to2d313efCompareOctober 7, 2025 16:38
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromfd7df7c to80f543aCompareOctober 7, 2025 16:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@EmyrkEmyrkAwaiting requested review from Emyrk

@mafredrimafredriAwaiting requested review from mafredri

Assignees

@ThomasK33ThomasK33

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Backward compatibility tests and fixtures
2 participants
@ThomasK33@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp