@codingame/monaco-vscode-authentication-service-override 10.1.4 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-authentication-service-override",
3
- "version": "10.1.4",
3
+ "version": "11.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@10.1.4"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@11.0.0"
30
30
  }
31
31
  }
@@ -14,6 +14,7 @@ import { IAuthenticationUsageService } from 'vscode/vscode/vs/workbench/services
14
14
  import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication.service';
15
15
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
16
16
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
17
+ import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
17
18
  import Severity$1 from 'vscode/vscode/vs/base/common/severity';
18
19
 
19
20
  const SCOPESLIST_SEPARATOR = ' ';
@@ -108,7 +109,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
108
109
  numberOfRequests += ( (Object.keys(accessRequest))).length;
109
110
  });
110
111
  if (numberOfRequests > 0) {
111
- const badge = ( (new NumberBadge(numberOfRequests, () => ( localize(2253, "Sign in requested")))));
112
+ const badge = ( (new NumberBadge(numberOfRequests, () => ( localize(1675, "Sign in requested")))));
112
113
  this._accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
113
114
  }
114
115
  }
@@ -121,7 +122,8 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
121
122
  }
122
123
  }
123
124
  updateAccountPreference(extensionId, providerId, account) {
124
- const parentExtensionId = this._inheritAuthAccountPreferenceChildToParent[extensionId] ?? extensionId;
125
+ const realExtensionId = ExtensionIdentifier.toKey(extensionId);
126
+ const parentExtensionId = this._inheritAuthAccountPreferenceChildToParent[realExtensionId] ?? realExtensionId;
125
127
  const key = this._getKey(parentExtensionId, providerId);
126
128
  this.storageService.store(key, account.label, 1 , 1 );
127
129
  this.storageService.store(key, account.label, -1 , 1 );
@@ -130,11 +132,13 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
130
132
  this._onDidAccountPreferenceChange.fire({ extensionIds, providerId });
131
133
  }
132
134
  getAccountPreference(extensionId, providerId) {
133
- const key = this._getKey(this._inheritAuthAccountPreferenceChildToParent[extensionId] ?? extensionId, providerId);
135
+ const realExtensionId = ExtensionIdentifier.toKey(extensionId);
136
+ const key = this._getKey(this._inheritAuthAccountPreferenceChildToParent[realExtensionId] ?? realExtensionId, providerId);
134
137
  return this.storageService.get(key, 1 ) ?? this.storageService.get(key, -1 );
135
138
  }
136
139
  removeAccountPreference(extensionId, providerId) {
137
- const key = this._getKey(this._inheritAuthAccountPreferenceChildToParent[extensionId] ?? extensionId, providerId);
140
+ const realExtensionId = ExtensionIdentifier.toKey(extensionId);
141
+ const key = this._getKey(this._inheritAuthAccountPreferenceChildToParent[realExtensionId] ?? realExtensionId, providerId);
138
142
  this.storageService.remove(key, 1 );
139
143
  this.storageService.remove(key, -1 );
140
144
  }
@@ -142,16 +146,19 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
142
146
  return `${extensionId}-${providerId}`;
143
147
  }
144
148
  updateSessionPreference(providerId, extensionId, session) {
145
- const key = `${extensionId}-${providerId}-${session.scopes.join(SCOPESLIST_SEPARATOR)}`;
149
+ const realExtensionId = ExtensionIdentifier.toKey(extensionId);
150
+ const key = `${realExtensionId}-${providerId}-${session.scopes.join(SCOPESLIST_SEPARATOR)}`;
146
151
  this.storageService.store(key, session.id, 1 , 1 );
147
152
  this.storageService.store(key, session.id, -1 , 1 );
148
153
  }
149
154
  getSessionPreference(providerId, extensionId, scopes) {
150
- const key = `${extensionId}-${providerId}-${scopes.join(SCOPESLIST_SEPARATOR)}`;
155
+ const realExtensionId = ExtensionIdentifier.toKey(extensionId);
156
+ const key = `${realExtensionId}-${providerId}-${scopes.join(SCOPESLIST_SEPARATOR)}`;
151
157
  return this.storageService.get(key, 1 ) ?? this.storageService.get(key, -1 );
152
158
  }
153
159
  removeSessionPreference(providerId, extensionId, scopes) {
154
- const key = `${extensionId}-${providerId}-${scopes.join(SCOPESLIST_SEPARATOR)}`;
160
+ const realExtensionId = ExtensionIdentifier.toKey(extensionId);
161
+ const key = `${realExtensionId}-${providerId}-${scopes.join(SCOPESLIST_SEPARATOR)}`;
155
162
  this.storageService.remove(key, 1 );
156
163
  this.storageService.remove(key, -1 );
157
164
  }
@@ -169,7 +176,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
169
176
  const { result } = await this.dialogService.prompt({
170
177
  type: Severity$1.Info,
171
178
  message: ( localize(
172
- 2254,
179
+ 1676,
173
180
  "The extension '{0}' wants to access the {1} account '{2}'.",
174
181
  extensionName,
175
182
  provider.label,
@@ -177,11 +184,11 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
177
184
  )),
178
185
  buttons: [
179
186
  {
180
- label: ( localize(2255, "&&Allow")),
187
+ label: ( localize(1677, "&&Allow")),
181
188
  run: () => SessionPromptChoice.Allow
182
189
  },
183
190
  {
184
- label: ( localize(2256, "&&Deny")),
191
+ label: ( localize(1678, "&&Deny")),
185
192
  run: () => SessionPromptChoice.Deny
186
193
  }
187
194
  ],
@@ -217,15 +224,15 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
217
224
  items.push({ label: account.label, account });
218
225
  }
219
226
  });
220
- items.push({ label: ( localize(2257, "Sign in to another account")) });
227
+ items.push({ label: ( localize(1679, "Sign in to another account")) });
221
228
  quickPick.items = items;
222
229
  quickPick.title = ( localize(
223
- 2258,
230
+ 1680,
224
231
  "The extension '{0}' wants to access a {1} account",
225
232
  extensionName,
226
233
  this._authenticationService.getProvider(providerId).label
227
234
  ));
228
- quickPick.placeholder = ( localize(2259, "Select an account for '{0}' to use or Esc to cancel", extensionName));
235
+ quickPick.placeholder = ( localize(1681, "Select an account for '{0}' to use or Esc to cancel", extensionName));
229
236
  return await ( (new Promise((resolve, reject) => {
230
237
  disposables.add(quickPick.onDidAccept(async (_) => {
231
238
  quickPick.dispose();
@@ -280,7 +287,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
280
287
  }
281
288
  }
282
289
  if (session) {
283
- this._authenticationUsageService.addAccountUsage(provider.id, session.account.label, extensionId, extensionName);
290
+ this._authenticationUsageService.addAccountUsage(provider.id, session.account.label, session.scopes, extensionId, extensionName);
284
291
  }
285
292
  }
286
293
  requestSessionAccess(providerId, extensionId, extensionName, scopes, possibleSessions) {
@@ -294,7 +301,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
294
301
  group: '3_accessRequests',
295
302
  command: {
296
303
  id: `${providerId}${extensionId}Access`,
297
- title: ( localize(2260, "Grant access to {0} for {1}... (1)", provider.label, extensionName))
304
+ title: ( localize(1682, "Grant access to {0} for {1}... (1)", provider.label, extensionName))
298
305
  }
299
306
  })));
300
307
  const accessCommand = CommandsRegistry.registerCommand({
@@ -338,7 +345,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
338
345
  group: '2_signInRequests',
339
346
  command: {
340
347
  id: commandId,
341
- title: ( localize(2261, "Sign in with {0} to use {1} (1)", provider.label, extensionName))
348
+ title: ( localize(1683, "Sign in with {0} to use {1} (1)", provider.label, extensionName))
342
349
  }
343
350
  })));
344
351
  const signInCommand = CommandsRegistry.registerCommand({
@@ -54,7 +54,7 @@ let AuthenticationUsageService = class AuthenticationUsageService extends Dispos
54
54
  const accountKey = `${providerId}-${accountName}-usages`;
55
55
  this._storageService.remove(accountKey, -1 );
56
56
  }
57
- addAccountUsage(providerId, accountName, extensionId, extensionName) {
57
+ addAccountUsage(providerId, accountName, scopes, extensionId, extensionName) {
58
58
  const accountKey = `${providerId}-${accountName}-usages`;
59
59
  const usages = this.readAccountUsages(providerId, accountName);
60
60
  const existingUsageIndex = usages.findIndex(usage => usage.extensionId === extensionId);
@@ -62,6 +62,7 @@ let AuthenticationUsageService = class AuthenticationUsageService extends Dispos
62
62
  usages.splice(existingUsageIndex, 1, {
63
63
  extensionId,
64
64
  extensionName,
65
+ scopes,
65
66
  lastUsed: Date.now()
66
67
  });
67
68
  }
@@ -69,6 +70,7 @@ let AuthenticationUsageService = class AuthenticationUsageService extends Dispos
69
70
  usages.push({
70
71
  extensionId,
71
72
  extensionName,
73
+ scopes,
72
74
  lastUsed: Date.now()
73
75
  });
74
76
  }