Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate support for app#login event to auth requests from utility process #212949

Closed
deepak1556 opened this issue May 17, 2024 · 1 comment · Fixed by #221552
Closed

Investigate support for app#login event to auth requests from utility process #212949

deepak1556 opened this issue May 17, 2024 · 1 comment · Fixed by #221552
Assignees
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@deepak1556
Copy link
Collaborator

deepak1556 commented May 17, 2024

It is of interest to apps to handle the login event with some UI in the main process that are triggered from the net API in the utility process. This is not possible today since the network::URLLoader only takes the observer that is passed in via the TrustedParams if not available then fallbacks to the one provided by URLLoaderFactory.

We can provide an option in the net API of the utility process to listen and respond to the observer events from the main process, this is already done for auth requests from renderer and service workers. StoragePartitionImpl acts as the observer in this case and eventually provides a way for embedder to respond to these requests via content::BrowserClient::CreateLoginDelegate. Electron already hooks into this interceptor and provides the app.#login event. We would need to add new wrapper method CreateAuthCertObserverForUtilityProcess, the primary need for this new wrapper is to avoid devtools interception in StoragePartitionImpl::LoginHandlerDelegate and also to uniquely identify requests from the utility process via the new enum kUtilityProcessContext.

@deepak1556 deepak1556 added feature-request Request for new features or functionality upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron labels May 17, 2024
@deepak1556 deepak1556 added this to the June 2024 milestone May 17, 2024
@deepak1556 deepak1556 self-assigned this May 17, 2024
@deepak1556 deepak1556 changed the title Investigate supporting multiple observers for UtilityProcess SimpleURLLoaderWrapper Investigate support for app#login event to auth requests from utility process May 17, 2024
@deepak1556 deepak1556 modified the milestones: June 2024, July 2024 Jun 24, 2024
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 13, 2024
@deepak1556 deepak1556 added the verification-needed Verification of issue is requested label Jul 23, 2024
@deepak1556
Copy link
Collaborator Author

Steps for verification: It would be good if this was verified on either linux or windows

  • Enable the following setting
"github.copilot.advanced": {
        "debug.useElectronFetcher": true
},
  • Setup mitmproxy https://docs.mitmproxy.org/stable/overview-installation/
  • Set the proxy config using the following setting "http.proxy": "http://<host>:<port>"
  • Open copilot chat and start a prompt
  • You should see an auth dialog
  • Successful credentials should resume the response in the chat editor

Reference #221552 (comment)

@chrmarti chrmarti added the verified Verification succeeded label Jul 23, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders upstream Issue identified as 'upstream' component related (exists outside of VS Code) verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants