Skip to content

Commit 41ca392

Browse files
authored
List profiles with all auth methods (#1027)
## Changes JS SDK now supports all auth methods so we no longer have to filter out unsupported auth methods. With the bump of the SDK this PR also adds support for Databricks OAuth U2M on Azure and GCP. ## Tests Manually tests
1 parent abaa30b commit 41ca392

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

packages/databricks-vscode/src/cli/CliWrapper.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ export class CliWrapper {
132132
return [];
133133
}
134134

135-
const profiles = JSON.parse(res.stdout).profiles || [];
135+
let profiles = JSON.parse(res.stdout).profiles || [];
136+
137+
// filter out account profiles
138+
profiles = profiles.filter((p: any) => !p.account_id);
139+
136140
const result = [];
137141

138142
for (const profile of profiles) {

packages/databricks-vscode/src/configuration/configureWorkspaceWizard.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,7 @@ async function listProfiles(cliWrapper: CliWrapper) {
209209
}
210210
});
211211

212-
return profiles.filter((profile) => {
213-
return [
214-
"pat",
215-
"basic",
216-
"azure-cli",
217-
"oauth-m2m",
218-
"azure-client-secret",
219-
].includes(profile.authType);
220-
});
212+
return profiles;
221213
}
222214

223215
async function validateDatabricksHost(
@@ -243,11 +235,11 @@ async function validateDatabricksHost(
243235

244236
function authMethodsForHostname(host: URL): Array<AuthType> {
245237
if (isAzureHost(host)) {
246-
return ["azure-cli", "profile"];
238+
return ["databricks-cli", "azure-cli", "profile"];
247239
}
248240

249241
if (isGcpHost(host)) {
250-
return ["google-id", "profile"];
242+
return ["databricks-cli", "google-id", "profile"];
251243
}
252244

253245
if (isAwsHost(host)) {

0 commit comments

Comments
 (0)