Remove ADAL Code (#23360)

* initial commit, removed all adal code

* remove all authLibrary references in extension/azurecore

* removed authLibrary references from src/sql

* remove MSAL/ADAL setting option

* wip fixing tests and removing Msal from method names

* fixed tests

* create accountInfo mock

* fix tests

* fix clientApplication mock

* remove clientapplication

* fix compile

* add typing

* wip

* wip

* wip

* fix tree provider

* remove SimpleTokenCache, FileDatabase & tests

* remove remaining adal / authentication library references:

* remove comma from package.nls.json

* fix error fetching subscriptions

* fix tests

* remove getAzureAuthenticationLibraryConfig

* remove adal check

* fix build

* remove test

* undo remove customProviderSettings

* fix bracket
This commit is contained in:
Christopher Suh
2023-07-20 10:37:38 -07:00
committed by GitHub
parent a2b1c2cfc5
commit 91359a32c9
36 changed files with 168 additions and 1849 deletions

View File

@@ -8,35 +8,17 @@ import * as vscode from 'vscode';
const mssqlExtensionConfigName = 'mssql';
const enableSqlAuthenticationProviderConfig = 'enableSqlAuthenticationProvider';
const azureExtensionConfigName = 'azure';
const azureAuthenticationLibraryConfig = 'authenticationLibrary';
const MSAL = 'MSAL';
/**
* @returns 'True' if MSAL auth library is in use and SQL Auth provider is enabled.
* @returns 'True' if SQL Auth provider is enabled.
*/
export function isMssqlAuthProviderEnabled(): boolean {
return getAzureAuthenticationLibraryConfig() === MSAL && getEnableSqlAuthenticationProviderConfig();
return getEnableSqlAuthenticationProviderConfig();
}
export function getConfiguration(config: string): vscode.WorkspaceConfiguration {
return vscode.workspace.getConfiguration(config);
}
/**
* Reads setting 'azure.AuthenticationLibrary' and returns the library name enabled.
* @returns MSAL | ADAL
*/
export function getAzureAuthenticationLibraryConfig(): string {
const config = getConfiguration(azureExtensionConfigName);
if (config) {
return config.get<string>(azureAuthenticationLibraryConfig, MSAL); // default Auth library
}
else {
return MSAL; // default Auth library
}
}
/**
* Reads setting 'mssql.enableSqlAuthenticationProvider' and returns true if it's enabled.
* @returns True Sql Auth provider is enabled for MSSQL provider.