mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
[Release/1.45] Fix connection URI default value comparisons (#23775)
* Fix connection URI default value comparisons (#23705) * Bump STS
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "4.8.0.39",
|
"version": "4.8.1.1",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-net7.0.zip",
|
"Windows_86": "win-x86-net7.0.zip",
|
||||||
"Windows_64": "win-x64-net7.0.zip",
|
"Windows_64": "win-x64-net7.0.zip",
|
||||||
|
|||||||
@@ -359,10 +359,10 @@ export class ConnectionConfig {
|
|||||||
let profiles = this.getIConnectionProfileStores(true);
|
let profiles = this.getIConnectionProfileStores(true);
|
||||||
let existingProfile = profiles.find(p =>
|
let existingProfile = profiles.find(p =>
|
||||||
p.providerName === profile.providerName &&
|
p.providerName === profile.providerName &&
|
||||||
p.options.authenticationType === profile.options.authenticationType &&
|
this.checkIfAuthenticationOptionsMatch(p, profile) &&
|
||||||
p.options.database === profile.options.database &&
|
p.options.databaseName === profile.options.databaseName &&
|
||||||
p.options.server === profile.options.server &&
|
p.options.serverName === profile.options.serverName &&
|
||||||
p.options.user === profile.options.user &&
|
p.options.userName === profile.options.userName &&
|
||||||
p.options.connectionName === profile.options.connectionName &&
|
p.options.connectionName === profile.options.connectionName &&
|
||||||
p.groupId === newGroupID &&
|
p.groupId === newGroupID &&
|
||||||
this.checkIfNonDefaultOptionsMatch(p, profile));
|
this.checkIfNonDefaultOptionsMatch(p, profile));
|
||||||
@@ -375,6 +375,10 @@ export class ConnectionConfig {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private checkIfAuthenticationOptionsMatch(profileStore: IConnectionProfileStore, profile: ConnectionProfile): boolean {
|
||||||
|
return ((profileStore.options.authenticationType === undefined || profileStore.options.authenticationType === '') && (profile.options.authenticationType === undefined || profile.options.authenticationType === '')) || profileStore.options.authenticationType === profile.options.authenticationType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the connection under the target group with the new ID.
|
* Moves the connection under the target group with the new ID.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
|||||||
// Set values for advanced options received in model.
|
// Set values for advanced options received in model.
|
||||||
Object.keys(model.options).forEach(a => {
|
Object.keys(model.options).forEach(a => {
|
||||||
let option = options.find(opt => opt.name === a);
|
let option = options.find(opt => opt.name === a);
|
||||||
if (option !== undefined) {
|
if (option !== undefined && option.defaultValue?.toString().toLocaleLowerCase() !== model.options[a]?.toString().toLocaleLowerCase()) {
|
||||||
this.options[option.name] = model.options[a];
|
this.options[option.name] = model.options[a];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -358,7 +358,11 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
|||||||
id: connectionInfo.id
|
id: connectionInfo.id
|
||||||
};
|
};
|
||||||
|
|
||||||
profile.options = connectionInfo.options;
|
Object.keys(connectionInfo.options).forEach(element => {
|
||||||
|
if (connectionInfo.options[element] && connectionInfo.options[element] !== null && connectionInfo.options[element] !== '') {
|
||||||
|
profile.options[element] = connectionInfo.options[element];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,8 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
let finalValue = undefined;
|
let finalValue = undefined;
|
||||||
let options = this.serverCapabilities.connectionOptions.filter(value => value.name === idNames[index]!);
|
let options = this.serverCapabilities.connectionOptions.filter(value => value.name === idNames[index]!);
|
||||||
if (options.length > 0 && value) {
|
if (options.length > 0 && value) {
|
||||||
finalValue = value !== options[0].defaultValue ? value : undefined;
|
let defaultValue = options[0].defaultValue ?? '';
|
||||||
|
finalValue = value && value.toString().toLocaleLowerCase() !== defaultValue.toString().toLocaleLowerCase() ? value : undefined;
|
||||||
if (options[0].specialValueType === 'appName' && this.providerName === Constants.mssqlProviderName) {
|
if (options[0].specialValueType === 'appName' && this.providerName === Constants.mssqlProviderName) {
|
||||||
finalValue = (value as string).startsWith('azdata') ? undefined : finalValue
|
finalValue = (value as string).startsWith('azdata') ? undefined : finalValue
|
||||||
}
|
}
|
||||||
@@ -390,7 +391,7 @@ export class ProviderConnectionInfo implements azdata.ConnectionInfo {
|
|||||||
element.specialValueType !== ConnectionOptionSpecialType.password) {
|
element.specialValueType !== ConnectionOptionSpecialType.password) {
|
||||||
if (getNonDefault) {
|
if (getNonDefault) {
|
||||||
let value = this.getOptionValue(element.name);
|
let value = this.getOptionValue(element.name);
|
||||||
if (value && value !== element.defaultValue) {
|
if (value && value.toString().toLocaleLowerCase() !== element.defaultValue?.toLocaleLowerCase()) {
|
||||||
connectionOptions.push(element);
|
connectionOptions.push(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: ''
|
authenticationType: 'SqlLogin'
|
||||||
},
|
},
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -95,7 +95,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: ''
|
authenticationType: 'SqlLogin'
|
||||||
},
|
},
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -108,7 +108,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: ''
|
authenticationType: 'SqlLogin'
|
||||||
},
|
},
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -296,7 +296,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: undefined,
|
groupFullName: undefined,
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
@@ -364,7 +364,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
@@ -509,7 +509,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -541,7 +541,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -580,7 +580,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'newid',
|
groupId: 'newid',
|
||||||
@@ -662,7 +662,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -681,7 +681,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -723,7 +723,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -745,7 +745,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -785,7 +785,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -807,7 +807,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -816,7 +816,10 @@ suite('ConnectionConfig', () => {
|
|||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
options: { 'testProperty1': 'nonDefault' },
|
options: {
|
||||||
|
'testProperty1': 'nonDefault',
|
||||||
|
'testProperty2': '10'
|
||||||
|
},
|
||||||
saveProfile: true,
|
saveProfile: true,
|
||||||
id: 'server3',
|
id: 'server3',
|
||||||
connectionName: undefined!
|
connectionName: undefined!
|
||||||
@@ -850,7 +853,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -872,7 +875,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -912,7 +915,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -1016,7 +1019,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
@@ -1035,7 +1038,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -1054,7 +1057,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -1090,7 +1093,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
@@ -1128,7 +1131,7 @@ suite('ConnectionConfig', () => {
|
|||||||
databaseName: 'database',
|
databaseName: 'database',
|
||||||
userName: 'user',
|
userName: 'user',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
authenticationType: '',
|
authenticationType: 'SqlLogin',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
|
|||||||
Reference in New Issue
Block a user