@codingame/monaco-vscode-authentication-service-override 19.1.4 → 20.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 +5 -5
- package/vscode/src/vs/workbench/contrib/authentication/browser/actions/manageAccountPreferencesForExtensionAction.js +10 -10
- package/vscode/src/vs/workbench/contrib/authentication/browser/actions/manageAccountPreferencesForMcpServerAction.js +10 -10
- package/vscode/src/vs/workbench/contrib/authentication/browser/actions/manageDynamicAuthenticationProvidersAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/authentication/browser/actions/manageTrustedExtensionsForAccountAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/authentication/browser/actions/manageTrustedMcpServersForAccountAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/authentication/browser/actions/signOutOfAccountAction.js +4 -4
- package/vscode/src/vs/workbench/contrib/authentication/browser/authentication.contribution.js +4 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.js +10 -10
- package/vscode/src/vs/workbench/services/authentication/browser/dynamicAuthenticationProviderStorageService.d.ts +5 -1
- package/vscode/src/vs/workbench/services/authentication/browser/dynamicAuthenticationProviderStorageService.js +24 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-authentication-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - authentication service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common": "
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-f22e7e55-aee8-5b52-a6bc-950efd9f5890-common": "
|
|
18
|
+
"@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common": "20.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-api": "20.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-d941ac7b-412f-57e3-b1bf-f6b0eb253b21-common": "20.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-f22e7e55-aee8-5b52-a6bc-950efd9f5890-common": "20.0.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"module": "index.js",
|
|
@@ -16,8 +16,8 @@ class ManageAccountPreferencesForExtensionAction extends Action2 {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super({
|
|
18
18
|
id: '_manageAccountPreferencesForExtension',
|
|
19
|
-
title: ( localize2(
|
|
20
|
-
category: ( localize2(
|
|
19
|
+
title: ( localize2(4321, "Manage Extension Account Preferences")),
|
|
20
|
+
category: ( localize2(4322, "Accounts")),
|
|
21
21
|
f1: false
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -46,7 +46,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
|
|
|
46
46
|
const extensionQuery = this._authenticationQueryService.extension(extensionId);
|
|
47
47
|
const providersWithAccess = await extensionQuery.getProvidersWithAccess();
|
|
48
48
|
if (!providersWithAccess.length) {
|
|
49
|
-
await this._dialogService.info(( localize(
|
|
49
|
+
await this._dialogService.info(( localize(4323, "This extension has not used any accounts yet.")));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
providerId = providersWithAccess[0];
|
|
@@ -56,10 +56,10 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
|
|
|
56
56
|
id: providerId,
|
|
57
57
|
}))), {
|
|
58
58
|
placeHolder: ( localize(
|
|
59
|
-
|
|
59
|
+
4324,
|
|
60
60
|
"Select an authentication provider to manage account preferences for"
|
|
61
61
|
)),
|
|
62
|
-
title: ( localize(
|
|
62
|
+
title: ( localize(4325, "Manage Extension Account Preferences"))
|
|
63
63
|
});
|
|
64
64
|
if (!result) {
|
|
65
65
|
return;
|
|
@@ -80,7 +80,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
|
|
|
80
80
|
items.push({
|
|
81
81
|
providerId,
|
|
82
82
|
scopes: lastUsedScopes,
|
|
83
|
-
label: ( localize(
|
|
83
|
+
label: ( localize(4326, "Use a new account...")),
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -99,12 +99,12 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
|
|
|
99
99
|
disposableStore.dispose();
|
|
100
100
|
}));
|
|
101
101
|
picker.placeholder = ( localize(
|
|
102
|
-
|
|
102
|
+
4327,
|
|
103
103
|
"Manage '{0}' account preferences for {1}...",
|
|
104
104
|
extensionLabel,
|
|
105
105
|
providerLabel
|
|
106
106
|
));
|
|
107
|
-
picker.title = ( localize(
|
|
107
|
+
picker.title = ( localize(4328, "'{0}' Account Preferences For This Workspace", extensionLabel));
|
|
108
108
|
picker.sortByLabel = false;
|
|
109
109
|
disposableStore.add(picker.onDidAccept(async () => {
|
|
110
110
|
picker.hide();
|
|
@@ -118,7 +118,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
|
|
|
118
118
|
label: a.label,
|
|
119
119
|
account: a,
|
|
120
120
|
providerId,
|
|
121
|
-
description: ( localize(
|
|
121
|
+
description: ( localize(4329, "Current account")),
|
|
122
122
|
picked: true
|
|
123
123
|
}
|
|
124
124
|
: {
|
|
@@ -128,7 +128,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
|
|
|
128
128
|
}));
|
|
129
129
|
}
|
|
130
130
|
_handleNoAccounts(picker) {
|
|
131
|
-
picker.validationMessage = ( localize(
|
|
131
|
+
picker.validationMessage = ( localize(4330, "No accounts are currently used by this extension."));
|
|
132
132
|
picker.buttons = [this._quickInputService.backButton];
|
|
133
133
|
picker.show();
|
|
134
134
|
return Event.filter(picker.onDidTriggerButton, (e) => e === this._quickInputService.backButton)(() => this.run());
|
|
@@ -16,8 +16,8 @@ class ManageAccountPreferencesForMcpServerAction extends Action2 {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super({
|
|
18
18
|
id: '_manageAccountPreferencesForMcpServer',
|
|
19
|
-
title: ( localize2(
|
|
20
|
-
category: ( localize2(
|
|
19
|
+
title: ( localize2(4331, "Manage MCP Server Account Preferences")),
|
|
20
|
+
category: ( localize2(4332, "Accounts")),
|
|
21
21
|
f1: false
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -46,7 +46,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
|
|
|
46
46
|
const mcpServerQuery = this._authenticationQueryService.mcpServer(mcpServerId);
|
|
47
47
|
const providersWithAccess = await mcpServerQuery.getProvidersWithAccess();
|
|
48
48
|
if (!providersWithAccess.length) {
|
|
49
|
-
await this._dialogService.info(( localize(
|
|
49
|
+
await this._dialogService.info(( localize(4333, "This MCP server has not used any accounts yet.")));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
providerId = providersWithAccess[0];
|
|
@@ -56,10 +56,10 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
|
|
|
56
56
|
id: providerId,
|
|
57
57
|
}))), {
|
|
58
58
|
placeHolder: ( localize(
|
|
59
|
-
|
|
59
|
+
4334,
|
|
60
60
|
"Select an authentication provider to manage account preferences for"
|
|
61
61
|
)),
|
|
62
|
-
title: ( localize(
|
|
62
|
+
title: ( localize(4335, "Manage MCP Server Account Preferences"))
|
|
63
63
|
});
|
|
64
64
|
if (!result) {
|
|
65
65
|
return;
|
|
@@ -80,7 +80,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
|
|
|
80
80
|
items.push({
|
|
81
81
|
providerId: providerId,
|
|
82
82
|
scopes: lastUsedScopes,
|
|
83
|
-
label: ( localize(
|
|
83
|
+
label: ( localize(4336, "Use a new account...")),
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -99,12 +99,12 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
|
|
|
99
99
|
disposableStore.dispose();
|
|
100
100
|
}));
|
|
101
101
|
picker.placeholder = ( localize(
|
|
102
|
-
|
|
102
|
+
4337,
|
|
103
103
|
"Manage '{0}' account preferences for {1}...",
|
|
104
104
|
mcpServerLabel,
|
|
105
105
|
providerLabel
|
|
106
106
|
));
|
|
107
|
-
picker.title = ( localize(
|
|
107
|
+
picker.title = ( localize(4338, "'{0}' Account Preferences For This Workspace", mcpServerLabel));
|
|
108
108
|
picker.sortByLabel = false;
|
|
109
109
|
disposableStore.add(picker.onDidAccept(async () => {
|
|
110
110
|
picker.hide();
|
|
@@ -118,7 +118,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
|
|
|
118
118
|
label: a.label,
|
|
119
119
|
account: a,
|
|
120
120
|
providerId,
|
|
121
|
-
description: ( localize(
|
|
121
|
+
description: ( localize(4339, "Current account")),
|
|
122
122
|
picked: true
|
|
123
123
|
}
|
|
124
124
|
: {
|
|
@@ -128,7 +128,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
|
|
|
128
128
|
}));
|
|
129
129
|
}
|
|
130
130
|
_handleNoAccounts(picker) {
|
|
131
|
-
picker.validationMessage = ( localize(
|
|
131
|
+
picker.validationMessage = ( localize(4340, "No accounts are currently used by this MCP server."));
|
|
132
132
|
picker.buttons = [this._quickInputService.backButton];
|
|
133
133
|
picker.show();
|
|
134
134
|
return Event.filter(picker.onDidTriggerButton, (e) => e === this._quickInputService.backButton)(() => this.run());
|
|
@@ -11,8 +11,8 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super({
|
|
13
13
|
id: RemoveDynamicAuthenticationProvidersAction.ID,
|
|
14
|
-
title: ( localize2(
|
|
15
|
-
category: ( localize2(
|
|
14
|
+
title: ( localize2(4341, 'Remove Dynamic Authentication Providers')),
|
|
15
|
+
category: ( localize2(4342, 'Authentication')),
|
|
16
16
|
f1: true
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -23,16 +23,16 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
|
|
|
23
23
|
const dialogService = accessor.get(IDialogService);
|
|
24
24
|
const interactedProviders = dynamicAuthStorageService.getInteractedProviders();
|
|
25
25
|
if (interactedProviders.length === 0) {
|
|
26
|
-
await dialogService.info(( localize(
|
|
26
|
+
await dialogService.info(( localize(4343, 'No dynamic authentication providers')), ( localize(4344, 'No dynamic authentication providers have been used yet.')));
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
const items = ( interactedProviders.map(provider => ({
|
|
30
30
|
label: provider.label,
|
|
31
|
-
description: ( localize(
|
|
31
|
+
description: ( localize(4345, 'Client ID: {0}', provider.clientId)),
|
|
32
32
|
provider
|
|
33
33
|
})));
|
|
34
34
|
const selected = await quickInputService.pick(items, {
|
|
35
|
-
placeHolder: ( localize(
|
|
35
|
+
placeHolder: ( localize(4346, 'Select a dynamic authentication provider to remove')),
|
|
36
36
|
canPickMany: true
|
|
37
37
|
});
|
|
38
38
|
if (!selected || selected.length === 0) {
|
|
@@ -41,12 +41,12 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
|
|
|
41
41
|
const providerNames = ( selected.map(item => item.provider.label)).join(', ');
|
|
42
42
|
const message = selected.length === 1
|
|
43
43
|
? ( localize(
|
|
44
|
-
|
|
44
|
+
4347,
|
|
45
45
|
'Are you sure you want to remove the dynamic authentication provider "{0}"?',
|
|
46
46
|
providerNames
|
|
47
47
|
))
|
|
48
48
|
: ( localize(
|
|
49
|
-
|
|
49
|
+
4348,
|
|
50
50
|
'Are you sure you want to remove {0} dynamic authentication providers: {1}?',
|
|
51
51
|
selected.length,
|
|
52
52
|
providerNames
|
|
@@ -54,10 +54,10 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
|
|
|
54
54
|
const result = await dialogService.confirm({
|
|
55
55
|
message,
|
|
56
56
|
detail: ( localize(
|
|
57
|
-
|
|
57
|
+
4349,
|
|
58
58
|
'This will remove all stored authentication data for the selected provider(s). You will need to re-authenticate if you use these providers again.'
|
|
59
59
|
)),
|
|
60
|
-
primaryButton: ( localize(
|
|
60
|
+
primaryButton: ( localize(4350, 'Remove')),
|
|
61
61
|
type: 'warning'
|
|
62
62
|
});
|
|
63
63
|
if (!result.confirmed) {
|
|
@@ -18,8 +18,8 @@ class ManageTrustedExtensionsForAccountAction extends Action2 {
|
|
|
18
18
|
constructor() {
|
|
19
19
|
super({
|
|
20
20
|
id: '_manageTrustedExtensionsForAccount',
|
|
21
|
-
title: ( localize2(
|
|
22
|
-
category: ( localize2(
|
|
21
|
+
title: ( localize2(4351, "Manage Trusted Extensions For Account")),
|
|
22
|
+
category: ( localize2(4352, "Accounts")),
|
|
23
23
|
f1: true
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -57,7 +57,7 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
|
|
|
57
57
|
}
|
|
58
58
|
const accounts = await this._getAllAvailableAccounts();
|
|
59
59
|
const pick = await this._quickInputService.pick(accounts, {
|
|
60
|
-
placeHolder: ( localize(
|
|
60
|
+
placeHolder: ( localize(4353, "Pick an account to manage trusted extensions for")),
|
|
61
61
|
matchOnDescription: true,
|
|
62
62
|
});
|
|
63
63
|
return pick ? this._authenticationQueryService.provider(pick.providerId).account(pick.label) : undefined;
|
|
@@ -101,7 +101,7 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
|
|
|
101
101
|
};
|
|
102
102
|
}));
|
|
103
103
|
if (!filteredExtensions.length) {
|
|
104
|
-
this._dialogService.info(( localize(
|
|
104
|
+
this._dialogService.info(( localize(4354, "This account has not been used by any extensions.")));
|
|
105
105
|
return [];
|
|
106
106
|
}
|
|
107
107
|
const trustedExtensions = filteredExtensions.filter(e => e.trusted);
|
|
@@ -109,20 +109,20 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
|
|
|
109
109
|
const sortByLastUsed = (a, b) => (b.lastUsed || 0) - (a.lastUsed || 0);
|
|
110
110
|
return [
|
|
111
111
|
...( otherExtensions.sort(sortByLastUsed).map(this._toQuickPickItem)),
|
|
112
|
-
{ type: 'separator', label: ( localize(
|
|
112
|
+
{ type: 'separator', label: ( localize(4355, "Trusted by Microsoft")) },
|
|
113
113
|
...( trustedExtensions.sort(sortByLastUsed).map(this._toQuickPickItem))
|
|
114
114
|
];
|
|
115
115
|
}
|
|
116
116
|
_toQuickPickItem(extension) {
|
|
117
117
|
const lastUsed = extension.lastUsed;
|
|
118
118
|
const description = lastUsed
|
|
119
|
-
? ( localize(
|
|
120
|
-
: ( localize(
|
|
119
|
+
? ( localize(4356, "Last used this account {0}", fromNow(lastUsed, true)))
|
|
120
|
+
: ( localize(4357, "Has not used this account"));
|
|
121
121
|
let tooltip;
|
|
122
122
|
let disabled;
|
|
123
123
|
if (extension.trusted) {
|
|
124
124
|
tooltip = ( localize(
|
|
125
|
-
|
|
125
|
+
4358,
|
|
126
126
|
"This extension is trusted by Microsoft and\nalways has access to this account"
|
|
127
127
|
));
|
|
128
128
|
disabled = true;
|
|
@@ -134,7 +134,7 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
|
|
|
134
134
|
tooltip,
|
|
135
135
|
disabled,
|
|
136
136
|
buttons: [{
|
|
137
|
-
tooltip: ( localize(
|
|
137
|
+
tooltip: ( localize(4359, "Manage account preferences for this extension")),
|
|
138
138
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
139
139
|
}],
|
|
140
140
|
picked: extension.allowed === undefined || extension.allowed
|
|
@@ -145,9 +145,9 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
|
|
|
145
145
|
const quickPick = disposableStore.add(this._quickInputService.createQuickPick({ useSeparators: true }));
|
|
146
146
|
quickPick.canSelectMany = true;
|
|
147
147
|
quickPick.customButton = true;
|
|
148
|
-
quickPick.customLabel = ( localize(
|
|
149
|
-
quickPick.title = ( localize(
|
|
150
|
-
quickPick.placeholder = ( localize(
|
|
148
|
+
quickPick.customLabel = ( localize(4360, 'Cancel'));
|
|
149
|
+
quickPick.title = ( localize(4361, "Manage Trusted Extensions"));
|
|
150
|
+
quickPick.placeholder = ( localize(4362, "Choose which extensions can access this account"));
|
|
151
151
|
disposableStore.add(quickPick.onDidAccept(() => {
|
|
152
152
|
const updatedAllowedList = ( quickPick.items
|
|
153
153
|
.filter((item) => item.type !== 'separator')
|
|
@@ -18,8 +18,8 @@ class ManageTrustedMcpServersForAccountAction extends Action2 {
|
|
|
18
18
|
constructor() {
|
|
19
19
|
super({
|
|
20
20
|
id: '_manageTrustedMCPServersForAccount',
|
|
21
|
-
title: ( localize2(
|
|
22
|
-
category: ( localize2(
|
|
21
|
+
title: ( localize2(4363, "Manage Trusted MCP Servers For Account")),
|
|
22
|
+
category: ( localize2(4364, "Accounts")),
|
|
23
23
|
f1: true
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -57,7 +57,7 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
|
|
|
57
57
|
}
|
|
58
58
|
const accounts = await this._getAllAvailableAccounts();
|
|
59
59
|
const pick = await this._quickInputService.pick(accounts, {
|
|
60
|
-
placeHolder: ( localize(
|
|
60
|
+
placeHolder: ( localize(4365, "Pick an account to manage trusted MCP servers for")),
|
|
61
61
|
matchOnDescription: true,
|
|
62
62
|
});
|
|
63
63
|
return pick ? this._authenticationQueryService.provider(pick.providerId).account(pick.label) : undefined;
|
|
@@ -95,7 +95,7 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
|
|
|
95
95
|
};
|
|
96
96
|
}));
|
|
97
97
|
if (!filteredMcpServers.length) {
|
|
98
|
-
this._dialogService.info(( localize(
|
|
98
|
+
this._dialogService.info(( localize(4366, "This account has not been used by any MCP servers.")));
|
|
99
99
|
return [];
|
|
100
100
|
}
|
|
101
101
|
const trustedServers = filteredMcpServers.filter(s => s.trusted);
|
|
@@ -103,20 +103,20 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
|
|
|
103
103
|
const sortByLastUsed = (a, b) => (b.lastUsed || 0) - (a.lastUsed || 0);
|
|
104
104
|
return [
|
|
105
105
|
...( otherServers.sort(sortByLastUsed).map(this._toQuickPickItem)),
|
|
106
|
-
{ type: 'separator', label: ( localize(
|
|
106
|
+
{ type: 'separator', label: ( localize(4367, "Trusted by Microsoft")) },
|
|
107
107
|
...( trustedServers.sort(sortByLastUsed).map(this._toQuickPickItem))
|
|
108
108
|
];
|
|
109
109
|
}
|
|
110
110
|
_toQuickPickItem(mcpServer) {
|
|
111
111
|
const lastUsed = mcpServer.lastUsed;
|
|
112
112
|
const description = lastUsed
|
|
113
|
-
? ( localize(
|
|
114
|
-
: ( localize(
|
|
113
|
+
? ( localize(4368, "Last used this account {0}", fromNow(lastUsed, true)))
|
|
114
|
+
: ( localize(4369, "Has not used this account"));
|
|
115
115
|
let tooltip;
|
|
116
116
|
let disabled;
|
|
117
117
|
if (mcpServer.trusted) {
|
|
118
118
|
tooltip = ( localize(
|
|
119
|
-
|
|
119
|
+
4370,
|
|
120
120
|
"This MCP server is trusted by Microsoft and\nalways has access to this account"
|
|
121
121
|
));
|
|
122
122
|
disabled = true;
|
|
@@ -128,7 +128,7 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
|
|
|
128
128
|
tooltip,
|
|
129
129
|
disabled,
|
|
130
130
|
buttons: [{
|
|
131
|
-
tooltip: ( localize(
|
|
131
|
+
tooltip: ( localize(4371, "Manage account preferences for this MCP server")),
|
|
132
132
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
133
133
|
}],
|
|
134
134
|
picked: mcpServer.allowed === undefined || mcpServer.allowed
|
|
@@ -139,9 +139,9 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
|
|
|
139
139
|
const quickPick = disposableStore.add(this._quickInputService.createQuickPick({ useSeparators: true }));
|
|
140
140
|
quickPick.canSelectMany = true;
|
|
141
141
|
quickPick.customButton = true;
|
|
142
|
-
quickPick.customLabel = ( localize(
|
|
143
|
-
quickPick.title = ( localize(
|
|
144
|
-
quickPick.placeholder = ( localize(
|
|
142
|
+
quickPick.customLabel = ( localize(4372, 'Cancel'));
|
|
143
|
+
quickPick.title = ( localize(4373, "Manage Trusted MCP Servers"));
|
|
144
|
+
quickPick.placeholder = ( localize(4374, "Choose which MCP servers can access this account"));
|
|
145
145
|
disposableStore.add(quickPick.onDidAccept(() => {
|
|
146
146
|
quickPick.hide();
|
|
147
147
|
const allServers = ( quickPick.items
|
package/vscode/src/vs/workbench/contrib/authentication/browser/actions/signOutOfAccountAction.js
CHANGED
|
@@ -11,7 +11,7 @@ class SignOutOfAccountAction extends Action2 {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super({
|
|
13
13
|
id: '_signOutOfAccount',
|
|
14
|
-
title: ( localize(
|
|
14
|
+
title: ( localize(4375, "Sign out of account")),
|
|
15
15
|
f1: false
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -32,13 +32,13 @@ class SignOutOfAccountAction extends Action2 {
|
|
|
32
32
|
type: Severity.Info,
|
|
33
33
|
message: accountUsages.length
|
|
34
34
|
? ( localize(
|
|
35
|
-
|
|
35
|
+
4376,
|
|
36
36
|
"The account '{0}' has been used by: \n\n{1}\n\n Sign out from these extensions?",
|
|
37
37
|
accountLabel,
|
|
38
38
|
( accountUsages.map(usage => usage.extensionName)).join('\n')
|
|
39
39
|
))
|
|
40
|
-
: ( localize(
|
|
41
|
-
primaryButton: ( localize(
|
|
40
|
+
: ( localize(4377, "Sign out of '{0}'?", accountLabel)),
|
|
41
|
+
primaryButton: ( localize(4378, "&&Sign Out"))
|
|
42
42
|
});
|
|
43
43
|
if (confirmed) {
|
|
44
44
|
const removeSessionPromises = ( sessions.map(session => authenticationService.removeSession(providerId, session.id)));
|
package/vscode/src/vs/workbench/contrib/authentication/browser/authentication.contribution.js
CHANGED
|
@@ -41,9 +41,9 @@ class AuthenticationDataRenderer extends Disposable {
|
|
|
41
41
|
return { data: { headers: [], rows: [] }, dispose: () => { } };
|
|
42
42
|
}
|
|
43
43
|
const headers = [
|
|
44
|
-
( localize(
|
|
45
|
-
( localize(
|
|
46
|
-
( localize(
|
|
44
|
+
( localize(4379, "Label")),
|
|
45
|
+
( localize(4380, "ID")),
|
|
46
|
+
( localize(4381, "MCP Authorization Servers"))
|
|
47
47
|
];
|
|
48
48
|
const rows = ( authentication
|
|
49
49
|
.sort((a, b) => a.label.localeCompare(b.label))
|
|
@@ -65,7 +65,7 @@ class AuthenticationDataRenderer extends Disposable {
|
|
|
65
65
|
}
|
|
66
66
|
const extensionFeature = ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
67
67
|
id: 'authentication',
|
|
68
|
-
label: ( localize(
|
|
68
|
+
label: ( localize(4382, "Authentication")),
|
|
69
69
|
access: {
|
|
70
70
|
canToggle: false
|
|
71
71
|
},
|
package/vscode/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.js
CHANGED
|
@@ -10,7 +10,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/noti
|
|
|
10
10
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
11
11
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
12
12
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
13
|
-
import { NumberBadge } from '@codingame/monaco-vscode-
|
|
13
|
+
import { NumberBadge } from '@codingame/monaco-vscode-d941ac7b-412f-57e3-b1bf-f6b0eb253b21-common/vscode/vs/workbench/services/activity/common/activity';
|
|
14
14
|
import { IActivityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/activity/common/activity.service';
|
|
15
15
|
import { IAuthenticationAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationAccessService.service';
|
|
16
16
|
import { IAuthenticationUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationUsageService.service';
|
|
@@ -112,7 +112,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
112
112
|
numberOfRequests += ( Object.keys(accessRequest)).length;
|
|
113
113
|
});
|
|
114
114
|
if (numberOfRequests > 0) {
|
|
115
|
-
const badge = ( new NumberBadge(numberOfRequests, () => ( localize(
|
|
115
|
+
const badge = ( new NumberBadge(numberOfRequests, () => ( localize(12845, "Sign in requested"))));
|
|
116
116
|
this._accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -179,7 +179,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
179
179
|
const { result } = await this.dialogService.prompt({
|
|
180
180
|
type: Severity.Info,
|
|
181
181
|
message: ( localize(
|
|
182
|
-
|
|
182
|
+
12846,
|
|
183
183
|
"The extension '{0}' wants to access the {1} account '{2}'.",
|
|
184
184
|
extensionName,
|
|
185
185
|
provider.label,
|
|
@@ -187,11 +187,11 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
187
187
|
)),
|
|
188
188
|
buttons: [
|
|
189
189
|
{
|
|
190
|
-
label: ( localize(
|
|
190
|
+
label: ( localize(12847, "&&Allow")),
|
|
191
191
|
run: () => SessionPromptChoice.Allow
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
|
-
label: ( localize(
|
|
194
|
+
label: ( localize(12848, "&&Deny")),
|
|
195
195
|
run: () => SessionPromptChoice.Deny
|
|
196
196
|
}
|
|
197
197
|
],
|
|
@@ -227,16 +227,16 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
227
227
|
items.push({ label: account.label, account });
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
|
-
items.push({ label: ( localize(
|
|
230
|
+
items.push({ label: ( localize(12849, "Sign in to another account")) });
|
|
231
231
|
quickPick.items = items;
|
|
232
232
|
quickPick.title = ( localize(
|
|
233
|
-
|
|
233
|
+
12850,
|
|
234
234
|
"The extension '{0}' wants to access a {1} account",
|
|
235
235
|
extensionName,
|
|
236
236
|
this._authenticationService.getProvider(providerId).label
|
|
237
237
|
));
|
|
238
238
|
quickPick.placeholder = ( localize(
|
|
239
|
-
|
|
239
|
+
12851,
|
|
240
240
|
"Select an account for '{0}' to use or Esc to cancel",
|
|
241
241
|
extensionName
|
|
242
242
|
));
|
|
@@ -308,7 +308,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
308
308
|
group: '3_accessRequests',
|
|
309
309
|
command: {
|
|
310
310
|
id: `${providerId}${extensionId}Access`,
|
|
311
|
-
title: ( localize(
|
|
311
|
+
title: ( localize(12852, "Grant access to {0} for {1}... (1)", provider.label, extensionName))
|
|
312
312
|
}
|
|
313
313
|
}));
|
|
314
314
|
const accessCommand = CommandsRegistry.registerCommand({
|
|
@@ -352,7 +352,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
|
|
|
352
352
|
group: '2_signInRequests',
|
|
353
353
|
command: {
|
|
354
354
|
id: commandId,
|
|
355
|
-
title: ( localize(
|
|
355
|
+
title: ( localize(12853, "Sign in with {0} to use {1} (1)", provider.label, extensionName))
|
|
356
356
|
}
|
|
357
357
|
}));
|
|
358
358
|
const signInCommand = CommandsRegistry.registerCommand({
|
|
@@ -15,8 +15,12 @@ export declare class DynamicAuthenticationProviderStorageService extends Disposa
|
|
|
15
15
|
private readonly _onDidChangeTokens;
|
|
16
16
|
readonly onDidChangeTokens: Event<DynamicAuthenticationProviderTokensChangeEvent>;
|
|
17
17
|
constructor(storageService: IStorageService, secretStorageService: ISecretStorageService, logService: ILogService);
|
|
18
|
+
getClientRegistration(providerId: string): Promise<{
|
|
19
|
+
clientId?: string;
|
|
20
|
+
clientSecret?: string;
|
|
21
|
+
} | undefined>;
|
|
18
22
|
getClientId(providerId: string): string | undefined;
|
|
19
|
-
|
|
23
|
+
storeClientRegistration(providerId: string, authorizationServer: string, clientId: string, clientSecret?: string, label?: string): Promise<void>;
|
|
20
24
|
private _trackProvider;
|
|
21
25
|
private _getStoredProviders;
|
|
22
26
|
private _storeProviders;
|
|
@@ -42,13 +42,34 @@ let DynamicAuthenticationProviderStorageService = class DynamicAuthenticationPro
|
|
|
42
42
|
}
|
|
43
43
|
}));
|
|
44
44
|
}
|
|
45
|
+
async getClientRegistration(providerId) {
|
|
46
|
+
const key = `dynamicAuthProvider:clientRegistration:${providerId}`;
|
|
47
|
+
const credentialsValue = await this.secretStorageService.get(key);
|
|
48
|
+
if (credentialsValue) {
|
|
49
|
+
try {
|
|
50
|
+
const credentials = JSON.parse(credentialsValue);
|
|
51
|
+
if (credentials && (credentials.clientId || credentials.clientSecret)) {
|
|
52
|
+
return credentials;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
await this.secretStorageService.delete(key);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const providers = this._getStoredProviders();
|
|
60
|
+
const provider = providers.find(p => p.providerId === providerId);
|
|
61
|
+
return provider?.clientId ? { clientId: provider.clientId } : undefined;
|
|
62
|
+
}
|
|
45
63
|
getClientId(providerId) {
|
|
46
64
|
const providers = this._getStoredProviders();
|
|
47
65
|
const provider = providers.find(p => p.providerId === providerId);
|
|
48
66
|
return provider?.clientId;
|
|
49
67
|
}
|
|
50
|
-
|
|
68
|
+
async storeClientRegistration(providerId, authorizationServer, clientId, clientSecret, label) {
|
|
51
69
|
this._trackProvider(providerId, authorizationServer, clientId, label);
|
|
70
|
+
const key = `dynamicAuthProvider:clientRegistration:${providerId}`;
|
|
71
|
+
const credentials = { clientId, clientSecret };
|
|
72
|
+
await this.secretStorageService.set(key, JSON.stringify(credentials));
|
|
52
73
|
}
|
|
53
74
|
_trackProvider(providerId, authorizationServer, clientId, label) {
|
|
54
75
|
const providers = this._getStoredProviders();
|
|
@@ -105,6 +126,8 @@ let DynamicAuthenticationProviderStorageService = class DynamicAuthenticationPro
|
|
|
105
126
|
const secretKey = JSON.stringify({ isDynamicAuthProvider: true, authProviderId: providerId, clientId: providerInfo.clientId });
|
|
106
127
|
await this.secretStorageService.delete(secretKey);
|
|
107
128
|
}
|
|
129
|
+
const credentialsKey = `dynamicAuthProvider:clientRegistration:${providerId}`;
|
|
130
|
+
await this.secretStorageService.delete(credentialsKey);
|
|
108
131
|
}
|
|
109
132
|
async getSessionsForDynamicAuthProvider(authProviderId, clientId) {
|
|
110
133
|
const key = JSON.stringify({ isDynamicAuthProvider: true, authProviderId, clientId });
|