Migrate Posit AI auth from Assistant to Authentication#12681
Draft
melissa-barca wants to merge 8 commits intomainfrom
Draft
Migrate Posit AI auth from Assistant to Authentication#12681melissa-barca wants to merge 8 commits intomainfrom
melissa-barca wants to merge 8 commits intomainfrom
Conversation
…nsion Move the OAuth 2.0 Device Authorization Grant flow for Posit AI from the positron-assistant extension into the centralized authentication extension, following the same pattern used for API key providers. - Add PositOAuthProvider implementing vscode.AuthenticationProvider with device code flow, atomic token storage, sequenced refresh, and cancellation support - Route oauth-signin/oauth-signout through createSession/removeSession instead of a separate OAuthService interface - Register posit-ai in product.json trustedExtensionAuthAccess - Update positron-assistant to consume tokens via vscode.authentication API and read baseUrl from workspace config - Use provider id as config id for OAuth so sessions match on reload - Add tests for getSessions, removeSession, getAccessToken, token validation, and refresh serialization
When a refresh token is rejected with invalid_grant, fire the removed event so session change listeners are notified.
The auth extension now returns 'save'/'delete' actions instead of 'oauth-signin'/'oauth-signout', so the assistant handles OAuth providers through the same code path as API key providers.
Drop 5 tests that duplicate getAccessToken coverage through the getSessions wrapper, test trivial empty-array behavior, or just verify optional chaining doesn't throw.
The settings were never declared in package.json on either extension, so VS Code rejects the write with "not a registered configuration." Since users never had these values set, there is nothing to migrate.
|
E2E Tests 🚀 |
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.
Next piece of #12374
This PR will be moved out of draft only after #12659 is merged. Then I will pull main into this branch and clean up any conflicts. #12659 has some architectural changes this PR relies on.
Migrates Posit AI oauth from Positron Assistant to the Authentication extension. The settings changed from
positron.assistant.positaitoauthentication.positai, but since they have not been formally declared they cannot be migrated.QA Notes
@:assistant