提交 664dacc8 编写于 作者: S Sandeep Somavarapu

move connection auth token out of web configuration

上级 25405607
......@@ -108,7 +108,6 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
'vs/css.d.ts',
'vs/css.js',
'vs/loader.js',
'vs/web-configuration-init.js',
'vs/nls.build.js',
'vs/nls.d.ts',
'vs/nls.js',
......
......@@ -14,6 +14,8 @@
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONGIGURATION}}">
<!-- Workaround to pass remote user data uri-->
<meta id="vscode-remote-user-data-uri" data-settings="{{REMOTE_USER_DATA_URI}}">
<!-- Workaround to pass remote connection token-->
<meta id="vscode-remote-connection-token" data-settings="{{CONNECTION_AUTH_TOKEN}}">
</head>
<body class="vs-dark" aria-label="">
......@@ -22,9 +24,6 @@
<!-- Require our AMD loader -->
<script src="./out/vs/loader.js"></script>
<!-- Window Configuration from Server -->
<script src="./out/vs/web-configuration-init.js"></script>
<!-- Startup via workbench.js -->
<script src="./out/vs/code/browser/workbench/workbench.js"></script>
......
......@@ -3,12 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
(function () {
// @ts-ignore
require.config({
baseUrl: `${window.location.origin}/out`,
paths: {
......@@ -20,9 +18,7 @@
}
});
// @ts-ignore
require(['vs/workbench/workbench.web.api'], function (api) {
// @ts-ignore
api.create(document.body, self.WORKBENCH_WEB_CONFIGURATION);
api.create(document.body, JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings')));
});
})();
\ No newline at end of file
......@@ -11,6 +11,6 @@ export class SignService implements ISignService {
_serviceBrand: ServiceIdentifier<ISignService>;
async sign(value: string): Promise<string> {
return Promise.resolve((<any>self).WORKBENCH_WEB_CONFIGURATION.connectionAuthToken);
return Promise.resolve(document.getElementById('vscode-remote-connection-token')!.getAttribute('data-settings')!);
}
}
\ No newline at end of file
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
self.WORKBENCH_WEB_CONFIGURATION = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));
self.REMOTE_USER_DATA_URI = JSON.parse(document.getElementById('vscode-remote-user-data-uri').getAttribute('data-settings'));
......@@ -70,7 +70,7 @@ export class BrowserWorkbenchEnvironmentService implements IEnvironmentService {
this.configuration.remoteAuthority = configuration.remoteAuthority;
this.appSettingsHome = joinPath(URI.revive((<any>self).REMOTE_USER_DATA_URI), 'User');
this.appSettingsHome = joinPath(URI.revive(JSON.parse(document.getElementById('vscode-remote-user-data-uri')!.getAttribute('data-settings')!)), 'User');
this.settingsResource = joinPath(this.appSettingsHome, 'settings.json');
this.keybindingsResource = joinPath(this.appSettingsHome, 'keybindings.json');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册