remove password for connection string non sql auth types (#19484)

* remove password for connection string non sql auth types

* add comment

* fix test
This commit is contained in:
Vasu Bhog
2022-05-23 16:01:55 -07:00
committed by GitHub
parent c9c670cc86
commit e1fc230273
2 changed files with 7 additions and 1 deletions

View File

@@ -578,6 +578,12 @@ export async function promptConnectionStringPasswordAndUpdateConnectionString(co
// or user chooses to not include password (or if user cancels out of include password prompt), or authentication type is not SQL login
connectionString = await vscodeMssqlApi.getConnectionString(connectionDetails, false, false);
if (connectionInfo.authenticationType !== 'SqlLogin') {
// temporarily fix until STS is fix to not include the placeholder: https://github.com/microsoft/sqltoolsservice/issues/1508
// if authentication type is not SQL login, remove password in connection string
connectionString = connectionString.replace(`Password=${constants.passwordPlaceholder};`, '');
}
if (!connectionInfo.password && connectionInfo.authenticationType === 'SqlLogin') {
// if a connection exists but does not have password saved we ask user if they would like to enter it and save it in local.settings.json
userPassword = await vscode.window.showInputBox({