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

@@ -23,8 +23,6 @@ const enableSqlAuthenticationProviderConfig = 'enableSqlAuthenticationProvider';
const enableConnectionPoolingConfig = 'enableConnectionPooling';
const tableDesignerPreloadConfig = 'tableDesigner.preloadDatabaseModel';
const azureExtensionConfigName = 'azure';
const azureAuthenticationLibraryConfig = 'authenticationLibrary';
/**
*
* @returns Whether the current OS is linux or not
@@ -68,16 +66,6 @@ export function removeOldLogFiles(logPath: string, prefix: string): JSON {
export function getConfiguration(config: string = extensionConfigSectionName): vscode.WorkspaceConfiguration {
return vscode.workspace.getConfiguration(config);
}
/**
* We need Azure core extension configuration for fetching Authentication Library setting in use.
* This is required for 'enableSqlAuthenticationProvider' to be enabled (as it applies to MSAL only).
* This can be removed in future when ADAL support is dropped.
* @param config Azure core extension configuration section name
* @returns Azure core extension config section
*/
export function getAzureCoreExtConfiguration(config: string = azureExtensionConfigName): vscode.WorkspaceConfiguration {
return vscode.workspace.getConfiguration(config);
}
export function getConfigLogFilesRemovalLimit(): number | undefined {
let config = getConfiguration();
@@ -157,16 +145,6 @@ export function getParallelMessageProcessingConfig(): boolean {
return (azdata.env.quality === azdata.env.AppQuality.dev && setting?.globalValue === undefined && setting?.workspaceValue === undefined) ? true : config[parallelMessageProcessingConfig];
}
export function getAzureAuthenticationLibraryConfig(): string {
const config = getAzureCoreExtConfiguration();
if (config) {
return config.get<string>(azureAuthenticationLibraryConfig, 'MSAL'); // default Auth library
}
else {
return 'MSAL';
}
}
/**
* Retrieves configuration `mssql:enableSqlAuthenticationProvider` from settings file.
* @returns true if setting is enabled in ADS, false otherwise.