Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
77de8fab
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
77de8fab
编写于
6月 10, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ISignService
上级
81d7885d
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
120 addition
and
44 deletion
+120
-44
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+7
-4
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+3
-0
src/vs/platform/remote/common/remoteAgentConnection.ts
src/vs/platform/remote/common/remoteAgentConnection.ts
+6
-17
src/vs/platform/sign/browser/signService.ts
src/vs/platform/sign/browser/signService.ts
+14
-0
src/vs/platform/sign/common/sign.ts
src/vs/platform/sign/common/sign.ts
+15
-0
src/vs/platform/sign/node/signService.ts
src/vs/platform/sign/node/signService.ts
+24
-0
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+7
-1
src/vs/workbench/contrib/debug/electron-browser/debugSession.ts
.../workbench/contrib/debug/electron-browser/debugSession.ts
+4
-2
src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts
...rkbench/contrib/debug/electron-browser/rawDebugSession.ts
+7
-7
src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts
...ch/contrib/debug/test/electron-browser/debugModel.test.ts
+2
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+7
-1
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+2
-1
src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts
...h/services/extensions/common/remoteExtensionHostClient.ts
+5
-2
src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts
...rkbench/services/remote/browser/remoteAgentServiceImpl.ts
+4
-2
src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts
...ench/services/remote/common/abstractRemoteAgentService.ts
+5
-2
src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts
...ervices/remote/electron-browser/remoteAgentServiceImpl.ts
+4
-2
src/vs/workbench/services/remote/node/tunnelService.ts
src/vs/workbench/services/remote/node/tunnelService.ts
+4
-1
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
77de8fab
...
...
@@ -80,6 +80,7 @@ import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAg
import
{
nodeWebSocketFactory
}
from
'
vs/platform/remote/node/nodeWebSocketFactory
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
statSync
}
from
'
fs
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
CodeApplication
extends
Disposable
{
...
...
@@ -95,7 +96,8 @@ export class CodeApplication extends Disposable {
@
IEnvironmentService
private
readonly
environmentService
:
IEnvironmentService
,
@
ILifecycleService
private
readonly
lifecycleService
:
ILifecycleService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IStateService
private
readonly
stateService
:
IStateService
@
IStateService
private
readonly
stateService
:
IStateService
,
@
ISignService
private
readonly
signService
:
ISignService
)
{
super
();
...
...
@@ -646,7 +648,7 @@ export class CodeApplication extends Disposable {
private
readonly
_connection
:
Promise
<
ManagementPersistentConnection
>
;
private
readonly
_disposeRunner
:
RunOnceScheduler
;
constructor
(
authority
:
string
,
host
:
string
,
port
:
number
)
{
constructor
(
authority
:
string
,
host
:
string
,
port
:
number
,
signService
:
ISignService
)
{
this
.
_authority
=
authority
;
const
options
:
IConnectionOptions
=
{
...
...
@@ -657,7 +659,8 @@ export class CodeApplication extends Disposable {
getAddress
:
()
=>
{
return
Promise
.
resolve
({
host
,
port
});
}
}
},
signService
:
signService
};
this
.
_connection
=
connectRemoteAgentManagement
(
options
,
authority
,
`main`
);
...
...
@@ -726,7 +729,7 @@ export class CodeApplication extends Disposable {
return
;
}
activeConnection
=
new
ActiveConnection
(
uri
.
authority
,
resolvedAuthority
.
host
,
resolvedAuthority
.
port
);
activeConnection
=
new
ActiveConnection
(
uri
.
authority
,
resolvedAuthority
.
host
,
resolvedAuthority
.
port
,
this
.
signService
);
connectionPool
.
set
(
uri
.
authority
,
activeConnection
);
}
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
77de8fab
...
...
@@ -40,6 +40,8 @@ import { setUnexpectedErrorHandler } from 'vs/base/common/errors';
import
{
IThemeMainService
,
ThemeMainService
}
from
'
vs/platform/theme/electron-main/themeMainService
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/common/ipc.net
'
;
import
{
once
}
from
'
vs/base/common/functional
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
import
{
SignService
}
from
'
vs/platform/sign/node/signService
'
;
class
ExpectedError
extends
Error
{
readonly
isExpected
=
true
;
...
...
@@ -147,6 +149,7 @@ class CodeMain {
services
.
set
(
IRequestService
,
new
SyncDescriptor
(
RequestService
));
services
.
set
(
IDiagnosticsService
,
new
SyncDescriptor
(
DiagnosticsService
));
services
.
set
(
IThemeMainService
,
new
SyncDescriptor
(
ThemeMainService
));
services
.
set
(
ISignService
,
new
SyncDescriptor
(
SignService
));
return
[
new
InstantiationService
(
services
,
true
),
instanceEnvironment
];
}
...
...
src/vs/platform/remote/common/remoteAgentConnection.ts
浏览文件 @
77de8fab
...
...
@@ -8,10 +8,10 @@ import { generateUuid } from 'vs/base/common/uuid';
import
{
RemoteAgentConnectionContext
}
from
'
vs/platform/remote/common/remoteAgentEnvironment
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
RemoteAuthorityResolverError
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
const
enum
ConnectionType
{
Management
=
1
,
...
...
@@ -58,6 +58,7 @@ interface ISimpleConnectionOptions {
reconnectionToken
:
string
;
reconnectionProtocol
:
PersistentProtocol
|
null
;
webSocketFactory
:
IWebSocketFactory
;
signService
:
ISignService
;
}
export
interface
IConnectCallback
{
...
...
@@ -92,7 +93,7 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio
return
new
Promise
<
PersistentProtocol
>
((
c
,
e
)
=>
{
const
messageRegistration
=
protocol
.
onControlMessage
(
raw
=>
{
const
messageRegistration
=
protocol
.
onControlMessage
(
async
raw
=>
{
const
msg
=
<
HandshakeMessage
>
JSON
.
parse
(
raw
.
toString
());
// Stop listening for further events
messageRegistration
.
dispose
();
...
...
@@ -104,21 +105,7 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio
if
(
msg
.
type
===
'
sign
'
)
{
let
signed
=
msg
.
data
;
if
(
platform
.
isNative
)
{
try
{
const
vsda
=
<
any
>
require
.
__$__nodeRequire
(
'
vsda
'
);
const
signer
=
new
vsda
.
signer
();
if
(
signer
)
{
signed
=
signer
.
sign
(
msg
.
data
);
}
}
catch
(
e
)
{
console
.
error
(
'
signer.sign:
'
+
e
);
}
}
else
{
signed
=
(
<
any
>
self
).
CONNECTION_AUTH_TOKEN
;
}
const
signed
=
await
options
.
signService
.
sign
(
msg
.
data
);
const
connTypeRequest
:
ConnectionTypeRequest
=
{
type
:
'
connectionType
'
,
commit
:
options
.
commit
,
...
...
@@ -216,6 +203,7 @@ export interface IConnectionOptions {
commit
:
string
|
undefined
;
webSocketFactory
:
IWebSocketFactory
;
addressProvider
:
IAddressProvider
;
signService
:
ISignService
;
}
async
function
resolveConnectionOptions
(
options
:
IConnectionOptions
,
reconnectionToken
:
string
,
reconnectionProtocol
:
PersistentProtocol
|
null
):
Promise
<
ISimpleConnectionOptions
>
{
...
...
@@ -228,6 +216,7 @@ async function resolveConnectionOptions(options: IConnectionOptions, reconnectio
reconnectionToken
:
reconnectionToken
,
reconnectionProtocol
:
reconnectionProtocol
,
webSocketFactory
:
options
.
webSocketFactory
,
signService
:
options
.
signService
};
}
...
...
src/vs/platform/sign/browser/signService.ts
0 → 100644
浏览文件 @
77de8fab
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
SignService
implements
ISignService
{
_serviceBrand
:
any
;
async
sign
(
value
:
string
):
Promise
<
string
>
{
return
Promise
.
resolve
((
<
any
>
self
).
CONNECTION_AUTH_TOKEN
);
}
}
\ No newline at end of file
src/vs/platform/sign/common/sign.ts
0 → 100644
浏览文件 @
77de8fab
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
const
SIGN_SERVICE_ID
=
'
signService
'
;
export
const
ISignService
=
createDecorator
<
ISignService
>
(
SIGN_SERVICE_ID
);
export
interface
ISignService
{
_serviceBrand
:
any
;
sign
(
value
:
string
):
Promise
<
string
>
;
}
src/vs/platform/sign/node/signService.ts
0 → 100644
浏览文件 @
77de8fab
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
SignService
implements
ISignService
{
_serviceBrand
:
any
;
async
sign
(
value
:
string
):
Promise
<
string
>
{
try
{
const
vsda
=
await
import
(
'
vsda
'
);
const
signer
=
new
vsda
.
signer
();
if
(
signer
)
{
return
signer
.
sign
(
value
);
}
}
catch
(
e
)
{
console
.
error
(
'
signer.sign:
'
+
e
);
}
return
value
;
}
}
\ No newline at end of file
src/vs/workbench/browser/web.main.ts
浏览文件 @
77de8fab
...
...
@@ -30,6 +30,8 @@ import { WorkspaceService } from 'vs/workbench/services/configuration/browser/co
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/browser/configurationCache
'
;
import
{
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
WebResources
}
from
'
vs/workbench/browser/web.resources
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
import
{
SignService
}
from
'
vs/platform/sign/browser/signService
'
;
interface
IWindowConfiguration
{
settingsUri
:
URI
;
...
...
@@ -96,7 +98,11 @@ class CodeRendererMain extends Disposable {
const
remoteAuthorityResolverService
=
new
RemoteAuthorityResolverService
();
serviceCollection
.
set
(
IRemoteAuthorityResolverService
,
remoteAuthorityResolverService
);
const
remoteAgentService
=
this
.
_register
(
new
RemoteAgentService
(
environmentService
,
productService
,
remoteAuthorityResolverService
));
// Sign
const
signService
=
new
SignService
();
serviceCollection
.
set
(
ISignService
,
signService
);
const
remoteAgentService
=
this
.
_register
(
new
RemoteAgentService
(
environmentService
,
productService
,
remoteAuthorityResolverService
,
signService
));
serviceCollection
.
set
(
IRemoteAgentService
,
remoteAgentService
);
// Files
...
...
src/vs/workbench/contrib/debug/electron-browser/debugSession.ts
浏览文件 @
77de8fab
...
...
@@ -32,6 +32,7 @@ import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
DebugSession
implements
IDebugSession
{
...
...
@@ -66,7 +67,8 @@ export class DebugSession implements IDebugSession {
@
IViewletService
private
readonly
viewletService
:
IViewletService
,
@
IWorkspaceContextService
private
readonly
workspaceContextService
:
IWorkspaceContextService
,
@
IEnvironmentService
private
readonly
environmentService
:
IEnvironmentService
,
@
INotificationService
private
readonly
notificationService
:
INotificationService
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
ISignService
private
readonly
signService
:
ISignService
)
{
this
.
id
=
generateUuid
();
this
.
repl
=
new
ReplModel
(
this
);
...
...
@@ -167,7 +169,7 @@ export class DebugSession implements IDebugSession {
return
dbgr
.
createDebugAdapter
(
this
).
then
(
debugAdapter
=>
{
this
.
raw
=
new
RawDebugSession
(
debugAdapter
,
dbgr
,
this
.
telemetryService
,
customTelemetryService
,
this
.
environmentService
);
this
.
raw
=
new
RawDebugSession
(
debugAdapter
,
dbgr
,
this
.
telemetryService
,
customTelemetryService
,
this
.
environmentService
,
this
.
signService
);
return
this
.
raw
!
.
start
().
then
(()
=>
{
...
...
src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts
浏览文件 @
77de8fab
...
...
@@ -14,6 +14,7 @@ import { IDebugAdapter, IConfig, AdapterEndEvent, IDebugger } from 'vs/workbench
import
{
createErrorWithActions
}
from
'
vs/base/common/errorsWithActions
'
;
import
*
as
cp
from
'
child_process
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
/**
* This interface represents a single command line argument split into a "prefix" and a "path" half.
...
...
@@ -69,9 +70,10 @@ export class RawDebugSession {
constructor
(
debugAdapter
:
IDebugAdapter
,
dbgr
:
IDebugger
,
private
telemetryService
:
ITelemetryService
,
public
customTelemetryService
:
ITelemetryService
|
undefined
,
private
environmentService
:
IEnvironmentService
private
readonly
telemetryService
:
ITelemetryService
,
public
readonly
customTelemetryService
:
ITelemetryService
|
undefined
,
private
readonly
environmentService
:
IEnvironmentService
,
private
readonly
signService
:
ISignService
)
{
this
.
debugAdapter
=
debugAdapter
;
this
.
_capabilities
=
Object
.
create
(
null
);
...
...
@@ -528,11 +530,9 @@ export class RawDebugSession {
break
;
case
'
handshake
'
:
try
{
const
vsda
=
await
import
(
'
vsda
'
);
const
obj
=
new
vsda
.
signer
();
const
sig
=
obj
.
sign
(
request
.
arguments
.
value
);
const
signature
=
await
this
.
signService
.
sign
(
request
.
arguments
.
value
);
response
.
body
=
{
signature
:
sig
signature
:
sig
nature
};
safeSendResponse
(
response
);
}
catch
(
e
)
{
...
...
src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts
浏览文件 @
77de8fab
...
...
@@ -15,7 +15,7 @@ import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
import
{
IBreakpointUpdateData
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
function
createMockSession
(
model
:
DebugModel
,
name
=
'
mockSession
'
,
parentSession
?:
DebugSession
|
undefined
):
DebugSession
{
return
new
DebugSession
({
resolved
:
{
name
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
parentSession
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
return
new
DebugSession
({
resolved
:
{
name
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
parentSession
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
}
suite
(
'
Debug - Model
'
,
()
=>
{
...
...
@@ -437,7 +437,7 @@ suite('Debug - Model', () => {
// Repl output
test
(
'
repl output
'
,
()
=>
{
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
undefined
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
undefined
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
const
repl
=
new
ReplModel
(
session
);
repl
.
appendToRepl
(
'
first line
\n
'
,
severity
.
Error
);
repl
.
appendToRepl
(
'
second line
'
,
severity
.
Error
);
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
77de8fab
...
...
@@ -49,6 +49,8 @@ import { DefaultConfigurationExportHelper } from 'vs/workbench/services/configur
import
{
ConfigurationCache
}
from
'
vs/workbench/services/configuration/node/configurationCache
'
;
import
{
ConfigurationFileService
}
from
'
vs/workbench/services/configuration/node/configurationFileService
'
;
import
{
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
SignService
}
from
'
vs/platform/sign/node/signService
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
class
CodeRendererMain
extends
Disposable
{
...
...
@@ -183,7 +185,11 @@ class CodeRendererMain extends Disposable {
const
remoteAuthorityResolverService
=
new
RemoteAuthorityResolverService
();
serviceCollection
.
set
(
IRemoteAuthorityResolverService
,
remoteAuthorityResolverService
);
const
remoteAgentService
=
this
.
_register
(
new
RemoteAgentService
(
this
.
configuration
,
environmentService
,
remoteAuthorityResolverService
));
// Sign
const
signService
=
new
SignService
();
serviceCollection
.
set
(
ISignService
,
signService
);
const
remoteAgentService
=
this
.
_register
(
new
RemoteAgentService
(
this
.
configuration
,
environmentService
,
remoteAuthorityResolverService
,
signService
));
serviceCollection
.
set
(
IRemoteAgentService
,
remoteAgentService
);
// Files
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
77de8fab
...
...
@@ -45,6 +45,7 @@ import { ConfigurationFileService } from 'vs/workbench/services/configuration/no
import
{
IRemoteAgentEnvironment
}
from
'
vs/platform/remote/common/remoteAgentEnvironment
'
;
import
{
IConfigurationCache
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
SignService
}
from
'
vs/platform/sign/browser/signService
'
;
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
...
...
@@ -103,7 +104,7 @@ suite('WorkspaceContextService - Folder', () => {
workspaceResource
=
folderDir
;
const
globalSettingsFile
=
path
.
join
(
parentDir
,
'
settings.json
'
);
const
environmentService
=
new
SettingsTestEnvironmentService
(
parseArgs
(
process
.
argv
),
process
.
execPath
,
globalSettingsFile
);
workspaceContextService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
()));
workspaceContextService
=
new
WorkspaceService
({
userSettingsResource
:
environmentService
.
settingsResource
,
configurationCache
:
new
ConfigurationCache
(
environmentService
)
},
new
ConfigurationFileService
(),
new
RemoteAgentService
(
<
IWindowConfiguration
>
{},
environmentService
,
new
RemoteAuthorityResolverService
()
,
new
SignService
()
));
return
(
<
WorkspaceService
>
workspaceContextService
).
initialize
(
convertToWorkspacePayload
(
URI
.
file
(
folderDir
)));
});
});
...
...
src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts
浏览文件 @
77de8fab
...
...
@@ -26,6 +26,7 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
IExtensionHostDebugService
}
from
'
vs/workbench/services/extensions/common/extensionHostDebug
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/product
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
interface
IInitDataProvider
{
readonly
remoteAuthority
:
string
;
...
...
@@ -55,7 +56,8 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH
@
ILabelService
private
readonly
_labelService
:
ILabelService
,
@
IRemoteAuthorityResolverService
private
readonly
remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
,
@
IExtensionHostDebugService
private
readonly
_extensionHostDebugService
:
IExtensionHostDebugService
,
@
IProductService
private
readonly
_productService
:
IProductService
@
IProductService
private
readonly
_productService
:
IProductService
,
@
ISignService
private
readonly
_signService
:
ISignService
)
{
super
();
this
.
_protocol
=
null
;
...
...
@@ -77,7 +79,8 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH
const
{
host
,
port
}
=
await
this
.
remoteAuthorityResolverService
.
resolveAuthority
(
this
.
_initDataProvider
.
remoteAuthority
);
return
{
host
,
port
};
}
}
},
signService
:
this
.
_signService
};
return
this
.
remoteAuthorityResolverService
.
resolveAuthority
(
this
.
_initDataProvider
.
remoteAuthority
).
then
((
resolvedAuthority
)
=>
{
...
...
src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts
浏览文件 @
77de8fab
...
...
@@ -9,6 +9,7 @@ import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remot
import
{
AbstractRemoteAgentService
,
RemoteAgentConnection
}
from
'
vs/workbench/services/remote/common/abstractRemoteAgentService
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/product
'
;
import
{
browserWebSocketFactory
}
from
'
vs/platform/remote/browser/browserWebSocketFactory
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
RemoteAgentService
extends
AbstractRemoteAgentService
{
...
...
@@ -17,11 +18,12 @@ export class RemoteAgentService extends AbstractRemoteAgentService {
constructor
(
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IProductService
productService
:
IProductService
,
@
IRemoteAuthorityResolverService
remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
@
IRemoteAuthorityResolverService
remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
,
@
ISignService
signService
:
ISignService
)
{
super
(
environmentService
);
const
authority
=
document
.
location
.
host
;
this
.
_connection
=
this
.
_register
(
new
RemoteAgentConnection
(
authority
,
productService
.
commit
,
browserWebSocketFactory
,
environmentService
,
remoteAuthorityResolverService
));
this
.
_connection
=
this
.
_register
(
new
RemoteAgentConnection
(
authority
,
productService
.
commit
,
browserWebSocketFactory
,
environmentService
,
remoteAuthorityResolverService
,
signService
));
}
getConnection
():
IRemoteAgentConnection
|
null
{
...
...
src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts
浏览文件 @
77de8fab
...
...
@@ -19,6 +19,7 @@ import { RemoteExtensionEnvironmentChannelClient } from 'vs/workbench/services/r
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IDiagnosticInfoOptions
,
IDiagnosticInfo
}
from
'
vs/platform/diagnostics/common/diagnosticsService
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
abstract
class
AbstractRemoteAgentService
extends
Disposable
implements
IRemoteAgentService
{
...
...
@@ -84,7 +85,8 @@ export class RemoteAgentConnection extends Disposable implements IRemoteAgentCon
private
readonly
_commit
:
string
|
undefined
,
private
readonly
_webSocketFactory
:
IWebSocketFactory
,
private
readonly
_environmentService
:
IEnvironmentService
,
private
readonly
_remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
private
readonly
_remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
,
private
readonly
_signService
:
ISignService
)
{
super
();
this
.
remoteAuthority
=
remoteAuthority
;
...
...
@@ -122,7 +124,8 @@ export class RemoteAgentConnection extends Disposable implements IRemoteAgentCon
const
{
host
,
port
}
=
await
this
.
_remoteAuthorityResolverService
.
resolveAuthority
(
this
.
remoteAuthority
);
return
{
host
,
port
};
}
}
},
signService
:
this
.
_signService
};
const
connection
=
this
.
_register
(
await
connectRemoteAgentManagement
(
options
,
this
.
remoteAuthority
,
`renderer`
));
this
.
_register
(
connection
.
onDidStateChange
(
e
=>
this
.
_onDidStateChange
.
fire
(
e
)));
...
...
src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts
浏览文件 @
77de8fab
...
...
@@ -10,6 +10,7 @@ import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remot
import
product
from
'
vs/platform/product/node/product
'
;
import
{
nodeWebSocketFactory
}
from
'
vs/platform/remote/node/nodeWebSocketFactory
'
;
import
{
AbstractRemoteAgentService
,
RemoteAgentConnection
}
from
'
vs/workbench/services/remote/common/abstractRemoteAgentService
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
RemoteAgentService
extends
AbstractRemoteAgentService
{
...
...
@@ -17,11 +18,12 @@ export class RemoteAgentService extends AbstractRemoteAgentService {
constructor
({
remoteAuthority
}:
IWindowConfiguration
,
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IRemoteAuthorityResolverService
remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
@
IRemoteAuthorityResolverService
remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
,
@
ISignService
signService
:
ISignService
)
{
super
(
environmentService
);
if
(
remoteAuthority
)
{
this
.
_connection
=
this
.
_register
(
new
RemoteAgentConnection
(
remoteAuthority
,
product
.
commit
,
nodeWebSocketFactory
,
environmentService
,
remoteAuthorityResolverService
));
this
.
_connection
=
this
.
_register
(
new
RemoteAgentConnection
(
remoteAuthority
,
product
.
commit
,
nodeWebSocketFactory
,
environmentService
,
remoteAuthorityResolverService
,
signService
));
}
}
...
...
src/vs/workbench/services/remote/node/tunnelService.ts
浏览文件 @
77de8fab
...
...
@@ -13,6 +13,7 @@ import { connectRemoteAgentTunnel, IConnectionOptions } from 'vs/platform/remote
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
ITunnelService
,
RemoteTunnel
}
from
'
vs/platform/remote/common/tunnel
'
;
import
{
nodeWebSocketFactory
}
from
'
vs/platform/remote/node/nodeWebSocketFactory
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
async
function
createRemoteTunnel
(
options
:
IConnectionOptions
,
tunnelRemotePort
:
number
):
Promise
<
RemoteTunnel
>
{
const
tunnel
=
new
NodeRemoteTunnel
(
options
,
tunnelRemotePort
);
...
...
@@ -88,6 +89,7 @@ export class TunnelService implements ITunnelService {
public
constructor
(
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IRemoteAuthorityResolverService
private
readonly
remoteAuthorityResolverService
:
IRemoteAuthorityResolverService
,
@
ISignService
private
readonly
signService
:
ISignService
)
{
}
...
...
@@ -106,7 +108,8 @@ export class TunnelService implements ITunnelService {
const
{
host
,
port
}
=
await
this
.
remoteAuthorityResolverService
.
resolveAuthority
(
remoteAuthority
);
return
{
host
,
port
};
}
}
},
signService
:
this
.
signService
};
return
createRemoteTunnel
(
options
,
remotePort
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录