mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
Fix issue with SQL Database Projects unable to connect due to default encryption (#21010)
This commit is contained in:
@@ -47,7 +47,6 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
this.groupFullName = model.groupFullName;
|
||||
this.savePassword = model.savePassword;
|
||||
this.saveProfile = model.saveProfile;
|
||||
|
||||
this.azureTenantId = model.azureTenantId;
|
||||
|
||||
// Special case setting properties to support both IConnectionProfile and azdata.connection.ConnectionProfile
|
||||
@@ -68,6 +67,13 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
let appNameKey = appNameOption.name;
|
||||
this.options[appNameKey] = Constants.applicationName;
|
||||
}
|
||||
// Set values for advanced options received in model.
|
||||
Object.keys(model.options).forEach(a => {
|
||||
let option = options.find(opt => opt.name === a);
|
||||
if (option !== undefined) {
|
||||
this.options[option.name] = model.options[a];
|
||||
}
|
||||
});
|
||||
}
|
||||
if (model.options.registeredServerDescription) {
|
||||
this.registeredServerDescription = model.options.registeredServerDescription;
|
||||
|
||||
@@ -44,7 +44,10 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
||||
groupFullName: 'g2/g2-2',
|
||||
groupId: 'group id',
|
||||
providerId: mssqlProviderName,
|
||||
options: {},
|
||||
options: {
|
||||
'encrypt': true,
|
||||
'trustServerCertificate': true
|
||||
},
|
||||
saveProfile: true,
|
||||
connectionId: 'my id'
|
||||
};
|
||||
@@ -137,7 +140,33 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.password,
|
||||
valueType: ServiceOptionType.string
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'encrypt',
|
||||
displayName: undefined!,
|
||||
description: undefined!,
|
||||
groupName: undefined!,
|
||||
categoryValues: undefined!,
|
||||
defaultValue: "true",
|
||||
isIdentity: false,
|
||||
showOnConnectionDialog: true,
|
||||
isRequired: false,
|
||||
specialValueType: undefined,
|
||||
valueType: ServiceOptionType.boolean
|
||||
},
|
||||
{
|
||||
name: 'trustServerCertificate',
|
||||
displayName: undefined!,
|
||||
description: undefined!,
|
||||
groupName: undefined!,
|
||||
categoryValues: undefined!,
|
||||
defaultValue: "false",
|
||||
isIdentity: false,
|
||||
showOnConnectionDialog: true,
|
||||
isRequired: false,
|
||||
specialValueType: undefined,
|
||||
valueType: ServiceOptionType.boolean
|
||||
},
|
||||
];
|
||||
msSQLCapabilities = {
|
||||
providerId: mssqlProviderName,
|
||||
@@ -199,6 +228,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
||||
assert.strictEqual(conn.groupFullName, connectionProfile.groupFullName);
|
||||
assert.strictEqual(conn.savePassword, connectionProfile.savePassword);
|
||||
assert.strictEqual(conn.providerName, connectionProfile.providerId);
|
||||
assert.strictEqual(conn.options['encrypt'], connectionProfile.options['encrypt']);
|
||||
assert.strictEqual(conn.options['trustServerCertificate'], connectionProfile.options['trustServerCertificate']);
|
||||
});
|
||||
|
||||
test('getOptionsKey should create a valid unique id', () => {
|
||||
|
||||
Reference in New Issue
Block a user