Skip to content

Commit 0171f83

Browse files
Merge pull request #838 from gjsjohnmurray/pre-fix-837
Allow serverForUri to return password for unnamed server (#837)
2 parents 241ffdb + 7e857aa commit 0171f83

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
branches:
1515
- master
1616
release:
17+
branches:
18+
- master
1719
types:
1820
- released
1921
jobs:

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)