@codingame/monaco-vscode-authentication-service-override 8.0.4 → 9.0.2
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": "
|
|
3
|
+
"version": "9.0.2",
|
|
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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@9.0.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/vscode/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable, MutableDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
+
import { Disposable, MutableDisposable, dispose, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { MenuRegistry, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
5
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
@@ -98,7 +98,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
98
98
|
numberOfRequests += ( (Object.keys(accessRequest))).length;
|
|
99
99
|
});
|
|
100
100
|
if (numberOfRequests > 0) {
|
|
101
|
-
const badge = ( (new NumberBadge(numberOfRequests, () => ( localize(
|
|
101
|
+
const badge = ( (new NumberBadge(numberOfRequests, () => ( localize(2247, "Sign in requested")))));
|
|
102
102
|
this._accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -111,16 +111,16 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
updateSessionPreference(providerId, extensionId, session) {
|
|
114
|
-
const key = `${extensionId}-${providerId}-${session.scopes.join(
|
|
114
|
+
const key = `${extensionId}-${providerId}-${session.scopes.join(SCOPESLIST_SEPARATOR)}`;
|
|
115
115
|
this.storageService.store(key, session.id, StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
116
116
|
this.storageService.store(key, session.id, StorageScope.APPLICATION, StorageTarget.MACHINE);
|
|
117
117
|
}
|
|
118
118
|
getSessionPreference(providerId, extensionId, scopes) {
|
|
119
|
-
const key = `${extensionId}-${providerId}-${scopes.join(
|
|
119
|
+
const key = `${extensionId}-${providerId}-${scopes.join(SCOPESLIST_SEPARATOR)}`;
|
|
120
120
|
return this.storageService.get(key, StorageScope.WORKSPACE) ?? this.storageService.get(key, StorageScope.APPLICATION);
|
|
121
121
|
}
|
|
122
122
|
removeSessionPreference(providerId, extensionId, scopes) {
|
|
123
|
-
const key = `${extensionId}-${providerId}-${scopes.join(
|
|
123
|
+
const key = `${extensionId}-${providerId}-${scopes.join(SCOPESLIST_SEPARATOR)}`;
|
|
124
124
|
this.storageService.remove(key, StorageScope.WORKSPACE);
|
|
125
125
|
this.storageService.remove(key, StorageScope.APPLICATION);
|
|
126
126
|
}
|
|
@@ -134,7 +134,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
134
134
|
const { result } = await this.dialogService.prompt({
|
|
135
135
|
type: Severity$1.Info,
|
|
136
136
|
message: ( localize(
|
|
137
|
-
|
|
137
|
+
2248,
|
|
138
138
|
"The extension '{0}' wants to access the {1} account '{2}'.",
|
|
139
139
|
extensionName,
|
|
140
140
|
provider.label,
|
|
@@ -142,11 +142,11 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
142
142
|
)),
|
|
143
143
|
buttons: [
|
|
144
144
|
{
|
|
145
|
-
label: ( localize(
|
|
145
|
+
label: ( localize(2249, "&&Allow")),
|
|
146
146
|
run: () => SessionPromptChoice.Allow
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
label: ( localize(
|
|
149
|
+
label: ( localize(2250, "&&Deny")),
|
|
150
150
|
run: () => SessionPromptChoice.Deny
|
|
151
151
|
}
|
|
152
152
|
],
|
|
@@ -165,7 +165,8 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
165
165
|
if (!allAccounts.length) {
|
|
166
166
|
throw ( (new Error('No accounts available')));
|
|
167
167
|
}
|
|
168
|
-
const
|
|
168
|
+
const disposables = ( (new DisposableStore()));
|
|
169
|
+
const quickPick = disposables.add(this.quickInputService.createQuickPick());
|
|
169
170
|
quickPick.ignoreFocusOut = true;
|
|
170
171
|
const items = ( (availableSessions.map(session => {
|
|
171
172
|
return {
|
|
@@ -179,17 +180,17 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
179
180
|
items.push({ label: account.label, account });
|
|
180
181
|
}
|
|
181
182
|
});
|
|
182
|
-
items.push({ label: ( localize(
|
|
183
|
+
items.push({ label: ( localize(2251, "Sign in to another account")) });
|
|
183
184
|
quickPick.items = items;
|
|
184
185
|
quickPick.title = ( localize(
|
|
185
|
-
|
|
186
|
+
2252,
|
|
186
187
|
"The extension '{0}' wants to access a {1} account",
|
|
187
188
|
extensionName,
|
|
188
189
|
this._authenticationService.getProvider(providerId).label
|
|
189
190
|
));
|
|
190
|
-
quickPick.placeholder = ( localize(
|
|
191
|
+
quickPick.placeholder = ( localize(2253, "Select an account for '{0}' to use or Esc to cancel", extensionName));
|
|
191
192
|
return await ( (new Promise((resolve, reject) => {
|
|
192
|
-
quickPick.onDidAccept(async (_) => {
|
|
193
|
+
disposables.add(quickPick.onDidAccept(async (_) => {
|
|
193
194
|
quickPick.dispose();
|
|
194
195
|
let session = quickPick.selectedItems[0].session;
|
|
195
196
|
if (!session) {
|
|
@@ -207,13 +208,13 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
207
208
|
this.updateSessionPreference(providerId, extensionId, session);
|
|
208
209
|
this.removeAccessRequest(providerId, extensionId);
|
|
209
210
|
resolve(session);
|
|
210
|
-
});
|
|
211
|
-
quickPick.onDidHide(_ => {
|
|
212
|
-
quickPick.dispose();
|
|
211
|
+
}));
|
|
212
|
+
disposables.add(quickPick.onDidHide(_ => {
|
|
213
213
|
if (!quickPick.selectedItems[0]) {
|
|
214
214
|
reject('User did not consent to account access');
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
disposables.dispose();
|
|
217
|
+
}));
|
|
217
218
|
quickPick.show();
|
|
218
219
|
})));
|
|
219
220
|
}
|
|
@@ -256,7 +257,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
256
257
|
group: '3_accessRequests',
|
|
257
258
|
command: {
|
|
258
259
|
id: `${providerId}${extensionId}Access`,
|
|
259
|
-
title: ( localize(
|
|
260
|
+
title: ( localize(2254, "Grant access to {0} for {1}... (1)", provider.label, extensionName))
|
|
260
261
|
}
|
|
261
262
|
})));
|
|
262
263
|
const accessCommand = CommandsRegistry.registerCommand({
|
|
@@ -300,7 +301,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
300
301
|
group: '2_signInRequests',
|
|
301
302
|
command: {
|
|
302
303
|
id: commandId,
|
|
303
|
-
title: ( localize(
|
|
304
|
+
title: ( localize(2255, "Sign in with {0} to use {1} (1)", provider.label, extensionName))
|
|
304
305
|
}
|
|
305
306
|
})));
|
|
306
307
|
const signInCommand = CommandsRegistry.registerCommand({
|