mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user