TA-4919: Change profile creation logic for oAuth#314
Open
Buqeta (Buqeta) wants to merge 6 commits intomasterfrom
Open
TA-4919: Change profile creation logic for oAuth#314Buqeta (Buqeta) wants to merge 6 commits intomasterfrom
Buqeta (Buqeta) wants to merge 6 commits intomasterfrom
Conversation
|
Meris Nici (promeris)
previously approved these changes
Mar 2, 2026
Zgjim Haziri (ZgjimHaziri)
previously approved these changes
Mar 2, 2026
c9b0203
Laberion Ajvazi (LaberionAjvazi)
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
1. Client credentials – scope handling
Before: One fixed scope list was sent with the token request. If any scope was invalid for the client, the grant failed and profile creation could fail or crash (e.g. reading access_token from undefined).
After: The CLI tries all 15 non-empty scope combinations (via getScopeCombinationsOrderedBySize), in order: 4 scopes → all 3-scope → all 2-scope → all 1-scope. The first successful grant is used. Stored scopes come from the token response (or the requested list as fallback). If both basic and post auth fail, profile creation throws instead of storing a broken profile.
Reasoning: This change was done for 2 reasons:
2. Device code – scope handling
3. Scope source of truth
4. Other
Relevant links
Checklist