Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions extensions/authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"onAuthenticationRequest:google",
"onAuthenticationRequest:google-cloud",
"onAuthenticationRequest:deepseek-api",
"onAuthenticationRequest:databricks",
"onCommand:authentication.configureProviders",
"onCommand:authentication.migrateApiKey"
],
Expand Down Expand Up @@ -73,6 +74,10 @@
{
"id": "deepseek-api",
"label": "DeepSeek"
},
{
"id": "databricks",
"label": "Databricks"
}
],
"commands": [
Expand Down Expand Up @@ -278,6 +283,32 @@
"experimental"
]
},
"authentication.databricks.credentials": {
"type": "object",
"default": {},
"markdownDescription": "%configuration.databricks.credentials.description%",
"properties": {
"DATABRICKS_HOST": {
"type": "string",
"default": null
}
},
"additionalProperties": false,
"tags": [
"experimental"
]
},
"authentication.databricks.customHeaders": {
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
},
"markdownDescription": "%configuration.databricks.customHeaders.description%",
"tags": [
"experimental"
]
},
"assistant.provider.googleVertex.enabled": {
"type": "boolean",
"default": true,
Expand All @@ -294,6 +325,14 @@
"experimental"
]
},
"assistant.provider.databricks.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "%configuration.provider.databricks.enabled.description%",
"tags": [
"experimental"
]
},
"positron.assistant.provider.anthropic.enable": {
"type": "boolean",
"default": true,
Expand Down
3 changes: 3 additions & 0 deletions extensions/authentication/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"configuration.openai-compatible.customHeaders.description": "Extra HTTP headers attached to every OpenAI-compatible request. Useful for enterprise gateways that require tenancy or routing headers. Entries may override internal headers and break the connection.",
"configuration.deepseek-api.baseUrl.description": "Custom DeepSeek API base URL. Overrides the default https://api.deepseek.com endpoint. Also set automatically from the DEEPSEEK_BASE_URL environment variable.",
"configuration.deepseek-api.customHeaders.description": "Extra HTTP headers attached to every DeepSeek request. Useful for enterprise gateways that require tenancy or routing headers. Entries may override internal headers and break the connection.",
"configuration.databricks.credentials.description": "Variables used to configure the Databricks provider.\n\nExample: to set the Databricks workspace, add an item with key `DATABRICKS_HOST` and the workspace URL as the value.",
"configuration.databricks.customHeaders.description": "Extra HTTP headers attached to every Databricks request. Useful for enterprise gateways that require tenancy or routing headers. Entries may override internal headers and break the connection.",
"configuration.provider.databricks.enabled.description": "Enable Databricks as a language model provider for Positron's AI features.\n\nAuthenticate to the provider in the [language model provider dialog](command:authentication.configureProviders?%5B%7B%22preselectedProviderId%22%3A%22databricks%22%7D%5D).",
"configuration.provider.googleVertex.enabled.description": "Enable Gemini Enterprise Agent Platform (formerly Google Vertex AI) as a language model provider for Positron's AI features.\n\nRestart Positron for the changes to take effect. Then, authenticate to the provider in the [language model provider dialog](command:authentication.configureProviders?%5B%7B%22preselectedProviderId%22%3A%22google-cloud%22%7D%5D).",
"configuration.provider.deepseek.enabled.description": "Enable DeepSeek as a language model provider for Positron's AI features.\n\nAuthenticate to the provider in the [language model provider dialog](command:authentication.configureProviders?%5B%7B%22preselectedProviderId%22%3A%22deepseek-api%22%7D%5D).",
"configuration.provider.anthropic.enable.description": "Enable Anthropic as a language model provider for Positron's AI features.\n\nRestart Positron for the changes to take effect. Then, authenticate to the provider in the [language model provider dialog](command:authentication.configureProviders?%5B%7B%22preselectedProviderId%22%3A%22anthropic-api%22%7D%5D).",
Expand Down
7 changes: 7 additions & 0 deletions extensions/authentication/src/authProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ export class AuthProvider
return !!this.credentialChain?.preventSignOut;
}

/**
* Cancel an in-flight interactive sign-in, if the provider supports
* one (e.g. OAuth providers). The config dialog calls this when the
* user cancels.
*/
cancelSignIn?(): void;

/** Expose session-change events. */
fireSessionsChanged(
event: vscode.AuthenticationProviderAuthenticationSessionsChangeEvent
Expand Down
5 changes: 1 addition & 4 deletions extensions/authentication/src/configDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as vscode from 'vscode';
import * as positron from 'positron';
import { randomUUID } from 'crypto';
import { AuthProvider } from './authProvider';
import { PositOAuthProvider } from './positOAuthProvider';
import { FOUNDRY_AUTH_PROVIDER_ID } from './constants';
import { log } from './log';
import { FOUNDRY_MANAGED_CREDENTIALS, SNOWFLAKE_MANAGED_CREDENTIALS, hasManagedCredentials } from './managedCredentials';
Expand Down Expand Up @@ -175,9 +174,7 @@ export async function providerAction(
}
case 'cancel': {
const provider = authProviders.get(providerId);
if (provider instanceof PositOAuthProvider) {
provider.cancelSignIn();
}
provider?.cancelSignIn?.();
break;
}
default:
Expand Down
6 changes: 6 additions & 0 deletions extensions/authentication/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ export const CUSTOM_PROVIDER_AUTH_PROVIDER_ID = 'openai-compatible';
export const GEMINI_AUTH_PROVIDER_ID = 'google';
export const GOOGLE_CLOUD_AUTH_PROVIDER_ID = 'google-cloud';
export const DEEPSEEK_AUTH_PROVIDER_ID = 'deepseek-api';
export const DATABRICKS_AUTH_PROVIDER_ID = 'databricks';

export const DATABRICKS_OAUTH_CLIENT_ID = 'databricks-cli';
export const DATABRICKS_OAUTH_REDIRECT_PORT = 8020;
export const DATABRICKS_OAUTH_REDIRECT_URI = 'http://localhost:8020';
export const DATABRICKS_OAUTH_SCOPES = 'all-apis offline_access';
Loading
Loading