@codingame/monaco-vscode-workspace-trust-service-override 31.0.0 → 32.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 +2 -2
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +120 -79
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +60 -60
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workspace-trust-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - workspace-trust service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "32.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -12,10 +12,10 @@ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
12
12
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
13
13
|
import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
|
|
14
14
|
import { IBannerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/banner/browser/bannerService.service";
|
|
15
|
+
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
15
16
|
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
16
17
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
17
18
|
import { IRemoteAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service";
|
|
18
|
-
import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service";
|
|
19
19
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
20
20
|
export declare class WorkspaceTrustContextKeys extends Disposable implements IWorkbenchContribution {
|
|
21
21
|
private readonly _ctxWorkspaceTrustEnabled;
|
|
@@ -29,8 +29,10 @@ export declare class WorkspaceTrustRequestHandler extends Disposable implements
|
|
|
29
29
|
private readonly workspaceContextService;
|
|
30
30
|
private readonly workspaceTrustManagementService;
|
|
31
31
|
private readonly workspaceTrustRequestService;
|
|
32
|
+
private readonly environmentService;
|
|
33
|
+
private readonly productService;
|
|
32
34
|
static readonly ID = "workbench.contrib.workspaceTrustRequestHandler";
|
|
33
|
-
constructor(dialogService: IDialogService, commandService: ICommandService, labelService: ILabelService, workspaceContextService: IWorkspaceContextService, workspaceTrustManagementService: IWorkspaceTrustManagementService, workspaceTrustRequestService: IWorkspaceTrustRequestService);
|
|
35
|
+
constructor(dialogService: IDialogService, commandService: ICommandService, labelService: ILabelService, workspaceContextService: IWorkspaceContextService, workspaceTrustManagementService: IWorkspaceTrustManagementService, workspaceTrustRequestService: IWorkspaceTrustRequestService, environmentService: IWorkbenchEnvironmentService, productService: IProductService);
|
|
34
36
|
private get useWorkspaceLanguage();
|
|
35
37
|
private registerListeners;
|
|
36
38
|
}
|
|
@@ -52,7 +54,7 @@ export declare class WorkspaceTrustUXHandler extends Disposable implements IWork
|
|
|
52
54
|
private readonly fileService;
|
|
53
55
|
private readonly entryId;
|
|
54
56
|
private readonly statusbarEntryAccessor;
|
|
55
|
-
constructor(dialogService: IDialogService, workspaceContextService: IWorkspaceContextService, workspaceTrustEnablementService: IWorkspaceTrustEnablementService, workspaceTrustManagementService: IWorkspaceTrustManagementService, configurationService: IConfigurationService, statusbarService: IStatusbarService, storageService: IStorageService, workspaceTrustRequestService: IWorkspaceTrustRequestService, bannerService: IBannerService, labelService: ILabelService, hostService: IHostService, productService: IProductService, remoteAgentService: IRemoteAgentService, environmentService:
|
|
57
|
+
constructor(dialogService: IDialogService, workspaceContextService: IWorkspaceContextService, workspaceTrustEnablementService: IWorkspaceTrustEnablementService, workspaceTrustManagementService: IWorkspaceTrustManagementService, configurationService: IConfigurationService, statusbarService: IStatusbarService, storageService: IStorageService, workspaceTrustRequestService: IWorkspaceTrustRequestService, bannerService: IBannerService, labelService: ILabelService, hostService: IHostService, productService: IProductService, remoteAgentService: IRemoteAgentService, environmentService: IWorkbenchEnvironmentService, fileService: IFileService);
|
|
56
58
|
private registerListeners;
|
|
57
59
|
private updateWorkbenchIndicators;
|
|
58
60
|
private doShowModal;
|
|
@@ -51,7 +51,6 @@ import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
51
51
|
import { securityConfigurationNodeBase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/configuration';
|
|
52
52
|
import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
53
53
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
54
|
-
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
55
54
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
56
55
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
57
56
|
|
|
@@ -59,6 +58,23 @@ registerCss(workspaceTrustEditor);
|
|
|
59
58
|
const BANNER_RESTRICTED_MODE = "workbench.banner.restrictedMode";
|
|
60
59
|
const STARTUP_PROMPT_SHOWN_KEY = "workspace.trust.startupPrompt.shown";
|
|
61
60
|
const BANNER_RESTRICTED_MODE_DISMISSED_KEY = "workbench.banner.restrictedMode.dismissed";
|
|
61
|
+
function getSessionsWindowTrustNote(environmentService, productService, isWorkspace) {
|
|
62
|
+
if (!environmentService.isSessionsWindow) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (isWorkspace) {
|
|
66
|
+
return localize(
|
|
67
|
+
16042,
|
|
68
|
+
"Trusting this workspace will also mark it as trusted in {0}.",
|
|
69
|
+
productService.nameLong
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return localize(
|
|
73
|
+
16043,
|
|
74
|
+
"Trusting this folder will also mark it as trusted in {0}.",
|
|
75
|
+
productService.nameLong
|
|
76
|
+
);
|
|
77
|
+
}
|
|
62
78
|
let WorkspaceTrustContextKeys = class WorkspaceTrustContextKeys extends Disposable {
|
|
63
79
|
constructor(
|
|
64
80
|
contextKeyService,
|
|
@@ -87,7 +103,9 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
87
103
|
labelService,
|
|
88
104
|
workspaceContextService,
|
|
89
105
|
workspaceTrustManagementService,
|
|
90
|
-
workspaceTrustRequestService
|
|
106
|
+
workspaceTrustRequestService,
|
|
107
|
+
environmentService,
|
|
108
|
+
productService
|
|
91
109
|
) {
|
|
92
110
|
super();
|
|
93
111
|
this.dialogService = dialogService;
|
|
@@ -96,6 +114,8 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
96
114
|
this.workspaceContextService = workspaceContextService;
|
|
97
115
|
this.workspaceTrustManagementService = workspaceTrustManagementService;
|
|
98
116
|
this.workspaceTrustRequestService = workspaceTrustRequestService;
|
|
117
|
+
this.environmentService = environmentService;
|
|
118
|
+
this.productService = productService;
|
|
99
119
|
this.registerListeners();
|
|
100
120
|
}
|
|
101
121
|
get useWorkspaceLanguage() {
|
|
@@ -107,29 +127,29 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
107
127
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
108
128
|
const markdownDetails = [
|
|
109
129
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(
|
|
110
|
-
|
|
130
|
+
16044,
|
|
111
131
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
112
132
|
)) : ( localize(
|
|
113
|
-
|
|
133
|
+
16045,
|
|
114
134
|
"You are trying to open untrusted files in a window which is trusted."
|
|
115
135
|
)),
|
|
116
136
|
( localize(
|
|
117
|
-
|
|
137
|
+
16046,
|
|
118
138
|
"If you don't want to open untrusted files, we recommend to open them in Restricted Mode in a new window as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
|
|
119
139
|
))
|
|
120
140
|
];
|
|
121
141
|
await this.dialogService.prompt({
|
|
122
142
|
type: Severity.Info,
|
|
123
|
-
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(
|
|
143
|
+
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(16047, "Do you want to allow untrusted files in this workspace?")) : ( localize(16048, "Do you want to allow untrusted files in this window?")),
|
|
124
144
|
buttons: [{
|
|
125
|
-
label: ( localize(
|
|
145
|
+
label: ( localize(16049, "&&Open")),
|
|
126
146
|
run: (
|
|
127
147
|
{
|
|
128
148
|
checkboxChecked
|
|
129
149
|
}
|
|
130
150
|
) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
131
151
|
}, {
|
|
132
|
-
label: ( localize(
|
|
152
|
+
label: ( localize(16050, "Open in &&Restricted Mode")),
|
|
133
153
|
run: (
|
|
134
154
|
{
|
|
135
155
|
checkboxChecked
|
|
@@ -140,7 +160,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
140
160
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
141
161
|
},
|
|
142
162
|
checkbox: {
|
|
143
|
-
label: ( localize(
|
|
163
|
+
label: ( localize(16051, "Remember my decision for all workspaces")),
|
|
144
164
|
checked: false
|
|
145
165
|
},
|
|
146
166
|
custom: {
|
|
@@ -158,17 +178,21 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
158
178
|
this.workspaceTrustRequestService.onDidInitiateResourcesTrustRequest(async options => {
|
|
159
179
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
160
180
|
const markdownDetails = [options?.message ?? ( localize(
|
|
161
|
-
|
|
181
|
+
16052,
|
|
162
182
|
"You are trying to open an untrusted folder. Do you trust the authors of this content?"
|
|
163
183
|
)), ( localize(
|
|
164
|
-
|
|
184
|
+
16053,
|
|
165
185
|
"If you don't trust the authors of these files, we recommend not continuing as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
|
|
166
186
|
)), `\`${this.labelService.getUriLabel(options.uri)}\``];
|
|
187
|
+
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, false);
|
|
188
|
+
if (sessionsTrustNote) {
|
|
189
|
+
markdownDetails.push(sessionsTrustNote);
|
|
190
|
+
}
|
|
167
191
|
await this.dialogService.prompt({
|
|
168
192
|
type: Severity.Info,
|
|
169
|
-
message: ( localize(
|
|
193
|
+
message: ( localize(16054, "Do you trust the authors of the files in this folder?")),
|
|
170
194
|
buttons: [{
|
|
171
|
-
label: ( localize(
|
|
195
|
+
label: ( localize(16055, "&&Trust Folder & Continue")),
|
|
172
196
|
run: () => this.workspaceTrustRequestService.completeResourcesTrustRequest(options.uri, WorkspaceTrustUriResponse.Open)
|
|
173
197
|
}],
|
|
174
198
|
cancelButton: {
|
|
@@ -188,25 +212,39 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
188
212
|
this._register(
|
|
189
213
|
this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async requestOptions => {
|
|
190
214
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
191
|
-
const message = this.useWorkspaceLanguage ? ( localize(
|
|
215
|
+
const message = this.useWorkspaceLanguage ? ( localize(16056, "Do you trust the authors of the files in this workspace?")) : ( localize(16057, "Do you trust the authors of the files in this folder?"));
|
|
192
216
|
const defaultDetails = ( localize(
|
|
193
|
-
|
|
217
|
+
16058,
|
|
194
218
|
"A feature you are trying to use may be a security risk if you do not trust the source of the files or folders you currently have open."
|
|
195
219
|
));
|
|
196
220
|
const details = requestOptions?.message ?? defaultDetails;
|
|
197
221
|
const buttons = requestOptions?.buttons ?? [{
|
|
198
|
-
label: this.useWorkspaceLanguage ? ( localize(
|
|
222
|
+
label: this.useWorkspaceLanguage ? ( localize(16059, "&&Trust Workspace & Continue")) : ( localize(16060, "&&Trust Folder & Continue")),
|
|
199
223
|
type: "ContinueWithTrust"
|
|
200
224
|
}, {
|
|
201
|
-
label: ( localize(
|
|
225
|
+
label: ( localize(16061, "&&Manage")),
|
|
202
226
|
type: "Manage"
|
|
203
227
|
}];
|
|
204
228
|
if (!( buttons.some(b => b.type === "Cancel"))) {
|
|
205
229
|
buttons.push({
|
|
206
|
-
label: ( localize(
|
|
230
|
+
label: ( localize(16062, "Cancel")),
|
|
207
231
|
type: "Cancel"
|
|
208
232
|
});
|
|
209
233
|
}
|
|
234
|
+
const markdownDetails = [{
|
|
235
|
+
markdown: ( new MarkdownString(details))
|
|
236
|
+
}, {
|
|
237
|
+
markdown: ( new MarkdownString(( localize(
|
|
238
|
+
16063,
|
|
239
|
+
"If you don't trust the authors of these files, we do not recommend continuing as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
|
|
240
|
+
))))
|
|
241
|
+
}];
|
|
242
|
+
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, this.useWorkspaceLanguage);
|
|
243
|
+
if (sessionsTrustNote) {
|
|
244
|
+
markdownDetails.push({
|
|
245
|
+
markdown: ( new MarkdownString(sessionsTrustNote))
|
|
246
|
+
});
|
|
247
|
+
}
|
|
210
248
|
const {
|
|
211
249
|
result
|
|
212
250
|
} = await this.dialogService.prompt({
|
|
@@ -214,14 +252,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
214
252
|
message,
|
|
215
253
|
custom: {
|
|
216
254
|
icon: Codicon.shield,
|
|
217
|
-
markdownDetails
|
|
218
|
-
markdown: ( new MarkdownString(details))
|
|
219
|
-
}, {
|
|
220
|
-
markdown: ( new MarkdownString(( localize(
|
|
221
|
-
15759,
|
|
222
|
-
"If you don't trust the authors of these files, we do not recommend continuing as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
|
|
223
|
-
))))
|
|
224
|
-
}]
|
|
255
|
+
markdownDetails
|
|
225
256
|
},
|
|
226
257
|
buttons: ( buttons.filter(b => b.type !== "Cancel").map(button => {
|
|
227
258
|
return {
|
|
@@ -259,7 +290,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
259
290
|
);
|
|
260
291
|
}
|
|
261
292
|
};
|
|
262
|
-
WorkspaceTrustRequestHandler = ( __decorate([( __param(0, IDialogService)), ( __param(1, ICommandService)), ( __param(2, ILabelService)), ( __param(3, IWorkspaceContextService)), ( __param(4, IWorkspaceTrustManagementService)), ( __param(5, IWorkspaceTrustRequestService))], WorkspaceTrustRequestHandler));
|
|
293
|
+
WorkspaceTrustRequestHandler = ( __decorate([( __param(0, IDialogService)), ( __param(1, ICommandService)), ( __param(2, ILabelService)), ( __param(3, IWorkspaceContextService)), ( __param(4, IWorkspaceTrustManagementService)), ( __param(5, IWorkspaceTrustRequestService)), ( __param(6, IWorkbenchEnvironmentService)), ( __param(7, IProductService))], WorkspaceTrustRequestHandler));
|
|
263
294
|
let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
264
295
|
constructor(
|
|
265
296
|
dialogService,
|
|
@@ -327,16 +358,21 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
327
358
|
if (trusted && (e.changes.added.length || e.changes.changed.length)) {
|
|
328
359
|
const addedFoldersTrustInfo = await Promise.all(( e.changes.added.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder.uri))));
|
|
329
360
|
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
361
|
+
let detail = ( localize(
|
|
362
|
+
16064,
|
|
363
|
+
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
364
|
+
));
|
|
365
|
+
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, false);
|
|
366
|
+
if (sessionsTrustNote) {
|
|
367
|
+
detail += "\n\n" + sessionsTrustNote;
|
|
368
|
+
}
|
|
330
369
|
const {
|
|
331
370
|
confirmed
|
|
332
371
|
} = await this.dialogService.confirm({
|
|
333
372
|
type: Severity.Info,
|
|
334
|
-
message: ( localize(
|
|
335
|
-
detail
|
|
336
|
-
|
|
337
|
-
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
338
|
-
)),
|
|
339
|
-
cancelButton: ( localize(15762, "No")),
|
|
373
|
+
message: ( localize(16065, "Do you trust the authors of the files in this folder?")),
|
|
374
|
+
detail,
|
|
375
|
+
cancelButton: ( localize(16066, "No")),
|
|
340
376
|
custom: {
|
|
341
377
|
icon: Codicon.shield
|
|
342
378
|
}
|
|
@@ -365,35 +401,40 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
365
401
|
} else {
|
|
366
402
|
console.warn("AI generated workspace trust dialog contents not available.");
|
|
367
403
|
}
|
|
368
|
-
const title = titleString ?? (this.useWorkspaceLanguage ? ( localize(
|
|
404
|
+
const title = titleString ?? (this.useWorkspaceLanguage ? ( localize(16056, "Do you trust the authors of the files in this workspace?")) : ( localize(16057, "Do you trust the authors of the files in this folder?")));
|
|
369
405
|
let checkboxText;
|
|
370
406
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
371
407
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
372
408
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
373
409
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
374
410
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
375
|
-
checkboxText = ( localize(
|
|
411
|
+
checkboxText = ( localize(16067, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
376
412
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
sublabel: isSingleFolderWorkspace ? ( localize(15765, "Trust folder and enable all features")) : ( localize(15766, "Trust workspace and enable all features"))
|
|
380
|
-
}, {
|
|
381
|
-
label: dontTrustOption ?? ( localize(15767, "&&No, I don't trust the authors")),
|
|
382
|
-
sublabel: isSingleFolderWorkspace ? ( localize(15768, "Open folder in restricted mode")) : ( localize(15769, "Open workspace in restricted mode"))
|
|
383
|
-
}, [!isSingleFolderWorkspace ? ( localize(
|
|
384
|
-
15770,
|
|
413
|
+
const markdownStrings = [!isSingleFolderWorkspace ? ( localize(
|
|
414
|
+
16068,
|
|
385
415
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
386
416
|
this.productService.nameShort
|
|
387
417
|
)) : ( localize(
|
|
388
|
-
|
|
418
|
+
16069,
|
|
389
419
|
"{0} provides features that may automatically execute files in this folder.",
|
|
390
420
|
this.productService.nameShort
|
|
391
421
|
)), learnMoreString ?? ( localize(
|
|
392
|
-
|
|
422
|
+
16070,
|
|
393
423
|
"If you don't trust the authors of these files, we recommend to continue in restricted mode as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
|
|
394
424
|
)), !isEmptyWindow ? `\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, {
|
|
395
425
|
verbose: Verbosity.LONG
|
|
396
|
-
})}\`` : ""]
|
|
426
|
+
})}\`` : ""];
|
|
427
|
+
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, !isSingleFolderWorkspace);
|
|
428
|
+
if (sessionsTrustNote) {
|
|
429
|
+
markdownStrings.push(sessionsTrustNote);
|
|
430
|
+
}
|
|
431
|
+
this.doShowModal(title, {
|
|
432
|
+
label: trustOption ?? ( localize(16071, "&&Yes, I trust the authors")),
|
|
433
|
+
sublabel: isSingleFolderWorkspace ? ( localize(16072, "Trust folder and enable all features")) : ( localize(16073, "Trust workspace and enable all features"))
|
|
434
|
+
}, {
|
|
435
|
+
label: dontTrustOption ?? ( localize(16074, "&&No, I don't trust the authors")),
|
|
436
|
+
sublabel: isSingleFolderWorkspace ? ( localize(16075, "Open folder in restricted mode")) : ( localize(16076, "Open workspace in restricted mode"))
|
|
437
|
+
}, markdownStrings, checkboxText);
|
|
397
438
|
})
|
|
398
439
|
);
|
|
399
440
|
}
|
|
@@ -515,10 +556,10 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
515
556
|
return undefined;
|
|
516
557
|
}
|
|
517
558
|
const actions = [{
|
|
518
|
-
label: ( localize(
|
|
559
|
+
label: ( localize(16077, "Manage")),
|
|
519
560
|
href: "command:" + MANAGE_TRUST_COMMAND_ID
|
|
520
561
|
}, {
|
|
521
|
-
label: ( localize(
|
|
562
|
+
label: ( localize(16078, "Learn More")),
|
|
522
563
|
href: "https://aka.ms/vscode-workspace-trust"
|
|
523
564
|
}];
|
|
524
565
|
return {
|
|
@@ -543,17 +584,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
543
584
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
544
585
|
case WorkbenchState.EMPTY:
|
|
545
586
|
return localize(
|
|
546
|
-
|
|
587
|
+
16079,
|
|
547
588
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
548
589
|
);
|
|
549
590
|
case WorkbenchState.FOLDER:
|
|
550
591
|
return localize(
|
|
551
|
-
|
|
592
|
+
16080,
|
|
552
593
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
553
594
|
);
|
|
554
595
|
case WorkbenchState.WORKSPACE:
|
|
555
596
|
return localize(
|
|
556
|
-
|
|
597
|
+
16081,
|
|
557
598
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
558
599
|
);
|
|
559
600
|
}
|
|
@@ -562,17 +603,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
562
603
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
563
604
|
case WorkbenchState.EMPTY:
|
|
564
605
|
return localize(
|
|
565
|
-
|
|
606
|
+
16082,
|
|
566
607
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
567
608
|
);
|
|
568
609
|
case WorkbenchState.FOLDER:
|
|
569
610
|
return localize(
|
|
570
|
-
|
|
611
|
+
16083,
|
|
571
612
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
572
613
|
);
|
|
573
614
|
case WorkbenchState.WORKSPACE:
|
|
574
615
|
return localize(
|
|
575
|
-
|
|
616
|
+
16084,
|
|
576
617
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
577
618
|
);
|
|
578
619
|
}
|
|
@@ -591,12 +632,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
591
632
|
case WorkbenchState.EMPTY:
|
|
592
633
|
{
|
|
593
634
|
ariaLabel = ( localize(
|
|
594
|
-
|
|
635
|
+
16085,
|
|
595
636
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
596
637
|
));
|
|
597
638
|
toolTip = {
|
|
598
639
|
value: ( localize(
|
|
599
|
-
|
|
640
|
+
16086,
|
|
600
641
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
601
642
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
602
643
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -609,12 +650,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
609
650
|
case WorkbenchState.FOLDER:
|
|
610
651
|
{
|
|
611
652
|
ariaLabel = ( localize(
|
|
612
|
-
|
|
653
|
+
16087,
|
|
613
654
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
614
655
|
));
|
|
615
656
|
toolTip = {
|
|
616
657
|
value: ( localize(
|
|
617
|
-
|
|
658
|
+
16088,
|
|
618
659
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
619
660
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
620
661
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -627,12 +668,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
627
668
|
case WorkbenchState.WORKSPACE:
|
|
628
669
|
{
|
|
629
670
|
ariaLabel = ( localize(
|
|
630
|
-
|
|
671
|
+
16089,
|
|
631
672
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
632
673
|
));
|
|
633
674
|
toolTip = {
|
|
634
675
|
value: ( localize(
|
|
635
|
-
|
|
676
|
+
16090,
|
|
636
677
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
637
678
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
638
679
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -644,8 +685,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
644
685
|
}
|
|
645
686
|
}
|
|
646
687
|
return {
|
|
647
|
-
name: ( localize(
|
|
648
|
-
text: `$(shield) ${( localize(
|
|
688
|
+
name: ( localize(16091, "Workspace Trust")),
|
|
689
|
+
text: `$(shield) ${( localize(16092, "Restricted Mode"))}`,
|
|
649
690
|
ariaLabel: ariaLabel,
|
|
650
691
|
tooltip: toolTip,
|
|
651
692
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -669,7 +710,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
669
710
|
}
|
|
670
711
|
}
|
|
671
712
|
};
|
|
672
|
-
WorkspaceTrustUXHandler = ( __decorate([( __param(0, IDialogService)), ( __param(1, IWorkspaceContextService)), ( __param(2, IWorkspaceTrustEnablementService)), ( __param(3, IWorkspaceTrustManagementService)), ( __param(4, IConfigurationService)), ( __param(5, IStatusbarService)), ( __param(6, IStorageService)), ( __param(7, IWorkspaceTrustRequestService)), ( __param(8, IBannerService)), ( __param(9, ILabelService)), ( __param(10, IHostService)), ( __param(11, IProductService)), ( __param(12, IRemoteAgentService)), ( __param(13,
|
|
713
|
+
WorkspaceTrustUXHandler = ( __decorate([( __param(0, IDialogService)), ( __param(1, IWorkspaceContextService)), ( __param(2, IWorkspaceTrustEnablementService)), ( __param(3, IWorkspaceTrustManagementService)), ( __param(4, IConfigurationService)), ( __param(5, IStatusbarService)), ( __param(6, IStorageService)), ( __param(7, IWorkspaceTrustRequestService)), ( __param(8, IBannerService)), ( __param(9, ILabelService)), ( __param(10, IHostService)), ( __param(11, IProductService)), ( __param(12, IRemoteAgentService)), ( __param(13, IWorkbenchEnvironmentService)), ( __param(14, IFileService))], WorkspaceTrustUXHandler));
|
|
673
714
|
registerWorkbenchContribution2(
|
|
674
715
|
WorkspaceTrustRequestHandler.ID,
|
|
675
716
|
WorkspaceTrustRequestHandler,
|
|
@@ -689,16 +730,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
689
730
|
}
|
|
690
731
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
691
732
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
692
|
-
EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
733
|
+
EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(16093, "Workspace Trust Editor"))),
|
|
693
734
|
[( new SyncDescriptor(WorkspaceTrustEditorInput))]
|
|
694
735
|
);
|
|
695
736
|
const CONFIGURE_TRUST_COMMAND_ID = "workbench.trust.configure";
|
|
696
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
737
|
+
const WORKSPACES_CATEGORY = ( localize2(16094, "Workspaces"));
|
|
697
738
|
registerAction2(class extends Action2 {
|
|
698
739
|
constructor() {
|
|
699
740
|
super({
|
|
700
741
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
701
|
-
title: ( localize2(
|
|
742
|
+
title: ( localize2(16095, "Configure Workspace Trust Settings")),
|
|
702
743
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
703
744
|
category: WORKSPACES_CATEGORY,
|
|
704
745
|
f1: true
|
|
@@ -715,7 +756,7 @@ registerAction2(class extends Action2 {
|
|
|
715
756
|
constructor() {
|
|
716
757
|
super({
|
|
717
758
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
718
|
-
title: ( localize2(
|
|
759
|
+
title: ( localize2(16096, "Manage Workspace Trust")),
|
|
719
760
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
720
761
|
category: WORKSPACES_CATEGORY,
|
|
721
762
|
f1: true
|
|
@@ -738,7 +779,7 @@ registerAction2(class extends Action2 {
|
|
|
738
779
|
type: "boolean",
|
|
739
780
|
default: true,
|
|
740
781
|
description: ( localize(
|
|
741
|
-
|
|
782
|
+
16097,
|
|
742
783
|
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
743
784
|
)),
|
|
744
785
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -747,29 +788,29 @@ registerAction2(class extends Action2 {
|
|
|
747
788
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
748
789
|
type: "string",
|
|
749
790
|
default: "once",
|
|
750
|
-
description: ( localize(
|
|
791
|
+
description: ( localize(16098, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
751
792
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
752
793
|
scope: ConfigurationScope.APPLICATION,
|
|
753
794
|
enum: ["always", "once", "never"],
|
|
754
|
-
enumDescriptions: [( localize(
|
|
795
|
+
enumDescriptions: [( localize(16099, "Ask for trust every time an untrusted workspace is opened.")), ( localize(16100, "Ask for trust the first time an untrusted workspace is opened.")), ( localize(16101, "Do not ask for trust when an untrusted workspace is opened."))]
|
|
755
796
|
},
|
|
756
797
|
[WORKSPACE_TRUST_BANNER]: {
|
|
757
798
|
type: "string",
|
|
758
799
|
default: "untilDismissed",
|
|
759
|
-
description: ( localize(
|
|
800
|
+
description: ( localize(16102, "Controls when the restricted mode banner is shown.")),
|
|
760
801
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
761
802
|
scope: ConfigurationScope.APPLICATION,
|
|
762
803
|
enum: ["always", "untilDismissed", "never"],
|
|
763
|
-
enumDescriptions: [( localize(
|
|
764
|
-
|
|
804
|
+
enumDescriptions: [( localize(16103, "Show the banner every time an untrusted workspace is open.")), ( localize(
|
|
805
|
+
16104,
|
|
765
806
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
766
|
-
)), ( localize(
|
|
807
|
+
)), ( localize(16105, "Do not show the banner when an untrusted workspace is open."))]
|
|
767
808
|
},
|
|
768
809
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
769
810
|
type: "string",
|
|
770
811
|
default: "prompt",
|
|
771
812
|
markdownDescription: ( localize(
|
|
772
|
-
|
|
813
|
+
16106,
|
|
773
814
|
"Controls how to handle opening untrusted files in a trusted workspace. This setting also applies to opening files in an empty window which is trusted via `#{0}#`.",
|
|
774
815
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
775
816
|
)),
|
|
@@ -777,13 +818,13 @@ registerAction2(class extends Action2 {
|
|
|
777
818
|
scope: ConfigurationScope.APPLICATION,
|
|
778
819
|
enum: ["prompt", "open", "newWindow"],
|
|
779
820
|
enumDescriptions: [( localize(
|
|
780
|
-
|
|
821
|
+
16107,
|
|
781
822
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
782
823
|
)), ( localize(
|
|
783
|
-
|
|
824
|
+
16108,
|
|
784
825
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
785
826
|
)), ( localize(
|
|
786
|
-
|
|
827
|
+
16109,
|
|
787
828
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
788
829
|
))]
|
|
789
830
|
},
|
|
@@ -791,7 +832,7 @@ registerAction2(class extends Action2 {
|
|
|
791
832
|
type: "boolean",
|
|
792
833
|
default: true,
|
|
793
834
|
markdownDescription: ( localize(
|
|
794
|
-
|
|
835
|
+
16110,
|
|
795
836
|
"Controls whether or not the empty window is trusted by default within VS Code. When used with `#{0}#`, you can enable the full functionality of VS Code without prompting in an empty window.",
|
|
796
837
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
797
838
|
)),
|
|
@@ -66,12 +66,12 @@ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
66
66
|
import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
67
67
|
|
|
68
68
|
var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
|
|
69
|
-
const shieldIcon = registerIcon("workspace-trust-banner", Codicon.shield, ( localize(
|
|
70
|
-
const checkListIcon = registerIcon("workspace-trust-editor-check", Codicon.check, ( localize(
|
|
71
|
-
const xListIcon = registerIcon("workspace-trust-editor-cross", Codicon.x, ( localize(
|
|
72
|
-
const folderPickerIcon = registerIcon("workspace-trust-editor-folder-picker", Codicon.folder, ( localize(
|
|
73
|
-
const editIcon = registerIcon("workspace-trust-editor-edit-folder", Codicon.edit, ( localize(
|
|
74
|
-
const removeIcon = registerIcon("workspace-trust-editor-remove-folder", Codicon.close, ( localize(
|
|
69
|
+
const shieldIcon = registerIcon("workspace-trust-banner", Codicon.shield, ( localize(16111, "Icon for workspace trust ion the banner.")));
|
|
70
|
+
const checkListIcon = registerIcon("workspace-trust-editor-check", Codicon.check, ( localize(16112, "Icon for the checkmark in the workspace trust editor.")));
|
|
71
|
+
const xListIcon = registerIcon("workspace-trust-editor-cross", Codicon.x, ( localize(16113, "Icon for the cross in the workspace trust editor.")));
|
|
72
|
+
const folderPickerIcon = registerIcon("workspace-trust-editor-folder-picker", Codicon.folder, ( localize(16114, "Icon for the pick folder icon in the workspace trust editor.")));
|
|
73
|
+
const editIcon = registerIcon("workspace-trust-editor-edit-folder", Codicon.edit, ( localize(16115, "Icon for the edit folder icon in the workspace trust editor.")));
|
|
74
|
+
const removeIcon = registerIcon("workspace-trust-editor-remove-folder", Codicon.close, ( localize(16116, "Icon for the remove folder icon in the workspace trust editor.")));
|
|
75
75
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
76
76
|
constructor(
|
|
77
77
|
container,
|
|
@@ -102,7 +102,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
102
102
|
const tableElement = container.appendChild($(".trusted-uris-table"));
|
|
103
103
|
const addButtonBarElement = container.appendChild($(".trusted-uris-button-bar"));
|
|
104
104
|
this.table = this.instantiationService.createInstance(WorkbenchTable, "WorkspaceTrust", tableElement, ( new TrustedUriTableVirtualDelegate()), [{
|
|
105
|
-
label: ( localize(
|
|
105
|
+
label: ( localize(16117, "Host")),
|
|
106
106
|
tooltip: "",
|
|
107
107
|
weight: 1,
|
|
108
108
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
@@ -110,7 +110,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
110
110
|
return row;
|
|
111
111
|
}
|
|
112
112
|
}, {
|
|
113
|
-
label: ( localize(
|
|
113
|
+
label: ( localize(16118, "Path")),
|
|
114
114
|
tooltip: "",
|
|
115
115
|
weight: 8,
|
|
116
116
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -140,16 +140,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
140
140
|
getAriaLabel: item => {
|
|
141
141
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
142
142
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
143
|
-
return localize(
|
|
143
|
+
return localize(16119, "{0}, trusted", this.labelService.getUriLabel(item.uri));
|
|
144
144
|
}
|
|
145
145
|
return localize(
|
|
146
|
-
|
|
146
|
+
16120,
|
|
147
147
|
"{0} on {1}, trusted",
|
|
148
148
|
this.labelService.getUriLabel(item.uri),
|
|
149
149
|
hostLabel
|
|
150
150
|
);
|
|
151
151
|
},
|
|
152
|
-
getWidgetAriaLabel: () => ( localize(
|
|
152
|
+
getWidgetAriaLabel: () => ( localize(16121, "Trusted Folders & Workspaces"))
|
|
153
153
|
},
|
|
154
154
|
identityProvider: {
|
|
155
155
|
getId(element) {
|
|
@@ -164,18 +164,18 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
164
164
|
}));
|
|
165
165
|
const buttonBar = this._register(( new ButtonBar(addButtonBarElement)));
|
|
166
166
|
const addButton = this._register(buttonBar.addButton({
|
|
167
|
-
title: ( localize(
|
|
167
|
+
title: ( localize(16122, "Add Folder")),
|
|
168
168
|
...defaultButtonStyles
|
|
169
169
|
}));
|
|
170
|
-
addButton.label = ( localize(
|
|
170
|
+
addButton.label = ( localize(16122, "Add Folder"));
|
|
171
171
|
this._register(addButton.onDidClick(async () => {
|
|
172
172
|
const uri = await this.fileDialogService.showOpenDialog({
|
|
173
173
|
canSelectFiles: false,
|
|
174
174
|
canSelectFolders: true,
|
|
175
175
|
canSelectMany: false,
|
|
176
176
|
defaultUri: this.currentWorkspaceUri,
|
|
177
|
-
openLabel: ( localize(
|
|
178
|
-
title: ( localize(
|
|
177
|
+
openLabel: ( localize(16123, "Trust Folder")),
|
|
178
|
+
title: ( localize(16124, "Select Folder To Trust"))
|
|
179
179
|
});
|
|
180
180
|
if (uri) {
|
|
181
181
|
this.workspaceTrustManagementService.setUrisTrust(uri, true);
|
|
@@ -258,9 +258,9 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
258
258
|
const entries = this.trustedUriEntries;
|
|
259
259
|
this.container.classList.toggle("empty", entries.length === 0);
|
|
260
260
|
this.descriptionElement.innerText = entries.length ? ( localize(
|
|
261
|
-
|
|
261
|
+
16125,
|
|
262
262
|
"You trust the following folders, their subfolders, and workspace files."
|
|
263
|
-
)) : ( localize(
|
|
263
|
+
)) : ( localize(16126, "You haven't trusted any folders or workspace files yet."));
|
|
264
264
|
this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
|
|
265
265
|
this.layout();
|
|
266
266
|
}
|
|
@@ -274,7 +274,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
274
274
|
return {
|
|
275
275
|
type: MessageType.WARNING,
|
|
276
276
|
content: ( localize(
|
|
277
|
-
|
|
277
|
+
16127,
|
|
278
278
|
"You will trust all repositories on {0}.",
|
|
279
279
|
getHostLabel(this.labelService, item)
|
|
280
280
|
))
|
|
@@ -284,7 +284,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
284
284
|
return {
|
|
285
285
|
type: MessageType.WARNING,
|
|
286
286
|
content: ( localize(
|
|
287
|
-
|
|
287
|
+
16128,
|
|
288
288
|
"You will trust all repositories and forks under '{0}' on {1}.",
|
|
289
289
|
segments[0],
|
|
290
290
|
getHostLabel(this.labelService, item)
|
|
@@ -294,7 +294,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
294
294
|
if (segments.length > 2) {
|
|
295
295
|
return {
|
|
296
296
|
type: MessageType.ERROR,
|
|
297
|
-
content: ( localize(
|
|
297
|
+
content: ( localize(16129, "You cannot trust individual folders within a repository.", path))
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
}
|
|
@@ -331,8 +331,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
331
331
|
canSelectFolders: true,
|
|
332
332
|
canSelectMany: false,
|
|
333
333
|
defaultUri: item.uri,
|
|
334
|
-
openLabel: ( localize(
|
|
335
|
-
title: ( localize(
|
|
334
|
+
openLabel: ( localize(16123, "Trust Folder")),
|
|
335
|
+
title: ( localize(16124, "Select Folder To Trust"))
|
|
336
336
|
});
|
|
337
337
|
if (uri) {
|
|
338
338
|
this.acceptEdit(item, uri[0]);
|
|
@@ -399,7 +399,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
399
399
|
class: ThemeIcon.asClassName(editIcon),
|
|
400
400
|
enabled: true,
|
|
401
401
|
id: "editTrustedUri",
|
|
402
|
-
tooltip: ( localize(
|
|
402
|
+
tooltip: ( localize(16130, "Edit Path")),
|
|
403
403
|
run: () => {
|
|
404
404
|
this.table.edit(item, false);
|
|
405
405
|
}
|
|
@@ -411,7 +411,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
411
411
|
class: ThemeIcon.asClassName(folderPickerIcon),
|
|
412
412
|
enabled: true,
|
|
413
413
|
id: "pickerTrustedUri",
|
|
414
|
-
tooltip: ( localize(
|
|
414
|
+
tooltip: ( localize(16131, "Open File Picker")),
|
|
415
415
|
run: () => {
|
|
416
416
|
this.table.edit(item, true);
|
|
417
417
|
}
|
|
@@ -423,7 +423,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
423
423
|
class: ThemeIcon.asClassName(removeIcon),
|
|
424
424
|
enabled: true,
|
|
425
425
|
id: "deleteTrustedUri",
|
|
426
|
-
tooltip: ( localize(
|
|
426
|
+
tooltip: ( localize(16132, "Delete Path")),
|
|
427
427
|
run: async () => {
|
|
428
428
|
await this.table.delete(item);
|
|
429
429
|
}
|
|
@@ -549,7 +549,7 @@ let TrustedUriPathColumnRenderer = class TrustedUriPathColumnRenderer {
|
|
|
549
549
|
};
|
|
550
550
|
TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( __decorate([( __param(1, IContextViewService))], TrustedUriPathColumnRenderer));
|
|
551
551
|
function getHostLabel(labelService, item) {
|
|
552
|
-
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(
|
|
552
|
+
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(16133, "Local"));
|
|
553
553
|
}
|
|
554
554
|
let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
|
|
555
555
|
static {
|
|
@@ -722,18 +722,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
722
722
|
getHeaderTitleText(trusted) {
|
|
723
723
|
if (trusted) {
|
|
724
724
|
if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
725
|
-
return localize(
|
|
725
|
+
return localize(16134, "This window is trusted");
|
|
726
726
|
}
|
|
727
727
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
728
728
|
case WorkbenchState.EMPTY:
|
|
729
|
-
return localize(
|
|
729
|
+
return localize(16135, "You trust this window");
|
|
730
730
|
case WorkbenchState.FOLDER:
|
|
731
|
-
return localize(
|
|
731
|
+
return localize(16136, "You trust this folder");
|
|
732
732
|
case WorkbenchState.WORKSPACE:
|
|
733
|
-
return localize(
|
|
733
|
+
return localize(16137, "You trust this workspace");
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
return localize(
|
|
736
|
+
return localize(16138, "You are in Restricted Mode");
|
|
737
737
|
}
|
|
738
738
|
getHeaderTitleIconClassNames(trusted) {
|
|
739
739
|
return ThemeIcon.asClassNameArray(shieldIcon);
|
|
@@ -744,36 +744,36 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
744
744
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
745
745
|
case WorkbenchState.EMPTY:
|
|
746
746
|
{
|
|
747
|
-
title = trusted ? ( localize(
|
|
747
|
+
title = trusted ? ( localize(16139, "In a Trusted Window")) : ( localize(16140, "In Restricted Mode"));
|
|
748
748
|
subTitle = trusted ? ( localize(
|
|
749
|
-
|
|
749
|
+
16141,
|
|
750
750
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
751
751
|
)) : ( localize(
|
|
752
|
-
|
|
752
|
+
16142,
|
|
753
753
|
"You do not trust the authors of the files in the current window. The following features are disabled:"
|
|
754
754
|
));
|
|
755
755
|
break;
|
|
756
756
|
}
|
|
757
757
|
case WorkbenchState.FOLDER:
|
|
758
758
|
{
|
|
759
|
-
title = trusted ? ( localize(
|
|
759
|
+
title = trusted ? ( localize(16143, "In a Trusted Folder")) : ( localize(16140, "In Restricted Mode"));
|
|
760
760
|
subTitle = trusted ? ( localize(
|
|
761
|
-
|
|
761
|
+
16144,
|
|
762
762
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
763
763
|
)) : ( localize(
|
|
764
|
-
|
|
764
|
+
16145,
|
|
765
765
|
"You do not trust the authors of the files in the current folder. The following features are disabled:"
|
|
766
766
|
));
|
|
767
767
|
break;
|
|
768
768
|
}
|
|
769
769
|
case WorkbenchState.WORKSPACE:
|
|
770
770
|
{
|
|
771
|
-
title = trusted ? ( localize(
|
|
771
|
+
title = trusted ? ( localize(16146, "In a Trusted Workspace")) : ( localize(16140, "In Restricted Mode"));
|
|
772
772
|
subTitle = trusted ? ( localize(
|
|
773
|
-
|
|
773
|
+
16147,
|
|
774
774
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
775
775
|
)) : ( localize(
|
|
776
|
-
|
|
776
|
+
16148,
|
|
777
777
|
"You do not trust the authors of the files in the current workspace. The following features are disabled:"
|
|
778
778
|
));
|
|
779
779
|
break;
|
|
@@ -796,16 +796,16 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
796
796
|
this.headerDescription.innerText = "";
|
|
797
797
|
const headerDescriptionText = append(this.headerDescription, $("div"));
|
|
798
798
|
headerDescriptionText.innerText = isWorkspaceTrusted ? ( localize(
|
|
799
|
-
|
|
799
|
+
16149,
|
|
800
800
|
"All features are enabled because trust has been granted to the workspace."
|
|
801
801
|
)) : ( localize(
|
|
802
|
-
|
|
802
|
+
16150,
|
|
803
803
|
"{0} is in a restricted mode intended for safe code browsing.",
|
|
804
804
|
this.productService.nameShort
|
|
805
805
|
));
|
|
806
806
|
const headerDescriptionActions = append(this.headerDescription, $("div"));
|
|
807
807
|
const headerDescriptionActionsText = ( localize(
|
|
808
|
-
|
|
808
|
+
16151,
|
|
809
809
|
"[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
|
|
810
810
|
`command:workbench.trust.configure`
|
|
811
811
|
));
|
|
@@ -820,7 +820,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
|
|
823
|
-
this.rootElement.setAttribute("aria-label", `${( localize(
|
|
823
|
+
this.rootElement.setAttribute("aria-label", `${( localize(16152, "Manage Workspace Trust"))}: ${this.headerContainer.innerText}`);
|
|
824
824
|
const restrictedSettings = this.configurationService.restrictedSettings;
|
|
825
825
|
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
826
826
|
const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
|
|
@@ -888,7 +888,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
888
888
|
tabIndex: "0"
|
|
889
889
|
}));
|
|
890
890
|
const configurationTitle = append(this.configurationContainer, $(".workspace-trusted-folders-title"));
|
|
891
|
-
configurationTitle.innerText = ( localize(
|
|
891
|
+
configurationTitle.innerText = ( localize(16121, "Trusted Folders & Workspaces"));
|
|
892
892
|
this.workspaceTrustedUrisTable = this._register(
|
|
893
893
|
this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer)
|
|
894
894
|
);
|
|
@@ -913,7 +913,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
913
913
|
clearNode(this.untrustedContainer);
|
|
914
914
|
const [trustedTitle, trustedSubTitle] = this.getFeaturesHeaderText(true);
|
|
915
915
|
this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
|
|
916
|
-
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(
|
|
916
|
+
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(16153, "Tasks are allowed to run")), ( localize(16154, "Debugging is enabled")), ( localize(16155, "All enabled extensions are activated"))] : [( localize(16153, "Tasks are allowed to run")), ( localize(16154, "Debugging is enabled")), ( localize(16156, "All workspace settings are applied")), ( localize(16155, "All enabled extensions are activated"))];
|
|
917
917
|
this.renderLimitationsListElement(
|
|
918
918
|
this.trustedContainer,
|
|
919
919
|
trustedContainerItems,
|
|
@@ -921,18 +921,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
921
921
|
);
|
|
922
922
|
const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
|
|
923
923
|
this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
|
|
924
|
-
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(
|
|
925
|
-
|
|
924
|
+
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(16157, "Tasks are not allowed to run")), ( localize(16158, "Debugging is disabled")), fixBadLocalizedLinks(( localize(
|
|
925
|
+
16159,
|
|
926
926
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
927
927
|
numExtensions,
|
|
928
928
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
929
|
-
)))] : [( localize(
|
|
930
|
-
|
|
929
|
+
)))] : [( localize(16157, "Tasks are not allowed to run")), ( localize(16158, "Debugging is disabled")), fixBadLocalizedLinks(numSettings ? ( localize(
|
|
930
|
+
16160,
|
|
931
931
|
"[{0} workspace settings]({1}) are not applied",
|
|
932
932
|
numSettings,
|
|
933
933
|
"command:settings.filterUntrusted"
|
|
934
|
-
)) : ( localize(
|
|
935
|
-
|
|
934
|
+
)) : ( localize(16161, "Workspace settings requiring trust are not applied"))), fixBadLocalizedLinks(( localize(
|
|
935
|
+
16159,
|
|
936
936
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
937
937
|
numExtensions,
|
|
938
938
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
@@ -966,7 +966,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
966
966
|
button.label = action.label;
|
|
967
967
|
button.enabled = enabled !== undefined ? enabled : action.enabled;
|
|
968
968
|
button.description = keybinding.getLabel();
|
|
969
|
-
button.element.ariaLabel = action.label + ", " + ( localize(
|
|
969
|
+
button.element.ariaLabel = action.label + ", " + ( localize(16162, "Keyboard Shortcut: {0}", keybinding.getAriaLabel()));
|
|
970
970
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
971
971
|
if (e) {
|
|
972
972
|
EventHelper.stop(e, true);
|
|
@@ -976,7 +976,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
addTrustButtonToElement(parent) {
|
|
979
|
-
const trustAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grant", ( localize(
|
|
979
|
+
const trustAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grant", ( localize(16163, "Trust")), undefined, true, async () => {
|
|
980
980
|
await this.workspaceTrustManagementService.setWorkspaceTrust(true);
|
|
981
981
|
})));
|
|
982
982
|
const trustActions = [{
|
|
@@ -988,11 +988,11 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
988
988
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
989
989
|
const trustMessageElement = append(parent, $(".trust-message-box"));
|
|
990
990
|
trustMessageElement.innerText = ( localize(
|
|
991
|
-
|
|
991
|
+
16164,
|
|
992
992
|
"Trust the authors of all files in the current folder or its parent '{0}'.",
|
|
993
993
|
name
|
|
994
994
|
));
|
|
995
|
-
const trustParentAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grantParent", ( localize(
|
|
995
|
+
const trustParentAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grantParent", ( localize(16165, "Trust Parent")), undefined, true, async () => {
|
|
996
996
|
await this.workspaceTrustManagementService.setParentFolderTrust(true);
|
|
997
997
|
})));
|
|
998
998
|
trustActions.push({
|
|
@@ -1004,7 +1004,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
1004
1004
|
}
|
|
1005
1005
|
addDontTrustButtonToElement(parent) {
|
|
1006
1006
|
this.createButtonRow(parent, [{
|
|
1007
|
-
action: this.rerenderDisposables.add(( new Action("workspace.trust.button.action.deny", ( localize(
|
|
1007
|
+
action: this.rerenderDisposables.add(( new Action("workspace.trust.button.action.deny", ( localize(16166, "Don't Trust")), undefined, true, async () => {
|
|
1008
1008
|
await this.workspaceTrustManagementService.setWorkspaceTrust(false);
|
|
1009
1009
|
}))),
|
|
1010
1010
|
keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? "Cmd+Enter" : "Ctrl+Enter")[0]
|
|
@@ -1017,14 +1017,14 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
1017
1017
|
const textElement = append(parent, $(".workspace-trust-untrusted-description"));
|
|
1018
1018
|
if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
1019
1019
|
textElement.innerText = this.workspaceService.getWorkbenchState() === WorkbenchState.WORKSPACE ? ( localize(
|
|
1020
|
-
|
|
1020
|
+
16167,
|
|
1021
1021
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
1022
1022
|
)) : ( localize(
|
|
1023
|
-
|
|
1023
|
+
16168,
|
|
1024
1024
|
"This folder is trusted via the bolded entries in the trusted folders below."
|
|
1025
1025
|
));
|
|
1026
1026
|
} else {
|
|
1027
|
-
textElement.innerText = ( localize(
|
|
1027
|
+
textElement.innerText = ( localize(16169, "This window is trusted by nature of the workspace that is opened."));
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
1030
|
renderLimitationsHeaderElement(parent, headerText, subtitleText) {
|
|
@@ -7,7 +7,7 @@ import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/th
|
|
|
7
7
|
import { EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
8
8
|
import { EditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput';
|
|
9
9
|
|
|
10
|
-
const WorkspaceTrustEditorIcon = registerIcon("workspace-trust-editor-label-icon", Codicon.shield, ( localize(
|
|
10
|
+
const WorkspaceTrustEditorIcon = registerIcon("workspace-trust-editor-label-icon", Codicon.shield, ( localize(17288, "Icon of the workspace trust editor label.")));
|
|
11
11
|
class WorkspaceTrustEditorInput extends EditorInput {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
@@ -29,7 +29,7 @@ class WorkspaceTrustEditorInput extends EditorInput {
|
|
|
29
29
|
return super.matches(otherInput) || otherInput instanceof WorkspaceTrustEditorInput;
|
|
30
30
|
}
|
|
31
31
|
getName() {
|
|
32
|
-
return localize(
|
|
32
|
+
return localize(17289, "Workspace Trust");
|
|
33
33
|
}
|
|
34
34
|
getIcon() {
|
|
35
35
|
return WorkspaceTrustEditorIcon;
|