mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 17:23:53 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -86,33 +86,39 @@ function registerProxyConfigurations(scope: ConfigurationScope): void {
|
||||
'http.proxy': {
|
||||
type: 'string',
|
||||
pattern: '^https?://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$',
|
||||
markdownDescription: localize('proxy', "The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables.")
|
||||
markdownDescription: localize('proxy', "The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables."),
|
||||
restricted: true
|
||||
},
|
||||
'http.proxyStrictSSL': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: localize('strictSSL', "Controls whether the proxy server certificate should be verified against the list of supplied CAs.")
|
||||
description: localize('strictSSL', "Controls whether the proxy server certificate should be verified against the list of supplied CAs."),
|
||||
restricted: true
|
||||
},
|
||||
'http.proxyAuthorization': {
|
||||
type: ['null', 'string'],
|
||||
default: null,
|
||||
markdownDescription: localize('proxyAuthorization', "The value to send as the `Proxy-Authorization` header for every network request.")
|
||||
markdownDescription: localize('proxyAuthorization', "The value to send as the `Proxy-Authorization` header for every network request."),
|
||||
restricted: true
|
||||
},
|
||||
'http.proxySupport': {
|
||||
type: 'string',
|
||||
enum: ['off', 'on', 'override'],
|
||||
enum: ['off', 'on', 'fallback', 'override'],
|
||||
enumDescriptions: [
|
||||
localize('proxySupportOff', "Disable proxy support for extensions."),
|
||||
localize('proxySupportOn', "Enable proxy support for extensions."),
|
||||
localize('proxySupportFallback', "Enable proxy support for extensions, fall back to request options, when no proxy found."),
|
||||
localize('proxySupportOverride', "Enable proxy support for extensions, override request options."),
|
||||
],
|
||||
default: 'override',
|
||||
description: localize('proxySupport', "Use the proxy support for extensions.")
|
||||
description: localize('proxySupport', "Use the proxy support for extensions."),
|
||||
restricted: true
|
||||
},
|
||||
'http.systemCertificates': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
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.)")
|
||||
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.)"),
|
||||
restricted: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ function getRawRequest(options: IRequestOptions): IRawRequestFunction {
|
||||
|
||||
export class RequestMainService extends NodeRequestService {
|
||||
|
||||
request(options: IRequestOptions, token: CancellationToken): Promise<IRequestContext> {
|
||||
override request(options: IRequestOptions, token: CancellationToken): Promise<IRequestContext> {
|
||||
return super.request({ ...(options || {}), getRawRequest }, token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ import { isBoolean } from 'vs/base/common/types';
|
||||
|
||||
export type Agent = any;
|
||||
|
||||
function getSystemProxyURI(requestURL: Url): string | null {
|
||||
function getSystemProxyURI(requestURL: Url, env: typeof process.env): string | null {
|
||||
if (requestURL.protocol === 'http:') {
|
||||
return process.env.HTTP_PROXY || process.env.http_proxy || null;
|
||||
return env.HTTP_PROXY || env.http_proxy || null;
|
||||
} else if (requestURL.protocol === 'https:') {
|
||||
return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null;
|
||||
return env.HTTPS_PROXY || env.https_proxy || env.HTTP_PROXY || env.http_proxy || null;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -23,9 +23,9 @@ export interface IOptions {
|
||||
strictSSL?: boolean;
|
||||
}
|
||||
|
||||
export async function getProxyAgent(rawRequestURL: string, options: IOptions = {}): Promise<Agent> {
|
||||
export async function getProxyAgent(rawRequestURL: string, env: typeof process.env, options: IOptions = {}): Promise<Agent> {
|
||||
const requestURL = parseUrl(rawRequestURL);
|
||||
const proxyURL = options.proxyUrl || getSystemProxyURI(requestURL);
|
||||
const proxyURL = options.proxyUrl || getSystemProxyURI(requestURL, env);
|
||||
|
||||
if (!proxyURL) {
|
||||
return null;
|
||||
|
||||
@@ -18,6 +18,8 @@ import { getProxyAgent, Agent } from 'vs/platform/request/node/proxy';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { streamToBufferReadableStream } from 'vs/base/common/buffer';
|
||||
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { resolveShellEnv } from 'vs/platform/environment/node/shellEnv';
|
||||
|
||||
export interface IRawRequestFunction {
|
||||
(options: http.RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
@@ -43,6 +45,7 @@ export class RequestService extends Disposable implements IRequestService {
|
||||
|
||||
constructor(
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@INativeEnvironmentService private readonly environmentService: INativeEnvironmentService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super();
|
||||
@@ -60,7 +63,11 @@ export class RequestService extends Disposable implements IRequestService {
|
||||
this.logService.trace('RequestService#request', options.url);
|
||||
|
||||
const { proxyUrl, strictSSL } = this;
|
||||
const agent = options.agent ? options.agent : await getProxyAgent(options.url || '', { proxyUrl, strictSSL });
|
||||
const env = {
|
||||
...process.env,
|
||||
...(await resolveShellEnv(this.logService, this.environmentService.args, process.env)),
|
||||
};
|
||||
const agent = options.agent ? options.agent : await getProxyAgent(options.url || '', env, { proxyUrl, strictSSL });
|
||||
|
||||
options.agent = agent;
|
||||
options.strictSSL = strictSSL;
|
||||
|
||||
Reference in New Issue
Block a user