Add support for Encrypt=Strict for TDS 8.0 connections with SQL Server 2022 (#21256)

This commit is contained in:
Cheena Malhotra
2023-02-10 10:34:36 -08:00
committed by GitHub
parent c75628639c
commit 3fb8d57d25
13 changed files with 256 additions and 24 deletions

View File

@@ -57,6 +57,20 @@ export enum AuthenticationType {
None = 'None'
}
/*
* Actions for the connection dialog to show/hide connection options.
*/
export enum Actions {
/**
* Shows a connection option
*/
Show = 'show',
/**
* Hides a connection option
*/
Hide = 'hide'
}
/* CMS constants */
export const cmsProviderName = 'MSSQL-CMS';

View File

@@ -214,6 +214,21 @@ suite('SQL ProviderConnectionInfo tests', () => {
assert.strictEqual(conn.options['encrypt'], 'true');
});
test('constructor should initialize the options with encrypt strict', () => {
let options: { [key: string]: string } = {};
options['encrypt'] = 'strict';
let conn2 = Object.assign({}, connectionProfile, { options: options });
let conn = new ProviderConnectionInfo(capabilitiesService, conn2);
assert.strictEqual(conn.connectionName, conn2.connectionName);
assert.strictEqual(conn.serverName, conn2.serverName);
assert.strictEqual(conn.databaseName, conn2.databaseName);
assert.strictEqual(conn.authenticationType, conn2.authenticationType);
assert.strictEqual(conn.password, conn2.password);
assert.strictEqual(conn.userName, conn2.userName);
assert.strictEqual(conn.options['encrypt'], 'strict');
});
test('getOptionsKey should create a valid unique id', () => {
let conn = new ProviderConnectionInfo(capabilitiesService, connectionProfile);
// **IMPORTANT** This should NEVER change without thorough review and consideration of side effects. This key controls