@codingame/monaco-vscode-workspace-trust-service-override 10.1.3 → 10.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workspace-trust-service-override",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.4",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@10.1.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.1.4"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -87,30 +87,30 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
87
87
|
const markdownDetails = [
|
|
88
88
|
this.workspaceContextService.getWorkbenchState() !== 1 ?
|
|
89
89
|
( localize(
|
|
90
|
-
|
|
90
|
+
3224,
|
|
91
91
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
92
92
|
)) :
|
|
93
93
|
( localize(
|
|
94
|
-
|
|
94
|
+
3225,
|
|
95
95
|
"You are trying to open untrusted files in a window which is trusted."
|
|
96
96
|
)),
|
|
97
97
|
( localize(
|
|
98
|
-
|
|
98
|
+
3226,
|
|
99
99
|
"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."
|
|
100
100
|
))
|
|
101
101
|
];
|
|
102
102
|
await this.dialogService.prompt({
|
|
103
103
|
type: Severity$1.Info,
|
|
104
104
|
message: this.workspaceContextService.getWorkbenchState() !== 1 ?
|
|
105
|
-
( localize(
|
|
106
|
-
( localize(
|
|
105
|
+
( localize(3227, "Do you want to allow untrusted files in this workspace?")) :
|
|
106
|
+
( localize(3228, "Do you want to allow untrusted files in this window?")),
|
|
107
107
|
buttons: [
|
|
108
108
|
{
|
|
109
|
-
label: ( localize(
|
|
109
|
+
label: ( localize(3229, "&&Open")),
|
|
110
110
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(1 , !!checkboxChecked)
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
|
-
label: ( localize(
|
|
113
|
+
label: ( localize(3230, "Open in &&Restricted Mode")),
|
|
114
114
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(2 , !!checkboxChecked)
|
|
115
115
|
}
|
|
116
116
|
],
|
|
@@ -118,7 +118,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
118
118
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(3 )
|
|
119
119
|
},
|
|
120
120
|
checkbox: {
|
|
121
|
-
label: ( localize(
|
|
121
|
+
label: ( localize(3231, "Remember my decision for all workspaces")),
|
|
122
122
|
checked: false
|
|
123
123
|
},
|
|
124
124
|
custom: {
|
|
@@ -130,19 +130,19 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
130
130
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
131
131
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
132
132
|
const message = this.useWorkspaceLanguage ?
|
|
133
|
-
( localize(
|
|
134
|
-
( localize(
|
|
133
|
+
( localize(3232, "Do you trust the authors of the files in this workspace?")) :
|
|
134
|
+
( localize(3233, "Do you trust the authors of the files in this folder?"));
|
|
135
135
|
const defaultDetails = ( localize(
|
|
136
|
-
|
|
136
|
+
3234,
|
|
137
137
|
"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."
|
|
138
138
|
));
|
|
139
139
|
const details = requestOptions?.message ?? defaultDetails;
|
|
140
140
|
const buttons = requestOptions?.buttons ?? [
|
|
141
|
-
{ label: this.useWorkspaceLanguage ? ( localize(
|
|
142
|
-
{ label: ( localize(
|
|
141
|
+
{ label: this.useWorkspaceLanguage ? ( localize(3235, "&&Trust Workspace & Continue")) : ( localize(3236, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
|
|
142
|
+
{ label: ( localize(3237, "&&Manage")), type: 'Manage' }
|
|
143
143
|
];
|
|
144
144
|
if (!( (buttons.some(b => b.type === 'Cancel')))) {
|
|
145
|
-
buttons.push({ label: ( localize(
|
|
145
|
+
buttons.push({ label: ( localize(3238, "Cancel")), type: 'Cancel' });
|
|
146
146
|
}
|
|
147
147
|
const { result } = await this.dialogService.prompt({
|
|
148
148
|
type: Severity$1.Info,
|
|
@@ -152,7 +152,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
152
152
|
markdownDetails: [
|
|
153
153
|
{ markdown: ( (new MarkdownString(details))) },
|
|
154
154
|
{ markdown: ( (new MarkdownString(( localize(
|
|
155
|
-
|
|
155
|
+
3239,
|
|
156
156
|
"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."
|
|
157
157
|
))))) }
|
|
158
158
|
]
|
|
@@ -253,12 +253,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
253
253
|
if (!( (addedFoldersTrustInfo.map(info => info.trusted))).every(trusted => trusted)) {
|
|
254
254
|
const { confirmed } = await this.dialogService.confirm({
|
|
255
255
|
type: Severity$1.Info,
|
|
256
|
-
message: ( localize(
|
|
256
|
+
message: ( localize(3240, "Do you trust the authors of the files in this folder?")),
|
|
257
257
|
detail: ( localize(
|
|
258
|
-
|
|
258
|
+
3241,
|
|
259
259
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
260
260
|
)),
|
|
261
|
-
cancelButton: ( localize(
|
|
261
|
+
cancelButton: ( localize(3242, 'No')),
|
|
262
262
|
custom: { icon: Codicon.shield }
|
|
263
263
|
});
|
|
264
264
|
await this.workspaceTrustManagementService.setUrisTrust(( (addedFoldersTrustInfo.map(i => i.uri))), confirmed);
|
|
@@ -286,30 +286,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
286
286
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
287
287
|
}
|
|
288
288
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
289
|
-
( localize(
|
|
290
|
-
( localize(
|
|
289
|
+
( localize(3232, "Do you trust the authors of the files in this workspace?")) :
|
|
290
|
+
( localize(3233, "Do you trust the authors of the files in this folder?")));
|
|
291
291
|
let checkboxText;
|
|
292
292
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
293
293
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
294
294
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
295
295
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
296
296
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
297
|
-
checkboxText = ( localize(
|
|
297
|
+
checkboxText = ( localize(3243, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
298
298
|
}
|
|
299
|
-
this.doShowModal(title, { label: trustOption ?? ( localize(
|
|
299
|
+
this.doShowModal(title, { label: trustOption ?? ( localize(3244, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(3245, "Trust folder and enable all features")) : ( localize(3246, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localize(3247, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(3248, "Browse folder in restricted mode")) : ( localize(3249, "Browse workspace in restricted mode")) }, [
|
|
300
300
|
!isSingleFolderWorkspace ?
|
|
301
301
|
( localize(
|
|
302
|
-
|
|
302
|
+
3250,
|
|
303
303
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
304
304
|
this.productService.nameShort
|
|
305
305
|
)) :
|
|
306
306
|
( localize(
|
|
307
|
-
|
|
307
|
+
3251,
|
|
308
308
|
"{0} provides features that may automatically execute files in this folder.",
|
|
309
309
|
this.productService.nameShort
|
|
310
310
|
)),
|
|
311
311
|
learnMoreString ?? ( localize(
|
|
312
|
-
|
|
312
|
+
3252,
|
|
313
313
|
"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."
|
|
314
314
|
)),
|
|
315
315
|
!isEmptyWindow ?
|
|
@@ -427,11 +427,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
427
427
|
}
|
|
428
428
|
const actions = [
|
|
429
429
|
{
|
|
430
|
-
label: ( localize(
|
|
430
|
+
label: ( localize(3253, "Manage")),
|
|
431
431
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
432
432
|
},
|
|
433
433
|
{
|
|
434
|
-
label: ( localize(
|
|
434
|
+
label: ( localize(3254, "Learn More")),
|
|
435
435
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
436
436
|
}
|
|
437
437
|
];
|
|
@@ -452,17 +452,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
452
452
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
453
453
|
case 1 :
|
|
454
454
|
return ( localize(
|
|
455
|
-
|
|
455
|
+
3255,
|
|
456
456
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
457
457
|
));
|
|
458
458
|
case 2 :
|
|
459
459
|
return ( localize(
|
|
460
|
-
|
|
460
|
+
3256,
|
|
461
461
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
462
462
|
));
|
|
463
463
|
case 3 :
|
|
464
464
|
return ( localize(
|
|
465
|
-
|
|
465
|
+
3257,
|
|
466
466
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
467
467
|
));
|
|
468
468
|
}
|
|
@@ -471,17 +471,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
471
471
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
472
472
|
case 1 :
|
|
473
473
|
return ( localize(
|
|
474
|
-
|
|
474
|
+
3258,
|
|
475
475
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
476
476
|
));
|
|
477
477
|
case 2 :
|
|
478
478
|
return ( localize(
|
|
479
|
-
|
|
479
|
+
3259,
|
|
480
480
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
481
481
|
));
|
|
482
482
|
case 3 :
|
|
483
483
|
return ( localize(
|
|
484
|
-
|
|
484
|
+
3260,
|
|
485
485
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
486
486
|
));
|
|
487
487
|
}
|
|
@@ -499,12 +499,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
499
499
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
500
500
|
case 1 : {
|
|
501
501
|
ariaLabel = ( localize(
|
|
502
|
-
|
|
502
|
+
3261,
|
|
503
503
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
504
504
|
));
|
|
505
505
|
toolTip = {
|
|
506
506
|
value: ( localize(
|
|
507
|
-
|
|
507
|
+
3262,
|
|
508
508
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
509
509
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
510
510
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -516,12 +516,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
516
516
|
}
|
|
517
517
|
case 2 : {
|
|
518
518
|
ariaLabel = ( localize(
|
|
519
|
-
|
|
519
|
+
3263,
|
|
520
520
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
521
521
|
));
|
|
522
522
|
toolTip = {
|
|
523
523
|
value: ( localize(
|
|
524
|
-
|
|
524
|
+
3264,
|
|
525
525
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
526
526
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
527
527
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -533,12 +533,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
533
533
|
}
|
|
534
534
|
case 3 : {
|
|
535
535
|
ariaLabel = ( localize(
|
|
536
|
-
|
|
536
|
+
3265,
|
|
537
537
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
538
538
|
));
|
|
539
539
|
toolTip = {
|
|
540
540
|
value: ( localize(
|
|
541
|
-
|
|
541
|
+
3266,
|
|
542
542
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
543
543
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
544
544
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -550,8 +550,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
return {
|
|
553
|
-
name: ( localize(
|
|
554
|
-
text: `$(shield) ${( localize(
|
|
553
|
+
name: ( localize(3267, "Workspace Trust")),
|
|
554
|
+
text: `$(shield) ${( localize(3268, "Restricted Mode"))}`,
|
|
555
555
|
ariaLabel: ariaLabel,
|
|
556
556
|
tooltip: toolTip,
|
|
557
557
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -601,16 +601,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
601
601
|
}
|
|
602
602
|
( (Registry.as(EditorExtensions.EditorFactory)))
|
|
603
603
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
604
|
-
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
604
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(3269, "Workspace Trust Editor"))), [
|
|
605
605
|
( (new SyncDescriptor(WorkspaceTrustEditorInput)))
|
|
606
606
|
]);
|
|
607
607
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
608
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
608
|
+
const WORKSPACES_CATEGORY = ( localize2(3270, 'Workspaces'));
|
|
609
609
|
registerAction2(class extends Action2 {
|
|
610
610
|
constructor() {
|
|
611
611
|
super({
|
|
612
612
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
613
|
-
title: ( localize2(
|
|
613
|
+
title: ( localize2(3271, "Configure Workspace Trust Settings")),
|
|
614
614
|
precondition: ( (ContextKeyExpr.and(
|
|
615
615
|
WorkspaceTrustContext.IsEnabled,
|
|
616
616
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -627,7 +627,7 @@ registerAction2(class extends Action2 {
|
|
|
627
627
|
constructor() {
|
|
628
628
|
super({
|
|
629
629
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
630
|
-
title: ( localize2(
|
|
630
|
+
title: ( localize2(3272, "Manage Workspace Trust")),
|
|
631
631
|
precondition: ( (ContextKeyExpr.and(
|
|
632
632
|
WorkspaceTrustContext.IsEnabled,
|
|
633
633
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -651,44 +651,44 @@ registerAction2(class extends Action2 {
|
|
|
651
651
|
[WORKSPACE_TRUST_ENABLED]: {
|
|
652
652
|
type: 'boolean',
|
|
653
653
|
default: true,
|
|
654
|
-
description: ( localize(
|
|
654
|
+
description: ( localize(3273, "Controls whether or not Workspace Trust is enabled within VS Code.")),
|
|
655
655
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
656
656
|
scope: 1 ,
|
|
657
657
|
},
|
|
658
658
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
659
659
|
type: 'string',
|
|
660
660
|
default: 'once',
|
|
661
|
-
description: ( localize(
|
|
661
|
+
description: ( localize(3274, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
662
662
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
663
663
|
scope: 1 ,
|
|
664
664
|
enum: ['always', 'once', 'never'],
|
|
665
665
|
enumDescriptions: [
|
|
666
|
-
( localize(
|
|
667
|
-
( localize(
|
|
668
|
-
( localize(
|
|
666
|
+
( localize(3275, "Ask for trust every time an untrusted workspace is opened.")),
|
|
667
|
+
( localize(3276, "Ask for trust the first time an untrusted workspace is opened.")),
|
|
668
|
+
( localize(3277, "Do not ask for trust when an untrusted workspace is opened.")),
|
|
669
669
|
]
|
|
670
670
|
},
|
|
671
671
|
[WORKSPACE_TRUST_BANNER]: {
|
|
672
672
|
type: 'string',
|
|
673
673
|
default: 'untilDismissed',
|
|
674
|
-
description: ( localize(
|
|
674
|
+
description: ( localize(3278, "Controls when the restricted mode banner is shown.")),
|
|
675
675
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
676
676
|
scope: 1 ,
|
|
677
677
|
enum: ['always', 'untilDismissed', 'never'],
|
|
678
678
|
enumDescriptions: [
|
|
679
|
-
( localize(
|
|
679
|
+
( localize(3279, "Show the banner every time an untrusted workspace is open.")),
|
|
680
680
|
( localize(
|
|
681
|
-
|
|
681
|
+
3280,
|
|
682
682
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
683
683
|
)),
|
|
684
|
-
( localize(
|
|
684
|
+
( localize(3281, "Do not show the banner when an untrusted workspace is open.")),
|
|
685
685
|
]
|
|
686
686
|
},
|
|
687
687
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
688
688
|
type: 'string',
|
|
689
689
|
default: 'prompt',
|
|
690
690
|
markdownDescription: ( localize(
|
|
691
|
-
|
|
691
|
+
3282,
|
|
692
692
|
"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}#`.",
|
|
693
693
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
694
694
|
)),
|
|
@@ -697,15 +697,15 @@ registerAction2(class extends Action2 {
|
|
|
697
697
|
enum: ['prompt', 'open', 'newWindow'],
|
|
698
698
|
enumDescriptions: [
|
|
699
699
|
( localize(
|
|
700
|
-
|
|
700
|
+
3283,
|
|
701
701
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
702
702
|
)),
|
|
703
703
|
( localize(
|
|
704
|
-
|
|
704
|
+
3284,
|
|
705
705
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
706
706
|
)),
|
|
707
707
|
( localize(
|
|
708
|
-
|
|
708
|
+
3285,
|
|
709
709
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
710
710
|
)),
|
|
711
711
|
]
|
|
@@ -714,7 +714,7 @@ registerAction2(class extends Action2 {
|
|
|
714
714
|
type: 'boolean',
|
|
715
715
|
default: true,
|
|
716
716
|
markdownDescription: ( localize(
|
|
717
|
-
|
|
717
|
+
3286,
|
|
718
718
|
"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.",
|
|
719
719
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
720
720
|
)),
|