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

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

@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 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 2 times, most recently fromd7b29da to2d313efCompareOctober 7, 2025 16:38
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently from80f543a toc18adc2CompareOctober 9, 2025 12:56
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch from2d313ef tod34dbe8CompareOctober 9, 2025 12:57
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_typed_rbac_allow_list branch fromc18adc2 todda7c9aCompareOctober 9, 2025 13:06
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_legacy_apikey_backcompat branch fromd34dbe8 to47cccd7CompareOctober 9, 2025 13:06
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 9, 2025
@ThomasK33ThomasK33 deleted the thomask33/09-29-feat_legacy_apikey_backcompat branchOctober 9, 2025 15:37
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

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