Migrate Posit AI auth from Assistant to Authentication#12681
Open
melissa-barca wants to merge 6 commits intomainfrom
Open
Migrate Posit AI auth from Assistant to Authentication#12681melissa-barca wants to merge 6 commits intomainfrom
melissa-barca wants to merge 6 commits intomainfrom
Conversation
|
E2E Tests 🚀 |
Move the OAuth 2.0 Device Authorization Grant flow for Posit AI from positron-assistant into the centralized authentication extension. - Add PositOAuthProvider implementing vscode.AuthenticationProvider with device code flow, token refresh, and cancellation support - Route oauth-signin/oauth-signout through createSession/removeSession - Widen authProviders map to vscode.AuthenticationProvider to support both AuthProvider (API key) and PositOAuthProvider (OAuth) - Update positron-assistant to consume tokens via vscode.authentication - Register posit-ai in trustedExtensionAuthAccess
f1fa2d0 to
d4f5e0d
Compare
d7c8c88 to
f37897b
Compare
The oauth-signin and oauth-signout cases for copilot-auth were accidentally removed when migrating Posit AI OAuth to the auth extension.
PositOAuthProvider now extends the generic AuthProvider class instead of implementing vscode.AuthenticationProvider directly. This lets the config dialog treat it uniformly alongside API-key and credential-chain providers using hasAuthProvider boolean checks instead of instanceof. - Make AuthProvider.context protected and add fireSessionsChanged() - Revert configDialog.ts map type to Map<string, AuthProvider> - Revert handleSave/handleDelete to look up providers internally
handleSave already calls createSession when no API key is present, and handleDelete already removes all sessions. No need to duplicate that logic in the oauth cases.
Keep only getAccessToken tests which cover the meaningful token refresh logic. The removed tests just verified delegation to the base class.
georgestagg
approved these changes
Mar 27, 2026
| ), | ||
| provider | ||
| ); | ||
| registerAuthProvider(POSIT_AUTH_PROVIDER_ID, provider); |
Contributor
There was a problem hiding this comment.
Nit: Here the provider ID is a constant, but above (e.g. 'anthropic-api') IDs are just used inline.
I know this has just come from the older code, and it does not matter for behaviour, but we should probably try to be consistent either way.
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
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
Sign in/Sign out for Posit AI should continue to work without interruption, but model resolution will now happen after the Configure Language Model Provider modal is closed and auth information will be logged to Authentication.
@:assistant