@codingame/monaco-vscode-workspace-trust-service-override 11.1.2 → 12.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/index.d.ts +2 -1
- package/index.js +15 -1
- package/package.json +23 -7
- package/vscode/src/vs/workbench/contrib/workspace/browser/media/workspaceTrustEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +201 -198
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.d.ts +70 -0
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +186 -184
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.d.ts +13 -0
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.js +7 -5
- package/workspaceTrust.js +0 -14
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import './media/workspaceTrustEditor.css.js';
|
|
3
4
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
5
|
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
6
|
import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
6
7
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
-
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
8
|
+
import { Extensions as Extensions$1, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
8
9
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
9
10
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
11
|
import 'vscode/vscode/vs/platform/notification/common/notification';
|
|
11
12
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
13
|
+
import { WorkspaceTrustUriResponse } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
12
14
|
import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
13
|
-
import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
15
|
+
import { Extensions, registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
16
|
+
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
14
17
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
15
18
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
19
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
17
20
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
18
21
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
22
|
+
import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
19
23
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
20
|
-
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
24
|
+
import { EditorPaneDescriptor } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/editor';
|
|
21
25
|
import { shieldIcon, WorkspaceTrustEditor } from './workspaceTrustEditor.js';
|
|
22
26
|
import { WorkspaceTrustEditorInput } from '../../../services/workspaces/browser/workspaceTrustEditorInput.js';
|
|
23
|
-
import { WORKSPACE_TRUST_STARTUP_PROMPT, WORKSPACE_TRUST_BANNER, WORKSPACE_TRUST_ENABLED, WORKSPACE_TRUST_UNTRUSTED_FILES, WORKSPACE_TRUST_EMPTY_WINDOW } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceTrust';
|
|
27
|
+
import { WORKSPACE_TRUST_STARTUP_PROMPT, WORKSPACE_TRUST_BANNER, WORKSPACE_TRUST_ENABLED, WORKSPACE_TRUST_UNTRUSTED_FILES, WORKSPACE_TRUST_EMPTY_WINDOW } from '@codingame/monaco-vscode-d7f659f5-da33-5ea8-a3b8-9b94f2cf5f33-common/vscode/vs/workbench/services/workspaces/common/workspaceTrust';
|
|
24
28
|
import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
|
|
25
29
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
26
|
-
import { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, isEmptyWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
30
|
+
import { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, WorkbenchState, isEmptyWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
27
31
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
28
32
|
import { resolve, dirname as dirname$1 } from 'vscode/vscode/vs/base/common/path';
|
|
29
33
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
30
34
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
35
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
31
36
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
32
37
|
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
33
38
|
import { IBannerService } from 'vscode/vscode/vs/workbench/services/banner/browser/bannerService.service';
|
|
34
|
-
import { isVirtualWorkspace } from 'vscode/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
35
|
-
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
39
|
+
import { isVirtualWorkspace } from '@codingame/monaco-vscode-d6e33d82-c101-549d-a885-0807ab3e0cfb-common/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
40
|
+
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from '@codingame/monaco-vscode-22790577-4553-50b6-978d-0acc75c394cc-common/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
36
41
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
37
|
-
import { WORKSPACE_TRUST_SETTING_TAG } from 'vscode/vscode/vs/workbench/contrib/preferences/common/preferences';
|
|
42
|
+
import { WORKSPACE_TRUST_SETTING_TAG } from '@codingame/monaco-vscode-0f5ced28-abde-558b-8652-db8e7d4d64aa-common/vscode/vs/workbench/contrib/preferences/common/preferences';
|
|
38
43
|
import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
44
|
+
import { Verbosity } from '@codingame/monaco-vscode-82e231ca-6ed7-5920-b2b8-1874ccc0be07-common/vscode/vs/platform/label/common/label';
|
|
39
45
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
40
46
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
41
|
-
import { WorkspaceTrustContext, MANAGE_TRUST_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/workspace/common/workspace';
|
|
47
|
+
import { WorkspaceTrustContext, MANAGE_TRUST_COMMAND_ID } from '@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common/vscode/vs/workbench/contrib/workspace/common/workspace';
|
|
42
48
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
43
49
|
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
|
|
44
50
|
import { securityConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
@@ -46,7 +52,7 @@ import { basename, dirname } from 'vscode/vscode/vs/base/common/resources';
|
|
|
46
52
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
47
53
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
48
54
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
49
|
-
import Severity
|
|
55
|
+
import Severity from 'vscode/vscode/vs/base/common/severity';
|
|
50
56
|
|
|
51
57
|
const BANNER_RESTRICTED_MODE = 'workbench.banner.restrictedMode';
|
|
52
58
|
const STARTUP_PROMPT_SHOWN_KEY = 'workspace.trust.startupPrompt.shown';
|
|
@@ -61,12 +67,12 @@ let WorkspaceTrustContextKeys = class WorkspaceTrustContextKeys extends Disposab
|
|
|
61
67
|
this._register(workspaceTrustManagementService.onDidChangeTrust(trusted => this._ctxWorkspaceTrustState.set(trusted)));
|
|
62
68
|
}
|
|
63
69
|
};
|
|
64
|
-
WorkspaceTrustContextKeys = (
|
|
65
|
-
(
|
|
66
|
-
(
|
|
67
|
-
(
|
|
68
|
-
], WorkspaceTrustContextKeys))
|
|
69
|
-
(
|
|
70
|
+
WorkspaceTrustContextKeys = ( __decorate([
|
|
71
|
+
( __param(0, IContextKeyService)),
|
|
72
|
+
( __param(1, IWorkspaceTrustEnablementService)),
|
|
73
|
+
( __param(2, IWorkspaceTrustManagementService))
|
|
74
|
+
], WorkspaceTrustContextKeys));
|
|
75
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustContextKeys, LifecyclePhase.Restored);
|
|
70
76
|
let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Disposable {
|
|
71
77
|
static { this.ID = 'workbench.contrib.workspaceTrustRequestHandler'; }
|
|
72
78
|
constructor(dialogService, commandService, workspaceContextService, workspaceTrustManagementService, workspaceTrustRequestService) {
|
|
@@ -85,84 +91,84 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
85
91
|
this._register(this.workspaceTrustRequestService.onDidInitiateOpenFilesTrustRequest(async () => {
|
|
86
92
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
87
93
|
const markdownDetails = [
|
|
88
|
-
this.workspaceContextService.getWorkbenchState() !==
|
|
94
|
+
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
89
95
|
( localize(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
10995,
|
|
97
|
+
"You are trying to open untrusted files in a workspace which is trusted."
|
|
98
|
+
)) :
|
|
93
99
|
( localize(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
10996,
|
|
101
|
+
"You are trying to open untrusted files in a window which is trusted."
|
|
102
|
+
)),
|
|
97
103
|
( localize(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
10997,
|
|
105
|
+
"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."
|
|
106
|
+
))
|
|
101
107
|
];
|
|
102
108
|
await this.dialogService.prompt({
|
|
103
|
-
type: Severity
|
|
104
|
-
message: this.workspaceContextService.getWorkbenchState() !==
|
|
105
|
-
( localize(
|
|
106
|
-
( localize(
|
|
109
|
+
type: Severity.Info,
|
|
110
|
+
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
111
|
+
( localize(10998, "Do you want to allow untrusted files in this workspace?")) :
|
|
112
|
+
( localize(10999, "Do you want to allow untrusted files in this window?")),
|
|
107
113
|
buttons: [
|
|
108
114
|
{
|
|
109
|
-
label: ( localize(
|
|
110
|
-
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(
|
|
115
|
+
label: ( localize(11000, "&&Open")),
|
|
116
|
+
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
111
117
|
},
|
|
112
118
|
{
|
|
113
|
-
label: ( localize(
|
|
114
|
-
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(
|
|
119
|
+
label: ( localize(11001, "Open in &&Restricted Mode")),
|
|
120
|
+
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.OpenInNewWindow, !!checkboxChecked)
|
|
115
121
|
}
|
|
116
122
|
],
|
|
117
123
|
cancelButton: {
|
|
118
|
-
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(
|
|
124
|
+
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
119
125
|
},
|
|
120
126
|
checkbox: {
|
|
121
|
-
label: ( localize(
|
|
127
|
+
label: ( localize(11002, "Remember my decision for all workspaces")),
|
|
122
128
|
checked: false
|
|
123
129
|
},
|
|
124
130
|
custom: {
|
|
125
131
|
icon: Codicon.shield,
|
|
126
|
-
markdownDetails: (
|
|
132
|
+
markdownDetails: ( markdownDetails.map(md => { return { markdown: ( new MarkdownString(md)) }; }))
|
|
127
133
|
}
|
|
128
134
|
});
|
|
129
135
|
}));
|
|
130
136
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
131
137
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
132
138
|
const message = this.useWorkspaceLanguage ?
|
|
133
|
-
( localize(
|
|
134
|
-
( localize(
|
|
139
|
+
( localize(11003, "Do you trust the authors of the files in this workspace?")) :
|
|
140
|
+
( localize(11004, "Do you trust the authors of the files in this folder?"));
|
|
135
141
|
const defaultDetails = ( localize(
|
|
136
|
-
|
|
142
|
+
11005,
|
|
137
143
|
"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
144
|
));
|
|
139
145
|
const details = requestOptions?.message ?? defaultDetails;
|
|
140
146
|
const buttons = requestOptions?.buttons ?? [
|
|
141
|
-
{ label: this.useWorkspaceLanguage ? ( localize(
|
|
142
|
-
{ label: ( localize(
|
|
147
|
+
{ label: this.useWorkspaceLanguage ? ( localize(11006, "&&Trust Workspace & Continue")) : ( localize(11007, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
|
|
148
|
+
{ label: ( localize(11008, "&&Manage")), type: 'Manage' }
|
|
143
149
|
];
|
|
144
|
-
if (!(
|
|
145
|
-
buttons.push({ label: ( localize(
|
|
150
|
+
if (!( buttons.some(b => b.type === 'Cancel'))) {
|
|
151
|
+
buttons.push({ label: ( localize(11009, "Cancel")), type: 'Cancel' });
|
|
146
152
|
}
|
|
147
153
|
const { result } = await this.dialogService.prompt({
|
|
148
|
-
type: Severity
|
|
154
|
+
type: Severity.Info,
|
|
149
155
|
message,
|
|
150
156
|
custom: {
|
|
151
157
|
icon: Codicon.shield,
|
|
152
158
|
markdownDetails: [
|
|
153
|
-
{ markdown: (
|
|
154
|
-
{ markdown: (
|
|
155
|
-
|
|
159
|
+
{ markdown: ( new MarkdownString(details)) },
|
|
160
|
+
{ markdown: ( new MarkdownString(( localize(
|
|
161
|
+
11010,
|
|
156
162
|
"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
|
-
))))
|
|
163
|
+
)))) }
|
|
158
164
|
]
|
|
159
165
|
},
|
|
160
|
-
buttons: (
|
|
166
|
+
buttons: ( buttons.filter(b => b.type !== 'Cancel').map(button => {
|
|
161
167
|
return {
|
|
162
168
|
label: button.label,
|
|
163
169
|
run: () => button.type
|
|
164
170
|
};
|
|
165
|
-
}))
|
|
171
|
+
})),
|
|
166
172
|
cancelButton: (() => {
|
|
167
173
|
const cancelButton = buttons.find(b => b.type === 'Cancel');
|
|
168
174
|
if (!cancelButton) {
|
|
@@ -192,13 +198,13 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
192
198
|
}));
|
|
193
199
|
}
|
|
194
200
|
};
|
|
195
|
-
WorkspaceTrustRequestHandler = (
|
|
196
|
-
(
|
|
197
|
-
(
|
|
198
|
-
(
|
|
199
|
-
(
|
|
200
|
-
(
|
|
201
|
-
], WorkspaceTrustRequestHandler))
|
|
201
|
+
WorkspaceTrustRequestHandler = ( __decorate([
|
|
202
|
+
( __param(0, IDialogService)),
|
|
203
|
+
( __param(1, ICommandService)),
|
|
204
|
+
( __param(2, IWorkspaceContextService)),
|
|
205
|
+
( __param(3, IWorkspaceTrustManagementService)),
|
|
206
|
+
( __param(4, IWorkspaceTrustRequestService))
|
|
207
|
+
], WorkspaceTrustRequestHandler));
|
|
202
208
|
let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
203
209
|
constructor(dialogService, workspaceContextService, workspaceTrustEnablementService, workspaceTrustManagementService, configurationService, statusbarService, storageService, workspaceTrustRequestService, bannerService, labelService, hostService, productService, remoteAgentService, environmentService, fileService) {
|
|
204
210
|
super();
|
|
@@ -218,7 +224,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
218
224
|
this.environmentService = environmentService;
|
|
219
225
|
this.fileService = fileService;
|
|
220
226
|
this.entryId = `status.workspaceTrust`;
|
|
221
|
-
this.statusbarEntryAccessor = this._register((
|
|
227
|
+
this.statusbarEntryAccessor = this._register(( new MutableDisposable()));
|
|
222
228
|
(async () => {
|
|
223
229
|
await this.workspaceTrustManagementService.workspaceTrustInitialized;
|
|
224
230
|
if (this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()) {
|
|
@@ -249,19 +255,19 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
249
255
|
const addWorkspaceFolder = async (e) => {
|
|
250
256
|
const trusted = this.workspaceTrustManagementService.isWorkspaceTrusted();
|
|
251
257
|
if (trusted && (e.changes.added.length || e.changes.changed.length)) {
|
|
252
|
-
const addedFoldersTrustInfo = await Promise.all((
|
|
253
|
-
if (!(
|
|
258
|
+
const addedFoldersTrustInfo = await Promise.all(( e.changes.added.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder.uri))));
|
|
259
|
+
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
254
260
|
const { confirmed } = await this.dialogService.confirm({
|
|
255
|
-
type: Severity
|
|
256
|
-
message: ( localize(
|
|
261
|
+
type: Severity.Info,
|
|
262
|
+
message: ( localize(11011, "Do you trust the authors of the files in this folder?")),
|
|
257
263
|
detail: ( localize(
|
|
258
|
-
|
|
264
|
+
11012,
|
|
259
265
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
260
266
|
)),
|
|
261
|
-
cancelButton: ( localize(
|
|
267
|
+
cancelButton: ( localize(11013, 'No')),
|
|
262
268
|
custom: { icon: Codicon.shield }
|
|
263
269
|
});
|
|
264
|
-
await this.workspaceTrustManagementService.setUrisTrust((
|
|
270
|
+
await this.workspaceTrustManagementService.setUrisTrust(( addedFoldersTrustInfo.map(i => i.uri)), confirmed);
|
|
265
271
|
}
|
|
266
272
|
}
|
|
267
273
|
};
|
|
@@ -286,34 +292,34 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
286
292
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
287
293
|
}
|
|
288
294
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
289
|
-
( localize(
|
|
290
|
-
( localize(
|
|
295
|
+
( localize(11003, "Do you trust the authors of the files in this workspace?")) :
|
|
296
|
+
( localize(11004, "Do you trust the authors of the files in this folder?")));
|
|
291
297
|
let checkboxText;
|
|
292
298
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
293
299
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
294
300
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
295
301
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
296
302
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
297
|
-
checkboxText = ( localize(
|
|
303
|
+
checkboxText = ( localize(11014, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
298
304
|
}
|
|
299
|
-
this.doShowModal(title, { label: trustOption ?? ( localize(
|
|
305
|
+
this.doShowModal(title, { label: trustOption ?? ( localize(11015, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(11016, "Trust folder and enable all features")) : ( localize(11017, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localize(11018, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(11019, "Browse folder in restricted mode")) : ( localize(11020, "Browse workspace in restricted mode")) }, [
|
|
300
306
|
!isSingleFolderWorkspace ?
|
|
301
307
|
( localize(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
308
|
+
11021,
|
|
309
|
+
"{0} provides features that may automatically execute files in this workspace.",
|
|
310
|
+
this.productService.nameShort
|
|
311
|
+
)) :
|
|
306
312
|
( localize(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
313
|
+
11022,
|
|
314
|
+
"{0} provides features that may automatically execute files in this folder.",
|
|
315
|
+
this.productService.nameShort
|
|
316
|
+
)),
|
|
311
317
|
learnMoreString ?? ( localize(
|
|
312
|
-
|
|
318
|
+
11023,
|
|
313
319
|
"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
320
|
)),
|
|
315
321
|
!isEmptyWindow ?
|
|
316
|
-
`\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, { verbose:
|
|
322
|
+
`\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, { verbose: Verbosity.LONG })}\`` : '',
|
|
317
323
|
], checkboxText);
|
|
318
324
|
}));
|
|
319
325
|
}
|
|
@@ -331,7 +337,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
331
337
|
}
|
|
332
338
|
async doShowModal(question, trustedOption, untrustedOption, markdownStrings, trustParentString) {
|
|
333
339
|
await this.dialogService.prompt({
|
|
334
|
-
type: Severity
|
|
340
|
+
type: Severity.Info,
|
|
335
341
|
message: question,
|
|
336
342
|
checkbox: trustParentString ? {
|
|
337
343
|
label: trustParentString
|
|
@@ -363,10 +369,10 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
363
369
|
],
|
|
364
370
|
disableCloseAction: true,
|
|
365
371
|
icon: Codicon.shield,
|
|
366
|
-
markdownDetails: (
|
|
372
|
+
markdownDetails: ( markdownStrings.map(md => { return { markdown: ( new MarkdownString(md)) }; }))
|
|
367
373
|
}
|
|
368
374
|
});
|
|
369
|
-
this.storageService.store(STARTUP_PROMPT_SHOWN_KEY, true,
|
|
375
|
+
this.storageService.store(STARTUP_PROMPT_SHOWN_KEY, true, StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
370
376
|
}
|
|
371
377
|
async showModalOnStart() {
|
|
372
378
|
if (this.workspaceTrustManagementService.isWorkspaceTrusted()) {
|
|
@@ -380,7 +386,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
380
386
|
this.updateWorkbenchIndicators(false);
|
|
381
387
|
return;
|
|
382
388
|
}
|
|
383
|
-
if (this.workspaceContextService.getWorkbenchState() ===
|
|
389
|
+
if (this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY) {
|
|
384
390
|
this.updateWorkbenchIndicators(false);
|
|
385
391
|
return;
|
|
386
392
|
}
|
|
@@ -388,7 +394,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
388
394
|
this.updateWorkbenchIndicators(false);
|
|
389
395
|
return;
|
|
390
396
|
}
|
|
391
|
-
if (this.startupPromptSetting === 'once' && this.storageService.getBoolean(STARTUP_PROMPT_SHOWN_KEY,
|
|
397
|
+
if (this.startupPromptSetting === 'once' && this.storageService.getBoolean(STARTUP_PROMPT_SHOWN_KEY, StorageScope.WORKSPACE, false)) {
|
|
392
398
|
this.updateWorkbenchIndicators(false);
|
|
393
399
|
return;
|
|
394
400
|
}
|
|
@@ -406,8 +412,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
406
412
|
if (result) {
|
|
407
413
|
try {
|
|
408
414
|
const content = await this.fileService.readFile(aiGeneratedWorkspaces);
|
|
409
|
-
const workspaces = JSON.parse((
|
|
410
|
-
if (workspaces.indexOf((
|
|
415
|
+
const workspaces = JSON.parse(( content.value.toString()));
|
|
416
|
+
if (workspaces.indexOf(( this.workspaceContextService.getWorkspace().folders[0].uri.toString())) > -1) {
|
|
411
417
|
return true;
|
|
412
418
|
}
|
|
413
419
|
}
|
|
@@ -418,7 +424,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
418
424
|
});
|
|
419
425
|
}
|
|
420
426
|
getBannerItem(restrictedMode) {
|
|
421
|
-
const dismissedRestricted = this.storageService.getBoolean(BANNER_RESTRICTED_MODE_DISMISSED_KEY,
|
|
427
|
+
const dismissedRestricted = this.storageService.getBoolean(BANNER_RESTRICTED_MODE_DISMISSED_KEY, StorageScope.WORKSPACE, false);
|
|
422
428
|
if (this.bannerSetting === 'never') {
|
|
423
429
|
return undefined;
|
|
424
430
|
}
|
|
@@ -427,11 +433,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
427
433
|
}
|
|
428
434
|
const actions = [
|
|
429
435
|
{
|
|
430
|
-
label: ( localize(
|
|
436
|
+
label: ( localize(11024, "Manage")),
|
|
431
437
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
432
438
|
},
|
|
433
439
|
{
|
|
434
|
-
label: ( localize(
|
|
440
|
+
label: ( localize(11025, "Learn More")),
|
|
435
441
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
436
442
|
}
|
|
437
443
|
];
|
|
@@ -443,47 +449,47 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
443
449
|
actions,
|
|
444
450
|
onClose: () => {
|
|
445
451
|
if (restrictedMode) {
|
|
446
|
-
this.storageService.store(BANNER_RESTRICTED_MODE_DISMISSED_KEY, true,
|
|
452
|
+
this.storageService.store(BANNER_RESTRICTED_MODE_DISMISSED_KEY, true, StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
447
453
|
}
|
|
448
454
|
}
|
|
449
455
|
};
|
|
450
456
|
}
|
|
451
457
|
getBannerItemAriaLabels() {
|
|
452
458
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
453
|
-
case
|
|
454
|
-
return
|
|
455
|
-
|
|
459
|
+
case WorkbenchState.EMPTY:
|
|
460
|
+
return localize(
|
|
461
|
+
11026,
|
|
456
462
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
457
|
-
)
|
|
458
|
-
case
|
|
459
|
-
return
|
|
460
|
-
|
|
463
|
+
);
|
|
464
|
+
case WorkbenchState.FOLDER:
|
|
465
|
+
return localize(
|
|
466
|
+
11027,
|
|
461
467
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
462
|
-
)
|
|
463
|
-
case
|
|
464
|
-
return
|
|
465
|
-
|
|
468
|
+
);
|
|
469
|
+
case WorkbenchState.WORKSPACE:
|
|
470
|
+
return localize(
|
|
471
|
+
11028,
|
|
466
472
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
467
|
-
)
|
|
473
|
+
);
|
|
468
474
|
}
|
|
469
475
|
}
|
|
470
476
|
getBannerItemMessages() {
|
|
471
477
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
472
|
-
case
|
|
473
|
-
return
|
|
474
|
-
|
|
478
|
+
case WorkbenchState.EMPTY:
|
|
479
|
+
return localize(
|
|
480
|
+
11029,
|
|
475
481
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
476
|
-
)
|
|
477
|
-
case
|
|
478
|
-
return
|
|
479
|
-
|
|
482
|
+
);
|
|
483
|
+
case WorkbenchState.FOLDER:
|
|
484
|
+
return localize(
|
|
485
|
+
11030,
|
|
480
486
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
481
|
-
)
|
|
482
|
-
case
|
|
483
|
-
return
|
|
484
|
-
|
|
487
|
+
);
|
|
488
|
+
case WorkbenchState.WORKSPACE:
|
|
489
|
+
return localize(
|
|
490
|
+
11031,
|
|
485
491
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
486
|
-
)
|
|
492
|
+
);
|
|
487
493
|
}
|
|
488
494
|
}
|
|
489
495
|
get bannerSetting() {
|
|
@@ -497,14 +503,14 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
497
503
|
let ariaLabel = '';
|
|
498
504
|
let toolTip;
|
|
499
505
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
500
|
-
case
|
|
506
|
+
case WorkbenchState.EMPTY: {
|
|
501
507
|
ariaLabel = ( localize(
|
|
502
|
-
|
|
508
|
+
11032,
|
|
503
509
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
504
510
|
));
|
|
505
511
|
toolTip = {
|
|
506
512
|
value: ( localize(
|
|
507
|
-
|
|
513
|
+
11033,
|
|
508
514
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
509
515
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
510
516
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -514,14 +520,14 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
514
520
|
};
|
|
515
521
|
break;
|
|
516
522
|
}
|
|
517
|
-
case
|
|
523
|
+
case WorkbenchState.FOLDER: {
|
|
518
524
|
ariaLabel = ( localize(
|
|
519
|
-
|
|
525
|
+
11034,
|
|
520
526
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
521
527
|
));
|
|
522
528
|
toolTip = {
|
|
523
529
|
value: ( localize(
|
|
524
|
-
|
|
530
|
+
11035,
|
|
525
531
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
526
532
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
527
533
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -531,14 +537,14 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
531
537
|
};
|
|
532
538
|
break;
|
|
533
539
|
}
|
|
534
|
-
case
|
|
540
|
+
case WorkbenchState.WORKSPACE: {
|
|
535
541
|
ariaLabel = ( localize(
|
|
536
|
-
|
|
542
|
+
11036,
|
|
537
543
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
538
544
|
));
|
|
539
545
|
toolTip = {
|
|
540
546
|
value: ( localize(
|
|
541
|
-
|
|
547
|
+
11037,
|
|
542
548
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
543
549
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
544
550
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -550,8 +556,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
550
556
|
}
|
|
551
557
|
}
|
|
552
558
|
return {
|
|
553
|
-
name: ( localize(
|
|
554
|
-
text: `$(shield) ${( localize(
|
|
559
|
+
name: ( localize(11038, "Workspace Trust")),
|
|
560
|
+
text: `$(shield) ${( localize(11039, "Restricted Mode"))}`,
|
|
555
561
|
ariaLabel: ariaLabel,
|
|
556
562
|
tooltip: toolTip,
|
|
557
563
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -565,29 +571,29 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
565
571
|
}
|
|
566
572
|
if (!trusted && !this.statusbarEntryAccessor.value) {
|
|
567
573
|
const entry = this.getRestrictedModeStatusbarEntry();
|
|
568
|
-
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId,
|
|
574
|
+
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, StatusbarAlignment.LEFT, 0.99 * Number.MAX_VALUE );
|
|
569
575
|
}
|
|
570
576
|
}
|
|
571
577
|
};
|
|
572
|
-
WorkspaceTrustUXHandler = (
|
|
573
|
-
(
|
|
574
|
-
(
|
|
575
|
-
(
|
|
576
|
-
(
|
|
577
|
-
(
|
|
578
|
-
(
|
|
579
|
-
(
|
|
580
|
-
(
|
|
581
|
-
(
|
|
582
|
-
(
|
|
583
|
-
(
|
|
584
|
-
(
|
|
585
|
-
(
|
|
586
|
-
(
|
|
587
|
-
(
|
|
588
|
-
], WorkspaceTrustUXHandler))
|
|
589
|
-
registerWorkbenchContribution2(WorkspaceTrustRequestHandler.ID, WorkspaceTrustRequestHandler,
|
|
590
|
-
(
|
|
578
|
+
WorkspaceTrustUXHandler = ( __decorate([
|
|
579
|
+
( __param(0, IDialogService)),
|
|
580
|
+
( __param(1, IWorkspaceContextService)),
|
|
581
|
+
( __param(2, IWorkspaceTrustEnablementService)),
|
|
582
|
+
( __param(3, IWorkspaceTrustManagementService)),
|
|
583
|
+
( __param(4, IConfigurationService)),
|
|
584
|
+
( __param(5, IStatusbarService)),
|
|
585
|
+
( __param(6, IStorageService)),
|
|
586
|
+
( __param(7, IWorkspaceTrustRequestService)),
|
|
587
|
+
( __param(8, IBannerService)),
|
|
588
|
+
( __param(9, ILabelService)),
|
|
589
|
+
( __param(10, IHostService)),
|
|
590
|
+
( __param(11, IProductService)),
|
|
591
|
+
( __param(12, IRemoteAgentService)),
|
|
592
|
+
( __param(13, IEnvironmentService)),
|
|
593
|
+
( __param(14, IFileService))
|
|
594
|
+
], WorkspaceTrustUXHandler));
|
|
595
|
+
registerWorkbenchContribution2(WorkspaceTrustRequestHandler.ID, WorkspaceTrustRequestHandler, WorkbenchPhase.BlockRestore);
|
|
596
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustUXHandler, LifecyclePhase.Restored);
|
|
591
597
|
class WorkspaceTrustEditorInputSerializer {
|
|
592
598
|
canSerialize(editorInput) {
|
|
593
599
|
return true;
|
|
@@ -599,22 +605,19 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
599
605
|
return instantiationService.createInstance(WorkspaceTrustEditorInput);
|
|
600
606
|
}
|
|
601
607
|
}
|
|
602
|
-
(
|
|
608
|
+
( Registry.as(EditorExtensions.EditorFactory))
|
|
603
609
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
604
|
-
(
|
|
605
|
-
(
|
|
610
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(11040, "Workspace Trust Editor"))), [
|
|
611
|
+
( new SyncDescriptor(WorkspaceTrustEditorInput))
|
|
606
612
|
]);
|
|
607
613
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
608
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
614
|
+
const WORKSPACES_CATEGORY = ( localize2(11041, 'Workspaces'));
|
|
609
615
|
registerAction2(class extends Action2 {
|
|
610
616
|
constructor() {
|
|
611
617
|
super({
|
|
612
618
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
613
|
-
title: ( localize2(
|
|
614
|
-
precondition: (
|
|
615
|
-
WorkspaceTrustContext.IsEnabled,
|
|
616
|
-
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
617
|
-
))),
|
|
619
|
+
title: ( localize2(11042, "Configure Workspace Trust Settings")),
|
|
620
|
+
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
618
621
|
category: WORKSPACES_CATEGORY,
|
|
619
622
|
f1: true
|
|
620
623
|
});
|
|
@@ -627,11 +630,8 @@ registerAction2(class extends Action2 {
|
|
|
627
630
|
constructor() {
|
|
628
631
|
super({
|
|
629
632
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
630
|
-
title: ( localize2(
|
|
631
|
-
precondition: (
|
|
632
|
-
WorkspaceTrustContext.IsEnabled,
|
|
633
|
-
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
634
|
-
))),
|
|
633
|
+
title: ( localize2(11043, "Manage Workspace Trust")),
|
|
634
|
+
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
635
635
|
category: WORKSPACES_CATEGORY,
|
|
636
636
|
f1: true,
|
|
637
637
|
});
|
|
@@ -644,82 +644,85 @@ registerAction2(class extends Action2 {
|
|
|
644
644
|
return;
|
|
645
645
|
}
|
|
646
646
|
});
|
|
647
|
-
(
|
|
647
|
+
( Registry.as(Extensions$1.Configuration))
|
|
648
648
|
.registerConfiguration({
|
|
649
649
|
...securityConfigurationNodeBase,
|
|
650
650
|
properties: {
|
|
651
651
|
[WORKSPACE_TRUST_ENABLED]: {
|
|
652
652
|
type: 'boolean',
|
|
653
653
|
default: true,
|
|
654
|
-
description: ( localize(
|
|
654
|
+
description: ( localize(
|
|
655
|
+
11044,
|
|
656
|
+
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
657
|
+
)),
|
|
655
658
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
656
|
-
scope:
|
|
659
|
+
scope: ConfigurationScope.APPLICATION,
|
|
657
660
|
},
|
|
658
661
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
659
662
|
type: 'string',
|
|
660
663
|
default: 'once',
|
|
661
|
-
description: ( localize(
|
|
664
|
+
description: ( localize(11045, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
662
665
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
663
|
-
scope:
|
|
666
|
+
scope: ConfigurationScope.APPLICATION,
|
|
664
667
|
enum: ['always', 'once', 'never'],
|
|
665
668
|
enumDescriptions: [
|
|
666
|
-
( localize(
|
|
667
|
-
( localize(
|
|
668
|
-
( localize(
|
|
669
|
+
( localize(11046, "Ask for trust every time an untrusted workspace is opened.")),
|
|
670
|
+
( localize(11047, "Ask for trust the first time an untrusted workspace is opened.")),
|
|
671
|
+
( localize(11048, "Do not ask for trust when an untrusted workspace is opened.")),
|
|
669
672
|
]
|
|
670
673
|
},
|
|
671
674
|
[WORKSPACE_TRUST_BANNER]: {
|
|
672
675
|
type: 'string',
|
|
673
676
|
default: 'untilDismissed',
|
|
674
|
-
description: ( localize(
|
|
677
|
+
description: ( localize(11049, "Controls when the restricted mode banner is shown.")),
|
|
675
678
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
676
|
-
scope:
|
|
679
|
+
scope: ConfigurationScope.APPLICATION,
|
|
677
680
|
enum: ['always', 'untilDismissed', 'never'],
|
|
678
681
|
enumDescriptions: [
|
|
679
|
-
( localize(
|
|
682
|
+
( localize(11050, "Show the banner every time an untrusted workspace is open.")),
|
|
680
683
|
( localize(
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
( localize(
|
|
684
|
+
11051,
|
|
685
|
+
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
686
|
+
)),
|
|
687
|
+
( localize(11052, "Do not show the banner when an untrusted workspace is open.")),
|
|
685
688
|
]
|
|
686
689
|
},
|
|
687
690
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
688
691
|
type: 'string',
|
|
689
692
|
default: 'prompt',
|
|
690
693
|
markdownDescription: ( localize(
|
|
691
|
-
|
|
694
|
+
11053,
|
|
692
695
|
"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
696
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
694
697
|
)),
|
|
695
698
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
696
|
-
scope:
|
|
699
|
+
scope: ConfigurationScope.APPLICATION,
|
|
697
700
|
enum: ['prompt', 'open', 'newWindow'],
|
|
698
701
|
enumDescriptions: [
|
|
699
702
|
( localize(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
+
11054,
|
|
704
|
+
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
705
|
+
)),
|
|
703
706
|
( localize(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
+
11055,
|
|
708
|
+
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
709
|
+
)),
|
|
707
710
|
( localize(
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
+
11056,
|
|
712
|
+
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
713
|
+
)),
|
|
711
714
|
]
|
|
712
715
|
},
|
|
713
716
|
[WORKSPACE_TRUST_EMPTY_WINDOW]: {
|
|
714
717
|
type: 'boolean',
|
|
715
718
|
default: true,
|
|
716
719
|
markdownDescription: ( localize(
|
|
717
|
-
|
|
720
|
+
11057,
|
|
718
721
|
"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
722
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
720
723
|
)),
|
|
721
724
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
722
|
-
scope:
|
|
725
|
+
scope: ConfigurationScope.APPLICATION
|
|
723
726
|
}
|
|
724
727
|
}
|
|
725
728
|
});
|
|
@@ -781,14 +784,14 @@ let WorkspaceTrustTelemetryContribution = class WorkspaceTrustTelemetryContribut
|
|
|
781
784
|
}
|
|
782
785
|
}
|
|
783
786
|
};
|
|
784
|
-
WorkspaceTrustTelemetryContribution = (
|
|
785
|
-
(
|
|
786
|
-
(
|
|
787
|
-
(
|
|
788
|
-
(
|
|
789
|
-
(
|
|
790
|
-
], WorkspaceTrustTelemetryContribution))
|
|
791
|
-
(
|
|
792
|
-
.registerWorkbenchContribution(WorkspaceTrustTelemetryContribution,
|
|
787
|
+
WorkspaceTrustTelemetryContribution = ( __decorate([
|
|
788
|
+
( __param(0, IWorkbenchEnvironmentService)),
|
|
789
|
+
( __param(1, ITelemetryService)),
|
|
790
|
+
( __param(2, IWorkspaceContextService)),
|
|
791
|
+
( __param(3, IWorkspaceTrustEnablementService)),
|
|
792
|
+
( __param(4, IWorkspaceTrustManagementService))
|
|
793
|
+
], WorkspaceTrustTelemetryContribution));
|
|
794
|
+
( Registry.as(Extensions.Workbench))
|
|
795
|
+
.registerWorkbenchContribution(WorkspaceTrustTelemetryContribution, LifecyclePhase.Restored);
|
|
793
796
|
|
|
794
797
|
export { WorkspaceTrustContextKeys, WorkspaceTrustRequestHandler, WorkspaceTrustUXHandler };
|