Skip to content

Commit

Permalink
fix: prompt auth dialog for basic requests from utility process (#221552
Browse files Browse the repository at this point in the history
)

* fix: prompt auth dialog for basic requests from utility process

* chore: bump distro
  • Loading branch information
deepak1556 authored Jul 13, 2024
1 parent f8a54c7 commit cf08702
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
disturl "https://electronjs.org/headers"
target "30.1.2"
ms_build_id "9759760"
ms_build_id "9870757"
runtime "electron"
build_from_source "true"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.92.0",
"distro": "7616d7872f74568746eefa34266a5ab0a969604b",
"distro": "e697db8a89b3ba772d4260e508cc6211fe1f158c",
"author": {
"name": "Microsoft Corporation"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export class ExtensionHostStarter extends Disposable implements IDisposable, IEx
execArgv: opts.execArgv,
allowLoadingUnsignedLibraries: true,
forceAllocationsToV8Sandbox: true,
respondToAuthRequestsFromMainProcess: true,
correlationId: id
});
const pid = await Event.toPromise(extHost.onSpawn);
Expand Down
14 changes: 13 additions & 1 deletion src/vs/platform/utilityProcess/electron-main/utilityProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export interface IUtilityProcessConfiguration {
* the V8 sandbox.
*/
readonly forceAllocationsToV8Sandbox?: boolean;

/**
* HTTP 401 and 407 requests created via electron:net module
* will be redirected to the main process and can be handled
* via the app#login event.
*/
readonly respondToAuthRequestsFromMainProcess?: boolean;
}

export interface IWindowUtilityProcessConfiguration extends IUtilityProcessConfiguration {
Expand Down Expand Up @@ -235,6 +242,7 @@ export class UtilityProcess extends Disposable {
const execArgv = this.configuration.execArgv ?? [];
const allowLoadingUnsignedLibraries = this.configuration.allowLoadingUnsignedLibraries;
const forceAllocationsToV8Sandbox = this.configuration.forceAllocationsToV8Sandbox;
const respondToAuthRequestsFromMainProcess = this.configuration.respondToAuthRequestsFromMainProcess;
const stdio = 'pipe';
const env = this.createEnv(configuration);

Expand All @@ -247,8 +255,12 @@ export class UtilityProcess extends Disposable {
execArgv,
allowLoadingUnsignedLibraries,
forceAllocationsToV8Sandbox,
respondToAuthRequestsFromMainProcess,
stdio
} as ForkOptions & { forceAllocationsToV8Sandbox?: Boolean });
} as ForkOptions & {
forceAllocationsToV8Sandbox?: Boolean;
respondToAuthRequestsFromMainProcess?: boolean;
});

// Register to events
this.registerListeners(this.process, this.configuration, serviceName);
Expand Down

0 comments on commit cf08702

Please sign in to comment.