Skip to content

Commit f8969ca

Browse files
Merge pull request #243 from gjsjohnmurray/fix-242
Prevent overprompting for permission and account
2 parents 8bcb9df + 795fe9a commit f8969ca

10 files changed

+181
-87
lines changed

README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ InterSystems Server Manager is a Visual Studio Code extension for defining conne
66

77
See the [CHANGELOG](https://marketplace.visualstudio.com/items/intersystems-community.servermanager/changelog) for changes in each release.
88

9-
# New in Version 3.6 - Date TBC
10-
TODO
9+
# New in Version 3.8 - November 2024
10+
- Updated the authentication provider to resolve overprompting caused by a VS Code 1.93 change.
11+
- Added a new function (`getAccount`) to the API surface as a helper for extensions leveraging the authentication provider.
12+
13+
# New in Version 3.6 - January 2024
14+
The view container was renamed and given a new icon as part of work integrating the ObjectScript extension's views with it.
1115

1216
# New in Version 3.4 - July 2023
1317

@@ -207,7 +211,7 @@ If a server has been named in `/default` it is promoted to the top of the list,
207211

208212
The NPM package [`@intersystems-community/intersystems-servermanager`](https://www.npmjs.com/package/@intersystems-community/intersystems-servermanager) defines the types used by the API which this extension exports. It also declares some constants.
209213

210-
An extension XYZ needing to connect to InterSystems servers should include `"@intersystems-community/intersystems-servermanager": "latest"` in the `"devDependencies"` object in its `package.json`.
214+
An extension XYZ needing to connect to InterSystems servers should include `"@intersystems-community/intersystems-servermanager": "^3.8.0"` in the `"devDependencies"` object in its `package.json`.
211215

212216
It might also define Server Manager as a dependency in its `package.json` like this:
213217

@@ -240,7 +244,7 @@ Alternatively the `activate` method of XYZ can detect whether the extension is a
240244
XYZ can then use the extension's API to obtain the properties of a named server definition:
241245

242246
```ts
243-
const serverManagerApi = extension.exports;
247+
const serverManagerApi: serverManager.ServerManagerAPI = extension.exports;
244248
if (serverManagerApi && serverManagerApi.getServerSpec) { // defensive coding
245249
const serverSpec: serverManager.IServerSpec | undefined = await serverManagerApi.getServerSpec(serverName);
246250
}
@@ -253,9 +257,10 @@ To obtain the password with which to connect, use code like this which will also
253257
```ts
254258
if (typeof serverSpec.password === 'undefined') {
255259
const scopes = [serverSpec.name, serverSpec.username || ''];
256-
let session = await vscode.authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { silent: true });
260+
const account = serverManagerApi.getAccount(serverSpec);
261+
let session = await vscode.authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { silent: true, account });
257262
if (!session) {
258-
session = await vscode.authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { createIfNone: true });
263+
session = await vscode.authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { createIfNone: true, account });
259264
}
260265
if (session) {
261266
serverSpec.username = session.scopes[1];

package-lock.json

+99-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)