Modify connection management to support Active Directory authType for non-SQL DBs (#8434)

* First attempt to add Azure MFA login for PostgreSQL

* Finish merge with master

* Fix auth type default selection

* Add AzureMFAAndUser auth type for Orcas

* Fix formatting

* Update change log

* Incorporate some review comments

* Missed an occurrence of AzureResource

* Try to move all changes out of azdata.d.ts and sqlops.d.ts

* Concrete implementation of ConnectionProfile in azdata no longer has azureAccount

* Use enum names instead of numbers in config files
This commit is contained in:
Rich Smith
2019-11-26 10:32:59 -08:00
committed by Karl Burtram
parent d9997cebfc
commit b631530753
20 changed files with 231 additions and 52 deletions

View File

@@ -44,7 +44,8 @@ export interface IAccountManagementService {
// Enum matching the AzureResource enum from azdata.d.ts
export enum AzureResource {
ResourceManagement = 0,
Sql = 1
Sql = 1,
OssRdbms = 2
}
export interface IAccountStore {

View File

@@ -20,6 +20,7 @@ export const clientCapabilities = {
export interface ConnectionProviderProperties {
providerId: string;
displayName: string;
azureResource?: string;
connectionOptions: azdata.ConnectionOption[];
}

View File

@@ -43,6 +43,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
this.saveProfile = model.saveProfile;
this._id = model.id;
this.azureTenantId = model.azureTenantId;
this.azureAccount = model.azureAccount;
if (this.capabilitiesService && model.providerName) {
let capabilities = this.capabilitiesService.getCapabilities(model.providerName);
if (capabilities && capabilities.connection && capabilities.connection.connectionOptions) {
@@ -112,6 +113,14 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
this.options['azureTenantId'] = value;
}
public get azureAccount(): string | undefined {
return this.options['azureAccount'];
}
public set azureAccount(value: string | undefined) {
this.options['azureAccount'] = value;
}
public get registeredServerDescription(): string {
return this.options['registeredServerDescription'];
}
@@ -196,7 +205,8 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
options: this.options,
saveProfile: this.saveProfile,
id: this.id,
azureTenantId: this.azureTenantId
azureTenantId: this.azureTenantId,
azureAccount: this.azureAccount
};
return result;

View File

@@ -24,6 +24,7 @@ export const passwordChars = '***************';
export const sqlLogin = 'SqlLogin';
export const integrated = 'Integrated';
export const azureMFA = 'AzureMFA';
export const azureMFAAndUser = 'AzureMFAAndUser';
/* CMS constants */
export const cmsProviderName = 'MSSQL-CMS';