mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 17:23:10 -05:00
Connection URI with complete options (finalized) (#22735)
* Connection URI made to include every option available instead of basic details (#22045) * Revert "Merge remote-tracking branch 'origin' into feat/connectionUri" This reverts commit 11b2d31bf99e216daee823f732254f69a017fee1, reversing changes made to 36e4db8c0744f81565efdfd2f56a3ae3c0026896. * Revert "Revert "Merge remote-tracking branch 'origin' into feat/connectionUri"" This reverts commit f439673c2693e1144c52e04c14e82cd8566c13a6. * Added changes and fixes for feat connectionuri (#22706) * add title generation at start * added await to refreshConnectionTreeTitles
This commit is contained in:
@@ -67,6 +67,7 @@ export class ConnectionStore {
|
||||
}
|
||||
|
||||
cred.push(CRED_ITEMTYPE_PREFIX.concat(itemType));
|
||||
// Use basic info for credentials so that passwords can be shared among similar profiles for now.
|
||||
cred.push(CRED_ID_PREFIX.concat(connectionProfileInstance.getConnectionInfoId()));
|
||||
return cred.join(CRED_SEPARATOR);
|
||||
}
|
||||
@@ -149,6 +150,17 @@ export class ConnectionStore {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if a connection profile edit is not identical to an existing saved profile.
|
||||
*
|
||||
* @param profile the profile group that is being edited.
|
||||
* @param matcher the profile matching function for the actual connection we want to edit.
|
||||
* @returns a boolean value indicating if there's an identical profile to the edit.
|
||||
*/
|
||||
public isDuplicateEdit(profile: IConnectionProfile, matcher?: ProfileMatcher): Promise<boolean> {
|
||||
return this.connectionConfig.isDuplicateEdit(profile, matcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of recently used connections. These will not include the password - a separate call to
|
||||
* {addSavedPassword} is needed to fill that before connecting
|
||||
@@ -217,7 +229,7 @@ export class ConnectionStore {
|
||||
|
||||
// Remove the connection from the list if it already exists
|
||||
list = list.filter(value => {
|
||||
let equal = value && value.getConnectionInfoId() === savedProfile.getConnectionInfoId();
|
||||
let equal = value && value.getConnectionInfoId(false) === savedProfile.getConnectionInfoId(false);
|
||||
if (equal && savedProfile.saveProfile) {
|
||||
equal = value.groupId === savedProfile.groupId ||
|
||||
ConnectionProfileGroup.sameGroupName(value.groupFullName, savedProfile.groupFullName);
|
||||
@@ -235,7 +247,7 @@ export class ConnectionStore {
|
||||
|
||||
// Remove the connection from the list if it already exists
|
||||
list = list.filter(value => {
|
||||
let equal = value && value.getConnectionInfoId() === savedProfile.getConnectionInfoId();
|
||||
let equal = value && value.getConnectionInfoId(false) === savedProfile.getConnectionInfoId(false);
|
||||
if (equal && savedProfile.saveProfile) {
|
||||
equal = value.groupId === savedProfile.groupId ||
|
||||
ConnectionProfileGroup.sameGroupName(value.groupFullName, savedProfile.groupFullName);
|
||||
@@ -270,6 +282,8 @@ export class ConnectionStore {
|
||||
|
||||
private doSavePassword(conn: IConnectionProfile): Promise<boolean> {
|
||||
if (conn.password) {
|
||||
// Credentials are currently shared between profiles with the same basic details.
|
||||
// Credentials are currently not cleared upon deletion of a profile.
|
||||
const credentialId = this.formatCredentialId(conn);
|
||||
return this.credentialService.saveCredential(credentialId, conn.password);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user