@codingame/monaco-vscode-workspace-trust-service-override 37.2.0 → 37.3.1
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.js +77 -75
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +62 -62
- 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": "37.
|
|
3
|
+
"version": "37.3.1",
|
|
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": "37.
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.3.1"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -54,7 +54,7 @@ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
|
54
54
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
55
55
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
56
56
|
|
|
57
|
-
registerCss(workspaceTrustEditor);
|
|
57
|
+
registerCss(workspaceTrustEditor, 1);
|
|
58
58
|
const BANNER_RESTRICTED_MODE = "workbench.banner.restrictedMode";
|
|
59
59
|
const STARTUP_PROMPT_SHOWN_KEY = "workspace.trust.startupPrompt.shown";
|
|
60
60
|
const BANNER_RESTRICTED_MODE_DISMISSED_KEY = "workbench.banner.restrictedMode.dismissed";
|
|
@@ -64,13 +64,13 @@ function getSessionsWindowTrustNote(environmentService, productService, isWorksp
|
|
|
64
64
|
}
|
|
65
65
|
if (isWorkspace) {
|
|
66
66
|
return localize(
|
|
67
|
-
|
|
67
|
+
21270,
|
|
68
68
|
"Trusting this workspace will also mark it as trusted in {0}.",
|
|
69
69
|
productService.nameLong
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
return localize(
|
|
73
|
-
|
|
73
|
+
21271,
|
|
74
74
|
"Trusting this folder will also mark it as trusted in {0}.",
|
|
75
75
|
productService.nameLong
|
|
76
76
|
);
|
|
@@ -127,29 +127,29 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
127
127
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
128
128
|
const markdownDetails = [
|
|
129
129
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(
|
|
130
|
-
|
|
130
|
+
21272,
|
|
131
131
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
132
132
|
)) : ( localize(
|
|
133
|
-
|
|
133
|
+
21273,
|
|
134
134
|
"You are trying to open untrusted files in a window which is trusted."
|
|
135
135
|
)),
|
|
136
136
|
( localize(
|
|
137
|
-
|
|
137
|
+
21274,
|
|
138
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."
|
|
139
139
|
))
|
|
140
140
|
];
|
|
141
141
|
await this.dialogService.prompt({
|
|
142
142
|
type: Severity.Info,
|
|
143
|
-
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(
|
|
143
|
+
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(21275, "Do you want to allow untrusted files in this workspace?")) : ( localize(21276, "Do you want to allow untrusted files in this window?")),
|
|
144
144
|
buttons: [{
|
|
145
|
-
label: ( localize(
|
|
145
|
+
label: ( localize(21277, "&&Open")),
|
|
146
146
|
run: (
|
|
147
147
|
{
|
|
148
148
|
checkboxChecked
|
|
149
149
|
}
|
|
150
150
|
) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
151
151
|
}, {
|
|
152
|
-
label: ( localize(
|
|
152
|
+
label: ( localize(21278, "Open in &&Restricted Mode")),
|
|
153
153
|
run: (
|
|
154
154
|
{
|
|
155
155
|
checkboxChecked
|
|
@@ -160,16 +160,16 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
160
160
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
161
161
|
},
|
|
162
162
|
checkbox: {
|
|
163
|
-
label: ( localize(
|
|
163
|
+
label: ( localize(21279, "Remember my decision for all workspaces")),
|
|
164
164
|
checked: false
|
|
165
165
|
},
|
|
166
166
|
custom: {
|
|
167
167
|
icon: Codicon.shield,
|
|
168
|
-
markdownDetails:
|
|
168
|
+
markdownDetails: markdownDetails.map(md => {
|
|
169
169
|
return {
|
|
170
170
|
markdown: ( new MarkdownString(md))
|
|
171
171
|
};
|
|
172
|
-
})
|
|
172
|
+
})
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
})
|
|
@@ -178,10 +178,10 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
178
178
|
this.workspaceTrustRequestService.onDidInitiateResourcesTrustRequest(async options => {
|
|
179
179
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
180
180
|
const markdownDetails = [options?.message ?? ( localize(
|
|
181
|
-
|
|
181
|
+
21280,
|
|
182
182
|
"You are trying to open an untrusted folder. Do you trust the authors of this content?"
|
|
183
183
|
)), ( localize(
|
|
184
|
-
|
|
184
|
+
21281,
|
|
185
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."
|
|
186
186
|
)), `\`${this.labelService.getUriLabel(options.uri)}\``];
|
|
187
187
|
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, false);
|
|
@@ -190,9 +190,9 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
190
190
|
}
|
|
191
191
|
await this.dialogService.prompt({
|
|
192
192
|
type: Severity.Info,
|
|
193
|
-
message: ( localize(
|
|
193
|
+
message: ( localize(21282, "Do you trust the authors of the files in this folder?")),
|
|
194
194
|
buttons: [{
|
|
195
|
-
label: ( localize(
|
|
195
|
+
label: ( localize(21283, "&&Trust Folder & Continue")),
|
|
196
196
|
run: () => this.workspaceTrustRequestService.completeResourcesTrustRequest(options.uri, WorkspaceTrustUriResponse.Open)
|
|
197
197
|
}],
|
|
198
198
|
cancelButton: {
|
|
@@ -200,11 +200,11 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
200
200
|
},
|
|
201
201
|
custom: {
|
|
202
202
|
icon: Codicon.shield,
|
|
203
|
-
markdownDetails:
|
|
203
|
+
markdownDetails: markdownDetails.map(md => {
|
|
204
204
|
return {
|
|
205
205
|
markdown: ( new MarkdownString(md))
|
|
206
206
|
};
|
|
207
|
-
})
|
|
207
|
+
})
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
})
|
|
@@ -212,22 +212,22 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
212
212
|
this._register(
|
|
213
213
|
this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async requestOptions => {
|
|
214
214
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
215
|
-
const message = this.useWorkspaceLanguage ? ( localize(
|
|
215
|
+
const message = this.useWorkspaceLanguage ? ( localize(21284, "Do you trust the authors of the files in this workspace?")) : ( localize(21285, "Do you trust the authors of the files in this folder?"));
|
|
216
216
|
const defaultDetails = ( localize(
|
|
217
|
-
|
|
217
|
+
21286,
|
|
218
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."
|
|
219
219
|
));
|
|
220
220
|
const details = requestOptions?.message ?? defaultDetails;
|
|
221
221
|
const buttons = requestOptions?.buttons ?? [{
|
|
222
|
-
label: this.useWorkspaceLanguage ? ( localize(
|
|
222
|
+
label: this.useWorkspaceLanguage ? ( localize(21287, "&&Trust Workspace & Continue")) : ( localize(21288, "&&Trust Folder & Continue")),
|
|
223
223
|
type: "ContinueWithTrust"
|
|
224
224
|
}, {
|
|
225
|
-
label: ( localize(
|
|
225
|
+
label: ( localize(21289, "&&Manage")),
|
|
226
226
|
type: "Manage"
|
|
227
227
|
}];
|
|
228
228
|
if (!( buttons.some(b => b.type === "Cancel"))) {
|
|
229
229
|
buttons.push({
|
|
230
|
-
label: ( localize(
|
|
230
|
+
label: ( localize(21290, "Cancel")),
|
|
231
231
|
type: "Cancel"
|
|
232
232
|
});
|
|
233
233
|
}
|
|
@@ -235,7 +235,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
235
235
|
markdown: ( new MarkdownString(details))
|
|
236
236
|
}, {
|
|
237
237
|
markdown: ( new MarkdownString(( localize(
|
|
238
|
-
|
|
238
|
+
21291,
|
|
239
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
240
|
))))
|
|
241
241
|
}];
|
|
@@ -254,12 +254,12 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
254
254
|
icon: Codicon.shield,
|
|
255
255
|
markdownDetails
|
|
256
256
|
},
|
|
257
|
-
buttons:
|
|
257
|
+
buttons: buttons.filter(b => b.type !== "Cancel").map(button => {
|
|
258
258
|
return {
|
|
259
259
|
label: button.label,
|
|
260
260
|
run: () => button.type
|
|
261
261
|
};
|
|
262
|
-
})
|
|
262
|
+
}),
|
|
263
263
|
cancelButton: (() => {
|
|
264
264
|
const cancelButton = buttons.find(b => b.type === "Cancel");
|
|
265
265
|
if (!cancelButton) {
|
|
@@ -356,10 +356,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
356
356
|
const addWorkspaceFolder = async e => {
|
|
357
357
|
const trusted = this.workspaceTrustManagementService.isWorkspaceTrusted();
|
|
358
358
|
if (trusted && (e.changes.added.length || e.changes.changed.length)) {
|
|
359
|
-
const addedFoldersTrustInfo = await Promise.all(
|
|
360
|
-
|
|
359
|
+
const addedFoldersTrustInfo = await Promise.all(
|
|
360
|
+
e.changes.added.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder.uri))
|
|
361
|
+
);
|
|
362
|
+
if (!addedFoldersTrustInfo.map(info => info.trusted).every(trusted => trusted)) {
|
|
361
363
|
let detail = ( localize(
|
|
362
|
-
|
|
364
|
+
21292,
|
|
363
365
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
364
366
|
));
|
|
365
367
|
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, false);
|
|
@@ -370,14 +372,14 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
370
372
|
confirmed
|
|
371
373
|
} = await this.dialogService.confirm({
|
|
372
374
|
type: Severity.Info,
|
|
373
|
-
message: ( localize(
|
|
375
|
+
message: ( localize(21293, "Do you trust the authors of the files in this folder?")),
|
|
374
376
|
detail,
|
|
375
|
-
cancelButton: ( localize(
|
|
377
|
+
cancelButton: ( localize(21294, "No")),
|
|
376
378
|
custom: {
|
|
377
379
|
icon: Codicon.shield
|
|
378
380
|
}
|
|
379
381
|
});
|
|
380
|
-
await this.workspaceTrustManagementService.setUrisTrust(
|
|
382
|
+
await this.workspaceTrustManagementService.setUrisTrust(addedFoldersTrustInfo.map(i => i.uri), confirmed);
|
|
381
383
|
}
|
|
382
384
|
}
|
|
383
385
|
};
|
|
@@ -401,25 +403,25 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
401
403
|
} else {
|
|
402
404
|
console.warn("AI generated workspace trust dialog contents not available.");
|
|
403
405
|
}
|
|
404
|
-
const title = titleString ?? (this.useWorkspaceLanguage ? ( localize(
|
|
406
|
+
const title = titleString ?? (this.useWorkspaceLanguage ? ( localize(21284, "Do you trust the authors of the files in this workspace?")) : ( localize(21285, "Do you trust the authors of the files in this folder?")));
|
|
405
407
|
let checkboxText;
|
|
406
408
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
407
409
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
408
410
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
409
411
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
410
412
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
411
|
-
checkboxText = ( localize(
|
|
413
|
+
checkboxText = ( localize(21295, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
412
414
|
}
|
|
413
415
|
const markdownStrings = [!isSingleFolderWorkspace ? ( localize(
|
|
414
|
-
|
|
416
|
+
21296,
|
|
415
417
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
416
418
|
this.productService.nameShort
|
|
417
419
|
)) : ( localize(
|
|
418
|
-
|
|
420
|
+
21297,
|
|
419
421
|
"{0} provides features that may automatically execute files in this folder.",
|
|
420
422
|
this.productService.nameShort
|
|
421
423
|
)), learnMoreString ?? ( localize(
|
|
422
|
-
|
|
424
|
+
21298,
|
|
423
425
|
"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."
|
|
424
426
|
)), !isEmptyWindow ? `\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, {
|
|
425
427
|
verbose: Verbosity.LONG
|
|
@@ -429,11 +431,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
429
431
|
markdownStrings.push(sessionsTrustNote);
|
|
430
432
|
}
|
|
431
433
|
this.doShowModal(title, {
|
|
432
|
-
label: trustOption ?? ( localize(
|
|
433
|
-
sublabel: isSingleFolderWorkspace ? ( localize(
|
|
434
|
+
label: trustOption ?? ( localize(21299, "&&Yes, I trust the authors")),
|
|
435
|
+
sublabel: isSingleFolderWorkspace ? ( localize(21300, "Trust folder and enable all features")) : ( localize(21301, "Trust workspace and enable all features"))
|
|
434
436
|
}, {
|
|
435
|
-
label: dontTrustOption ?? ( localize(
|
|
436
|
-
sublabel: isSingleFolderWorkspace ? ( localize(
|
|
437
|
+
label: dontTrustOption ?? ( localize(21302, "&&No, I don't trust the authors")),
|
|
438
|
+
sublabel: isSingleFolderWorkspace ? ( localize(21303, "Open folder in restricted mode")) : ( localize(21304, "Open workspace in restricted mode"))
|
|
437
439
|
}, markdownStrings, checkboxText);
|
|
438
440
|
})
|
|
439
441
|
);
|
|
@@ -486,11 +488,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
486
488
|
buttonDetails: [trustedOption.sublabel, untrustedOption.sublabel],
|
|
487
489
|
disableCloseAction: true,
|
|
488
490
|
icon: Codicon.shield,
|
|
489
|
-
markdownDetails:
|
|
491
|
+
markdownDetails: markdownStrings.map(md => {
|
|
490
492
|
return {
|
|
491
493
|
markdown: ( new MarkdownString(md))
|
|
492
494
|
};
|
|
493
|
-
})
|
|
495
|
+
})
|
|
494
496
|
}
|
|
495
497
|
});
|
|
496
498
|
this.storageService.store(
|
|
@@ -556,10 +558,10 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
556
558
|
return undefined;
|
|
557
559
|
}
|
|
558
560
|
const actions = [{
|
|
559
|
-
label: ( localize(
|
|
561
|
+
label: ( localize(21305, "Manage")),
|
|
560
562
|
href: "command:" + MANAGE_TRUST_COMMAND_ID
|
|
561
563
|
}, {
|
|
562
|
-
label: ( localize(
|
|
564
|
+
label: ( localize(21306, "Learn More")),
|
|
563
565
|
href: "https://aka.ms/vscode-workspace-trust"
|
|
564
566
|
}];
|
|
565
567
|
return {
|
|
@@ -584,17 +586,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
584
586
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
585
587
|
case WorkbenchState.EMPTY:
|
|
586
588
|
return localize(
|
|
587
|
-
|
|
589
|
+
21307,
|
|
588
590
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
589
591
|
);
|
|
590
592
|
case WorkbenchState.FOLDER:
|
|
591
593
|
return localize(
|
|
592
|
-
|
|
594
|
+
21308,
|
|
593
595
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
594
596
|
);
|
|
595
597
|
case WorkbenchState.WORKSPACE:
|
|
596
598
|
return localize(
|
|
597
|
-
|
|
599
|
+
21309,
|
|
598
600
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
599
601
|
);
|
|
600
602
|
}
|
|
@@ -603,17 +605,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
603
605
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
604
606
|
case WorkbenchState.EMPTY:
|
|
605
607
|
return localize(
|
|
606
|
-
|
|
608
|
+
21310,
|
|
607
609
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
608
610
|
);
|
|
609
611
|
case WorkbenchState.FOLDER:
|
|
610
612
|
return localize(
|
|
611
|
-
|
|
613
|
+
21311,
|
|
612
614
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
613
615
|
);
|
|
614
616
|
case WorkbenchState.WORKSPACE:
|
|
615
617
|
return localize(
|
|
616
|
-
|
|
618
|
+
21312,
|
|
617
619
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
618
620
|
);
|
|
619
621
|
}
|
|
@@ -632,12 +634,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
632
634
|
case WorkbenchState.EMPTY:
|
|
633
635
|
{
|
|
634
636
|
ariaLabel = ( localize(
|
|
635
|
-
|
|
637
|
+
21313,
|
|
636
638
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
637
639
|
));
|
|
638
640
|
toolTip = {
|
|
639
641
|
value: ( localize(
|
|
640
|
-
|
|
642
|
+
21314,
|
|
641
643
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
642
644
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
643
645
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -650,12 +652,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
650
652
|
case WorkbenchState.FOLDER:
|
|
651
653
|
{
|
|
652
654
|
ariaLabel = ( localize(
|
|
653
|
-
|
|
655
|
+
21315,
|
|
654
656
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
655
657
|
));
|
|
656
658
|
toolTip = {
|
|
657
659
|
value: ( localize(
|
|
658
|
-
|
|
660
|
+
21316,
|
|
659
661
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
660
662
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
661
663
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -668,12 +670,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
668
670
|
case WorkbenchState.WORKSPACE:
|
|
669
671
|
{
|
|
670
672
|
ariaLabel = ( localize(
|
|
671
|
-
|
|
673
|
+
21317,
|
|
672
674
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
673
675
|
));
|
|
674
676
|
toolTip = {
|
|
675
677
|
value: ( localize(
|
|
676
|
-
|
|
678
|
+
21318,
|
|
677
679
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
678
680
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
679
681
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -685,8 +687,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
685
687
|
}
|
|
686
688
|
}
|
|
687
689
|
return {
|
|
688
|
-
name: ( localize(
|
|
689
|
-
text: `$(shield) ${( localize(
|
|
690
|
+
name: ( localize(21319, "Workspace Trust")),
|
|
691
|
+
text: `$(shield) ${( localize(21320, "Restricted Mode"))}`,
|
|
690
692
|
ariaLabel: ariaLabel,
|
|
691
693
|
tooltip: toolTip,
|
|
692
694
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -730,16 +732,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
730
732
|
}
|
|
731
733
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
732
734
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
733
|
-
EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
735
|
+
EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(21321, "Workspace Trust Editor"))),
|
|
734
736
|
[( new SyncDescriptor(WorkspaceTrustEditorInput))]
|
|
735
737
|
);
|
|
736
738
|
const CONFIGURE_TRUST_COMMAND_ID = "workbench.trust.configure";
|
|
737
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
739
|
+
const WORKSPACES_CATEGORY = ( localize2(21322, "Workspaces"));
|
|
738
740
|
registerAction2(class extends Action2 {
|
|
739
741
|
constructor() {
|
|
740
742
|
super({
|
|
741
743
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
742
|
-
title: ( localize2(
|
|
744
|
+
title: ( localize2(21323, "Configure Workspace Trust Settings")),
|
|
743
745
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
744
746
|
category: WORKSPACES_CATEGORY,
|
|
745
747
|
f1: true
|
|
@@ -756,7 +758,7 @@ registerAction2(class extends Action2 {
|
|
|
756
758
|
constructor() {
|
|
757
759
|
super({
|
|
758
760
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
759
|
-
title: ( localize2(
|
|
761
|
+
title: ( localize2(21324, "Manage Workspace Trust")),
|
|
760
762
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
761
763
|
category: WORKSPACES_CATEGORY,
|
|
762
764
|
f1: true
|
|
@@ -779,7 +781,7 @@ registerAction2(class extends Action2 {
|
|
|
779
781
|
type: "boolean",
|
|
780
782
|
default: true,
|
|
781
783
|
description: ( localize(
|
|
782
|
-
|
|
784
|
+
21325,
|
|
783
785
|
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
784
786
|
)),
|
|
785
787
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -788,29 +790,29 @@ registerAction2(class extends Action2 {
|
|
|
788
790
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
789
791
|
type: "string",
|
|
790
792
|
default: "never",
|
|
791
|
-
description: ( localize(
|
|
793
|
+
description: ( localize(21326, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
792
794
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
793
795
|
scope: ConfigurationScope.APPLICATION,
|
|
794
796
|
enum: ["always", "once", "never"],
|
|
795
|
-
enumDescriptions: [( localize(
|
|
797
|
+
enumDescriptions: [( localize(21327, "Ask for trust every time an untrusted workspace is opened.")), ( localize(21328, "Ask for trust the first time an untrusted workspace is opened.")), ( localize(21329, "Do not ask for trust when an untrusted workspace is opened."))]
|
|
796
798
|
},
|
|
797
799
|
[WORKSPACE_TRUST_BANNER]: {
|
|
798
800
|
type: "string",
|
|
799
801
|
default: "untilDismissed",
|
|
800
|
-
description: ( localize(
|
|
802
|
+
description: ( localize(21330, "Controls when the restricted mode banner is shown.")),
|
|
801
803
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
802
804
|
scope: ConfigurationScope.APPLICATION,
|
|
803
805
|
enum: ["always", "untilDismissed", "never"],
|
|
804
|
-
enumDescriptions: [( localize(
|
|
805
|
-
|
|
806
|
+
enumDescriptions: [( localize(21331, "Show the banner every time an untrusted workspace is open.")), ( localize(
|
|
807
|
+
21332,
|
|
806
808
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
807
|
-
)), ( localize(
|
|
809
|
+
)), ( localize(21333, "Do not show the banner when an untrusted workspace is open."))]
|
|
808
810
|
},
|
|
809
811
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
810
812
|
type: "string",
|
|
811
813
|
default: "prompt",
|
|
812
814
|
markdownDescription: ( localize(
|
|
813
|
-
|
|
815
|
+
21334,
|
|
814
816
|
"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}#`.",
|
|
815
817
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
816
818
|
)),
|
|
@@ -818,13 +820,13 @@ registerAction2(class extends Action2 {
|
|
|
818
820
|
scope: ConfigurationScope.APPLICATION,
|
|
819
821
|
enum: ["prompt", "open", "newWindow"],
|
|
820
822
|
enumDescriptions: [( localize(
|
|
821
|
-
|
|
823
|
+
21335,
|
|
822
824
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
823
825
|
)), ( localize(
|
|
824
|
-
|
|
826
|
+
21336,
|
|
825
827
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
826
828
|
)), ( localize(
|
|
827
|
-
|
|
829
|
+
21337,
|
|
828
830
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
829
831
|
))]
|
|
830
832
|
},
|
|
@@ -832,7 +834,7 @@ registerAction2(class extends Action2 {
|
|
|
832
834
|
type: "boolean",
|
|
833
835
|
default: true,
|
|
834
836
|
markdownDescription: ( localize(
|
|
835
|
-
|
|
837
|
+
21338,
|
|
836
838
|
"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.",
|
|
837
839
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
838
840
|
)),
|
|
@@ -65,12 +65,12 @@ import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/
|
|
|
65
65
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
66
66
|
|
|
67
67
|
var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
|
|
68
|
-
const shieldIcon = registerIcon("workspace-trust-banner", Codicon.shield, ( localize(
|
|
69
|
-
const checkListIcon = registerIcon("workspace-trust-editor-check", Codicon.check, ( localize(
|
|
70
|
-
const xListIcon = registerIcon("workspace-trust-editor-cross", Codicon.x, ( localize(
|
|
71
|
-
const folderPickerIcon = registerIcon("workspace-trust-editor-folder-picker", Codicon.folder, ( localize(
|
|
72
|
-
const editIcon = registerIcon("workspace-trust-editor-edit-folder", Codicon.edit, ( localize(
|
|
73
|
-
const removeIcon = registerIcon("workspace-trust-editor-remove-folder", Codicon.close, ( localize(
|
|
68
|
+
const shieldIcon = registerIcon("workspace-trust-banner", Codicon.shield, ( localize(21339, "Icon for workspace trust ion the banner.")));
|
|
69
|
+
const checkListIcon = registerIcon("workspace-trust-editor-check", Codicon.check, ( localize(21340, "Icon for the checkmark in the workspace trust editor.")));
|
|
70
|
+
const xListIcon = registerIcon("workspace-trust-editor-cross", Codicon.x, ( localize(21341, "Icon for the cross in the workspace trust editor.")));
|
|
71
|
+
const folderPickerIcon = registerIcon("workspace-trust-editor-folder-picker", Codicon.folder, ( localize(21342, "Icon for the pick folder icon in the workspace trust editor.")));
|
|
72
|
+
const editIcon = registerIcon("workspace-trust-editor-edit-folder", Codicon.edit, ( localize(21343, "Icon for the edit folder icon in the workspace trust editor.")));
|
|
73
|
+
const removeIcon = registerIcon("workspace-trust-editor-remove-folder", Codicon.close, ( localize(21344, "Icon for the remove folder icon in the workspace trust editor.")));
|
|
74
74
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
75
75
|
constructor(
|
|
76
76
|
container,
|
|
@@ -101,7 +101,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
101
101
|
const tableElement = container.appendChild($(".trusted-uris-table"));
|
|
102
102
|
const addButtonBarElement = container.appendChild($(".trusted-uris-button-bar"));
|
|
103
103
|
this.table = this.instantiationService.createInstance(WorkbenchTable, "WorkspaceTrust", tableElement, ( new TrustedUriTableVirtualDelegate()), [{
|
|
104
|
-
label: ( localize(
|
|
104
|
+
label: ( localize(21345, "Host")),
|
|
105
105
|
tooltip: "",
|
|
106
106
|
weight: 1,
|
|
107
107
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
@@ -109,7 +109,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
109
109
|
return row;
|
|
110
110
|
}
|
|
111
111
|
}, {
|
|
112
|
-
label: ( localize(
|
|
112
|
+
label: ( localize(21346, "Path")),
|
|
113
113
|
tooltip: "",
|
|
114
114
|
weight: 8,
|
|
115
115
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -139,16 +139,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
139
139
|
getAriaLabel: item => {
|
|
140
140
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
141
141
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
142
|
-
return localize(
|
|
142
|
+
return localize(21347, "{0}, trusted", this.labelService.getUriLabel(item.uri));
|
|
143
143
|
}
|
|
144
144
|
return localize(
|
|
145
|
-
|
|
145
|
+
21348,
|
|
146
146
|
"{0} on {1}, trusted",
|
|
147
147
|
this.labelService.getUriLabel(item.uri),
|
|
148
148
|
hostLabel
|
|
149
149
|
);
|
|
150
150
|
},
|
|
151
|
-
getWidgetAriaLabel: () => ( localize(
|
|
151
|
+
getWidgetAriaLabel: () => ( localize(21349, "Trusted Folders & Workspaces"))
|
|
152
152
|
},
|
|
153
153
|
identityProvider: {
|
|
154
154
|
getId(element) {
|
|
@@ -163,18 +163,18 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
163
163
|
}));
|
|
164
164
|
const buttonBar = this._register(( new ButtonBar(addButtonBarElement)));
|
|
165
165
|
const addButton = this._register(buttonBar.addButton({
|
|
166
|
-
title: ( localize(
|
|
166
|
+
title: ( localize(21350, "Add Folder")),
|
|
167
167
|
...defaultButtonStyles
|
|
168
168
|
}));
|
|
169
|
-
addButton.label = ( localize(
|
|
169
|
+
addButton.label = ( localize(21350, "Add Folder"));
|
|
170
170
|
this._register(addButton.onDidClick(async () => {
|
|
171
171
|
const uri = await this.fileDialogService.showOpenDialog({
|
|
172
172
|
canSelectFiles: false,
|
|
173
173
|
canSelectFolders: true,
|
|
174
174
|
canSelectMany: false,
|
|
175
175
|
defaultUri: this.currentWorkspaceUri,
|
|
176
|
-
openLabel: ( localize(
|
|
177
|
-
title: ( localize(
|
|
176
|
+
openLabel: ( localize(21351, "Trust Folder")),
|
|
177
|
+
title: ( localize(21352, "Select Folder To Trust"))
|
|
178
178
|
});
|
|
179
179
|
if (uri) {
|
|
180
180
|
this.workspaceTrustManagementService.setUrisTrust(uri, true);
|
|
@@ -210,11 +210,11 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
210
210
|
}
|
|
211
211
|
get trustedUriEntries() {
|
|
212
212
|
const currentWorkspace = this.workspaceService.getWorkspace();
|
|
213
|
-
const currentWorkspaceUris =
|
|
213
|
+
const currentWorkspaceUris = currentWorkspace.folders.map(folder => folder.uri);
|
|
214
214
|
if (currentWorkspace.configuration) {
|
|
215
215
|
currentWorkspaceUris.push(currentWorkspace.configuration);
|
|
216
216
|
}
|
|
217
|
-
const entries =
|
|
217
|
+
const entries = this.workspaceTrustManagementService.getTrustedUris().map(uri => {
|
|
218
218
|
let relatedToCurrentWorkspace = false;
|
|
219
219
|
for (const workspaceUri of currentWorkspaceUris) {
|
|
220
220
|
relatedToCurrentWorkspace = relatedToCurrentWorkspace || this.uriService.extUri.isEqualOrParent(workspaceUri, uri);
|
|
@@ -223,7 +223,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
223
223
|
uri,
|
|
224
224
|
parentOfWorkspaceItem: relatedToCurrentWorkspace
|
|
225
225
|
};
|
|
226
|
-
})
|
|
226
|
+
});
|
|
227
227
|
const sortedEntries = entries.sort((a, b) => {
|
|
228
228
|
if (a.uri.scheme !== b.uri.scheme) {
|
|
229
229
|
if (a.uri.scheme === Schemas.file) {
|
|
@@ -257,9 +257,9 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
257
257
|
const entries = this.trustedUriEntries;
|
|
258
258
|
this.container.classList.toggle("empty", entries.length === 0);
|
|
259
259
|
this.descriptionElement.innerText = entries.length ? ( localize(
|
|
260
|
-
|
|
260
|
+
21353,
|
|
261
261
|
"You trust the following folders, their subfolders, and workspace files."
|
|
262
|
-
)) : ( localize(
|
|
262
|
+
)) : ( localize(21354, "You haven't trusted any folders or workspace files yet."));
|
|
263
263
|
this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
|
|
264
264
|
this.layout();
|
|
265
265
|
}
|
|
@@ -273,7 +273,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
273
273
|
return {
|
|
274
274
|
type: MessageType.WARNING,
|
|
275
275
|
content: ( localize(
|
|
276
|
-
|
|
276
|
+
21355,
|
|
277
277
|
"You will trust all repositories on {0}.",
|
|
278
278
|
getHostLabel(this.labelService, item)
|
|
279
279
|
))
|
|
@@ -283,7 +283,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
283
283
|
return {
|
|
284
284
|
type: MessageType.WARNING,
|
|
285
285
|
content: ( localize(
|
|
286
|
-
|
|
286
|
+
21356,
|
|
287
287
|
"You will trust all repositories and forks under '{0}' on {1}.",
|
|
288
288
|
segments[0],
|
|
289
289
|
getHostLabel(this.labelService, item)
|
|
@@ -293,7 +293,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
293
293
|
if (segments.length > 2) {
|
|
294
294
|
return {
|
|
295
295
|
type: MessageType.ERROR,
|
|
296
|
-
content: ( localize(
|
|
296
|
+
content: ( localize(21357, "You cannot trust individual folders within a repository.", path))
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
}
|
|
@@ -334,8 +334,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
334
334
|
canSelectFolders: true,
|
|
335
335
|
canSelectMany: false,
|
|
336
336
|
defaultUri: item.uri,
|
|
337
|
-
openLabel: ( localize(
|
|
338
|
-
title: ( localize(
|
|
337
|
+
openLabel: ( localize(21351, "Trust Folder")),
|
|
338
|
+
title: ( localize(21352, "Select Folder To Trust"))
|
|
339
339
|
});
|
|
340
340
|
if (uri) {
|
|
341
341
|
this.acceptEdit(item, uri[0]);
|
|
@@ -402,7 +402,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
402
402
|
class: ThemeIcon.asClassName(editIcon),
|
|
403
403
|
enabled: true,
|
|
404
404
|
id: "editTrustedUri",
|
|
405
|
-
tooltip: ( localize(
|
|
405
|
+
tooltip: ( localize(21358, "Edit Path")),
|
|
406
406
|
run: () => {
|
|
407
407
|
this.table.edit(item, false);
|
|
408
408
|
}
|
|
@@ -414,7 +414,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
414
414
|
class: ThemeIcon.asClassName(folderPickerIcon),
|
|
415
415
|
enabled: true,
|
|
416
416
|
id: "pickerTrustedUri",
|
|
417
|
-
tooltip: ( localize(
|
|
417
|
+
tooltip: ( localize(21359, "Open File Picker")),
|
|
418
418
|
run: () => {
|
|
419
419
|
this.table.edit(item, true);
|
|
420
420
|
}
|
|
@@ -426,7 +426,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
426
426
|
class: ThemeIcon.asClassName(removeIcon),
|
|
427
427
|
enabled: true,
|
|
428
428
|
id: "deleteTrustedUri",
|
|
429
|
-
tooltip: ( localize(
|
|
429
|
+
tooltip: ( localize(21360, "Delete Path")),
|
|
430
430
|
run: async () => {
|
|
431
431
|
await this.table.delete(item);
|
|
432
432
|
}
|
|
@@ -552,7 +552,7 @@ let TrustedUriPathColumnRenderer = class TrustedUriPathColumnRenderer {
|
|
|
552
552
|
};
|
|
553
553
|
TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( __decorate([( __param(1, IContextViewService))], TrustedUriPathColumnRenderer));
|
|
554
554
|
function getHostLabel(labelService, item) {
|
|
555
|
-
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(
|
|
555
|
+
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(21361, "Local"));
|
|
556
556
|
}
|
|
557
557
|
let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
|
|
558
558
|
static {
|
|
@@ -721,18 +721,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
721
721
|
getHeaderTitleText(trusted) {
|
|
722
722
|
if (trusted) {
|
|
723
723
|
if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
724
|
-
return localize(
|
|
724
|
+
return localize(21362, "This window is trusted");
|
|
725
725
|
}
|
|
726
726
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
727
727
|
case WorkbenchState.EMPTY:
|
|
728
|
-
return localize(
|
|
728
|
+
return localize(21363, "You trust this window");
|
|
729
729
|
case WorkbenchState.FOLDER:
|
|
730
|
-
return localize(
|
|
730
|
+
return localize(21364, "You trust this folder");
|
|
731
731
|
case WorkbenchState.WORKSPACE:
|
|
732
|
-
return localize(
|
|
732
|
+
return localize(21365, "You trust this workspace");
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
return localize(
|
|
735
|
+
return localize(21366, "You are in Restricted Mode");
|
|
736
736
|
}
|
|
737
737
|
getHeaderTitleIconClassNames(trusted) {
|
|
738
738
|
return ThemeIcon.asClassNameArray(shieldIcon);
|
|
@@ -743,36 +743,36 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
743
743
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
744
744
|
case WorkbenchState.EMPTY:
|
|
745
745
|
{
|
|
746
|
-
title = trusted ? ( localize(
|
|
746
|
+
title = trusted ? ( localize(21367, "In a Trusted Window")) : ( localize(21368, "In Restricted Mode"));
|
|
747
747
|
subTitle = trusted ? ( localize(
|
|
748
|
-
|
|
748
|
+
21369,
|
|
749
749
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
750
750
|
)) : ( localize(
|
|
751
|
-
|
|
751
|
+
21370,
|
|
752
752
|
"You do not trust the authors of the files in the current window. The following features are disabled:"
|
|
753
753
|
));
|
|
754
754
|
break;
|
|
755
755
|
}
|
|
756
756
|
case WorkbenchState.FOLDER:
|
|
757
757
|
{
|
|
758
|
-
title = trusted ? ( localize(
|
|
758
|
+
title = trusted ? ( localize(21371, "In a Trusted Folder")) : ( localize(21368, "In Restricted Mode"));
|
|
759
759
|
subTitle = trusted ? ( localize(
|
|
760
|
-
|
|
760
|
+
21372,
|
|
761
761
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
762
762
|
)) : ( localize(
|
|
763
|
-
|
|
763
|
+
21373,
|
|
764
764
|
"You do not trust the authors of the files in the current folder. The following features are disabled:"
|
|
765
765
|
));
|
|
766
766
|
break;
|
|
767
767
|
}
|
|
768
768
|
case WorkbenchState.WORKSPACE:
|
|
769
769
|
{
|
|
770
|
-
title = trusted ? ( localize(
|
|
770
|
+
title = trusted ? ( localize(21374, "In a Trusted Workspace")) : ( localize(21368, "In Restricted Mode"));
|
|
771
771
|
subTitle = trusted ? ( localize(
|
|
772
|
-
|
|
772
|
+
21375,
|
|
773
773
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
774
774
|
)) : ( localize(
|
|
775
|
-
|
|
775
|
+
21376,
|
|
776
776
|
"You do not trust the authors of the files in the current workspace. The following features are disabled:"
|
|
777
777
|
));
|
|
778
778
|
break;
|
|
@@ -798,16 +798,16 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
798
798
|
this.headerDescription.innerText = "";
|
|
799
799
|
const headerDescriptionText = append(this.headerDescription, $("div"));
|
|
800
800
|
headerDescriptionText.innerText = isWorkspaceTrusted ? ( localize(
|
|
801
|
-
|
|
801
|
+
21377,
|
|
802
802
|
"All features are enabled because trust has been granted to the workspace."
|
|
803
803
|
)) : ( localize(
|
|
804
|
-
|
|
804
|
+
21378,
|
|
805
805
|
"{0} is in a restricted mode intended for safe code browsing.",
|
|
806
806
|
this.productService.nameShort
|
|
807
807
|
));
|
|
808
808
|
const headerDescriptionActions = append(this.headerDescription, $("div"));
|
|
809
809
|
const headerDescriptionActionsText = ( localize(
|
|
810
|
-
|
|
810
|
+
21379,
|
|
811
811
|
"[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
|
|
812
812
|
`command:workbench.trust.configure`
|
|
813
813
|
));
|
|
@@ -822,7 +822,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
824
|
this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
|
|
825
|
-
this.rootElement.setAttribute("aria-label", `${( localize(
|
|
825
|
+
this.rootElement.setAttribute("aria-label", `${( localize(21380, "Manage Workspace Trust"))}: ${this.headerContainer.innerText}`);
|
|
826
826
|
const restrictedSettings = this.configurationService.restrictedSettings;
|
|
827
827
|
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
828
828
|
const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
|
|
@@ -854,7 +854,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
854
854
|
getExtensionCount() {
|
|
855
855
|
const set = ( new Set());
|
|
856
856
|
const inVirtualWorkspace = isVirtualWorkspace(this.workspaceService.getWorkspace());
|
|
857
|
-
const localExtensions =
|
|
857
|
+
const localExtensions = this.extensionWorkbenchService.local.filter(ext => ext.local).map(ext => ext.local);
|
|
858
858
|
for (const extension of localExtensions) {
|
|
859
859
|
const enablementState = this.extensionEnablementService.getEnablementState(extension);
|
|
860
860
|
if (enablementState !== EnablementState.EnabledGlobally && enablementState !== EnablementState.EnabledWorkspace && enablementState !== EnablementState.DisabledByTrustRequirement && enablementState !== EnablementState.DisabledByExtensionDependency) {
|
|
@@ -890,7 +890,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
890
890
|
tabIndex: "0"
|
|
891
891
|
}));
|
|
892
892
|
const configurationTitle = append(this.configurationContainer, $(".workspace-trusted-folders-title"));
|
|
893
|
-
configurationTitle.innerText = ( localize(
|
|
893
|
+
configurationTitle.innerText = ( localize(21349, "Trusted Folders & Workspaces"));
|
|
894
894
|
this.workspaceTrustedUrisTable = this._register(
|
|
895
895
|
this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer)
|
|
896
896
|
);
|
|
@@ -915,7 +915,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
915
915
|
clearNode(this.untrustedContainer);
|
|
916
916
|
const [trustedTitle, trustedSubTitle] = this.getFeaturesHeaderText(true);
|
|
917
917
|
this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
|
|
918
|
-
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(
|
|
918
|
+
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(21381, "Tasks are allowed to run")), ( localize(21382, "Debugging is enabled")), ( localize(21383, "All enabled extensions are activated"))] : [( localize(21381, "Tasks are allowed to run")), ( localize(21382, "Debugging is enabled")), ( localize(21384, "All workspace settings are applied")), ( localize(21383, "All enabled extensions are activated"))];
|
|
919
919
|
this.renderLimitationsListElement(
|
|
920
920
|
this.trustedContainer,
|
|
921
921
|
trustedContainerItems,
|
|
@@ -923,18 +923,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
923
923
|
);
|
|
924
924
|
const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
|
|
925
925
|
this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
|
|
926
|
-
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(
|
|
927
|
-
|
|
926
|
+
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(21385, "Tasks are not allowed to run")), ( localize(21386, "Debugging is disabled")), fixBadLocalizedLinks(( localize(
|
|
927
|
+
21387,
|
|
928
928
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
929
929
|
numExtensions,
|
|
930
930
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
931
|
-
)))] : [( localize(
|
|
932
|
-
|
|
931
|
+
)))] : [( localize(21385, "Tasks are not allowed to run")), ( localize(21386, "Debugging is disabled")), fixBadLocalizedLinks(numSettings ? ( localize(
|
|
932
|
+
21388,
|
|
933
933
|
"[{0} workspace settings]({1}) are not applied",
|
|
934
934
|
numSettings,
|
|
935
935
|
"command:settings.filterUntrusted"
|
|
936
|
-
)) : ( localize(
|
|
937
|
-
|
|
936
|
+
)) : ( localize(21389, "Workspace settings requiring trust are not applied"))), fixBadLocalizedLinks(( localize(
|
|
937
|
+
21387,
|
|
938
938
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
939
939
|
numExtensions,
|
|
940
940
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
@@ -968,7 +968,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
968
968
|
button.label = action.label;
|
|
969
969
|
button.enabled = enabled !== undefined ? enabled : action.enabled;
|
|
970
970
|
button.description = keybinding.getLabel();
|
|
971
|
-
button.element.ariaLabel = action.label + ", " + ( localize(
|
|
971
|
+
button.element.ariaLabel = action.label + ", " + ( localize(21390, "Keyboard Shortcut: {0}", keybinding.getAriaLabel()));
|
|
972
972
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
973
973
|
if (e) {
|
|
974
974
|
EventHelper.stop(e, true);
|
|
@@ -978,7 +978,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
addTrustButtonToElement(parent) {
|
|
981
|
-
const trustAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grant", ( localize(
|
|
981
|
+
const trustAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grant", ( localize(21391, "Trust")), undefined, true, async () => {
|
|
982
982
|
await this.workspaceTrustManagementService.setWorkspaceTrust(true);
|
|
983
983
|
})));
|
|
984
984
|
const trustActions = [{
|
|
@@ -989,7 +989,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
989
989
|
}
|
|
990
990
|
addDontTrustButtonToElement(parent) {
|
|
991
991
|
this.createButtonRow(parent, [{
|
|
992
|
-
action: this.rerenderDisposables.add(( new Action("workspace.trust.button.action.deny", ( localize(
|
|
992
|
+
action: this.rerenderDisposables.add(( new Action("workspace.trust.button.action.deny", ( localize(21392, "Don't Trust")), undefined, true, async () => {
|
|
993
993
|
await this.workspaceTrustManagementService.setWorkspaceTrust(false);
|
|
994
994
|
}))),
|
|
995
995
|
keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? "Cmd+Enter" : "Ctrl+Enter")[0]
|
|
@@ -1002,14 +1002,14 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
1002
1002
|
const textElement = append(parent, $(".workspace-trust-untrusted-description"));
|
|
1003
1003
|
if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
1004
1004
|
textElement.innerText = this.workspaceService.getWorkbenchState() === WorkbenchState.WORKSPACE ? ( localize(
|
|
1005
|
-
|
|
1005
|
+
21393,
|
|
1006
1006
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
1007
1007
|
)) : ( localize(
|
|
1008
|
-
|
|
1008
|
+
21394,
|
|
1009
1009
|
"This folder is trusted via the bolded entries in the trusted folders below."
|
|
1010
1010
|
));
|
|
1011
1011
|
} else {
|
|
1012
|
-
textElement.innerText = ( localize(
|
|
1012
|
+
textElement.innerText = ( localize(21395, "This window is trusted by nature of the workspace that is opened."));
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
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(22570, "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(22571, "Workspace Trust");
|
|
33
33
|
}
|
|
34
34
|
getIcon() {
|
|
35
35
|
return WorkspaceTrustEditorIcon;
|