Skip to content

Commit 66df7ad

Browse files
committed
Allow serverForUri to return password for unnamed server (#837)
1 parent eee6456 commit 66df7ad

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/extension.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,22 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
968968
const { apiTarget } = connectionTarget(uri);
969969
const api = new AtelierAPI(apiTarget);
970970

971-
// We explicitly no longer expose the password.
971+
// We explicitly no longer expose the password for named servers.
972972
// API client extensions can use Server Manager 3's authentication provider to get this,
973973
// which will require user consent.
974974

975-
const { serverName, active, host = "", https, port, pathPrefix, username, ns = "", apiVersion } = api.config;
975+
const {
976+
serverName,
977+
active,
978+
host = "",
979+
https,
980+
port,
981+
pathPrefix,
982+
username,
983+
password,
984+
ns = "",
985+
apiVersion,
986+
} = api.config;
976987
return {
977988
serverName,
978989
active,
@@ -981,7 +992,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
981992
port,
982993
pathPrefix,
983994
username,
984-
password: undefined,
995+
password: serverName === "" ? password : undefined,
985996
namespace: ns,
986997
apiVersion: active ? apiVersion : undefined,
987998
};

0 commit comments

Comments
 (0)