mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
add flag for proxy (#15120)
* add flag for proxy * update distro hash * Bump distro hash * Bump distro Co-authored-by: kburtram <karlb@microsoft.com> Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "azuredatastudio",
|
||||
"version": "1.28.0",
|
||||
"distro": "0de18a407aaa6294c15918753b6032c7bb919aaf",
|
||||
"distro": "1d8bd1032738ec5b6aad0b80551eee7376a617dc",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface IRemoteAgentEnvironment {
|
||||
workspaceStorageHome: URI;
|
||||
userHome: URI;
|
||||
os: OperatingSystem;
|
||||
useHostProxy: boolean;
|
||||
}
|
||||
|
||||
export interface RemoteAgentConnectionContext {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { localize } from 'vs/nls';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IConfigurationRegistry, Extensions, ConfigurationScope, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||
import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request';
|
||||
@@ -66,12 +66,22 @@ export interface IHTTPConfiguration {
|
||||
};
|
||||
}
|
||||
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration)
|
||||
.registerConfiguration({
|
||||
export function updateProxyConfigurationsScope(scope: ConfigurationScope): void {
|
||||
registerProxyConfigurations(scope);
|
||||
}
|
||||
|
||||
let proxyConfiguration: IConfigurationNode | undefined;
|
||||
function registerProxyConfigurations(scope: ConfigurationScope): void {
|
||||
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
|
||||
if (proxyConfiguration) {
|
||||
configurationRegistry.deregisterConfigurations([proxyConfiguration]);
|
||||
}
|
||||
proxyConfiguration = {
|
||||
id: 'http',
|
||||
order: 15,
|
||||
title: localize('httpConfigurationTitle', "HTTP"),
|
||||
type: 'object',
|
||||
scope,
|
||||
properties: {
|
||||
'http.proxy': {
|
||||
type: 'string',
|
||||
@@ -105,4 +115,8 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration)
|
||||
description: localize('systemCertificates', "Controls whether CA certificates should be loaded from the OS. (On Windows and macOS a reload of the window is required after turning this off.)")
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
configurationRegistry.registerConfiguration(proxyConfiguration);
|
||||
}
|
||||
|
||||
registerProxyConfigurations(ConfigurationScope.MACHINE);
|
||||
|
||||
@@ -40,6 +40,8 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { CATEGORIES } from 'vs/workbench/common/actions';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { ExtensionHostExitCode } from 'vs/workbench/services/extensions/common/extensionHostProtocol';
|
||||
import { updateProxyConfigurationsScope } from 'vs/platform/request/common/request';
|
||||
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
|
||||
export class ExtensionService extends AbstractExtensionService implements IExtensionService {
|
||||
|
||||
@@ -336,6 +338,8 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
||||
await this._startLocalExtensionHost(localExtensions);
|
||||
return;
|
||||
}
|
||||
|
||||
updateProxyConfigurationsScope(remoteEnv.useHostProxy ? ConfigurationScope.APPLICATION : ConfigurationScope.MACHINE);
|
||||
}
|
||||
|
||||
await this._startLocalExtensionHost(localExtensions, remoteAuthority, remoteEnv, remoteExtensions);
|
||||
|
||||
@@ -41,6 +41,7 @@ export interface IRemoteAgentEnvironmentDTO {
|
||||
workspaceStorageHome: UriComponents;
|
||||
userHome: UriComponents;
|
||||
os: platform.OperatingSystem;
|
||||
useHostProxy: boolean;
|
||||
}
|
||||
|
||||
export class RemoteExtensionEnvironmentChannelClient {
|
||||
@@ -63,7 +64,8 @@ export class RemoteExtensionEnvironmentChannelClient {
|
||||
globalStorageHome: URI.revive(data.globalStorageHome),
|
||||
workspaceStorageHome: URI.revive(data.workspaceStorageHome),
|
||||
userHome: URI.revive(data.userHome),
|
||||
os: data.os
|
||||
os: data.os,
|
||||
useHostProxy: data.useHostProxy
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user