getCredentials returns credentials for any saved connection (#11029)

* getCredentials returns credentials for any saved connection

* Update doc comment

* Add tests

* cleanup

* cleanup
This commit is contained in:
Charles Gagnon
2020-06-23 11:04:13 -07:00
committed by GitHub
parent 29bf016fb8
commit a303144226
6 changed files with 59 additions and 14 deletions

View File

@@ -268,12 +268,12 @@ export interface IConnectionManagementService {
removeConnectionProfileCredentials(profile: IConnectionProfile): IConnectionProfile;
/**
* Get the credentials for a connected connection profile, as they would appear in the options dictionary
* Get the credentials for a connection profile, as they would appear in the options dictionary
* @param profileId The id of the connection profile to get the password for
* @returns A dictionary containing the credentials as they would be included
* in the connection profile's options dictionary, or undefined if the profile is not connected
* in the connection profile's options dictionary, or undefined if the profile was not found
*/
getActiveConnectionCredentials(profileId: string): { [name: string]: string };
getConnectionCredentials(profileId: string): Promise<{ [name: string]: string }>;
/**
* Get the ServerInfo for a connected connection profile

View File

@@ -259,8 +259,8 @@ export class TestConnectionManagementService implements IConnectionManagementSer
return undefined!;
}
getActiveConnectionCredentials(profileId: string): { [name: string]: string } {
return undefined!;
getConnectionCredentials(profileId: string): Promise<{ [name: string]: string }> {
return Promise.resolve(undefined);
}
getServerInfo(profileId: string): azdata.ServerInfo {