Skip to content

Commit

Permalink
Merge pull request #838 from gjsjohnmurray/pre-fix-837
Browse files Browse the repository at this point in the history
Allow serverForUri to return password for unnamed server (#837)
  • Loading branch information
gjsjohnmurray authored Feb 3, 2022
2 parents 241ffdb + 7e857aa commit 0171f83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
branches:
- master
release:
branches:
- master
types:
- released
jobs:
Expand Down
17 changes: 14 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,11 +968,22 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
const { apiTarget } = connectionTarget(uri);
const api = new AtelierAPI(apiTarget);

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

const { serverName, active, host = "", https, port, pathPrefix, username, ns = "", apiVersion } = api.config;
const {
serverName,
active,
host = "",
https,
port,
pathPrefix,
username,
password,
ns = "",
apiVersion,
} = api.config;
return {
serverName,
active,
Expand All @@ -981,7 +992,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
port,
pathPrefix,
username,
password: undefined,
password: serverName === "" ? password : undefined,
namespace: ns,
apiVersion: active ? apiVersion : undefined,
};
Expand Down

0 comments on commit 0171f83

Please sign in to comment.