-
Notifications
You must be signed in to change notification settings - Fork 0
[CLEAN] Synthetic Benchmark PR #48512 - feat: support WebSocket authentication handling #35
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
base: base_pr_48512_20251204_5941
Are you sure you want to change the base?
[CLEAN] Synthetic Benchmark PR #48512 - feat: support WebSocket authentication handling #35
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
User description
Benchmark PR electron#48512
Type: Clean (correct implementation)
Original PR Title: feat: support WebSocket authentication handling
Original PR Description: #### Description of Change
Refs electron#48505.
This PR adds handling for the 'login' event to allow authentication via web sockets.
Checklist
npm testpassesRelease Notes
Notes: Added support for WebSocket authentication through the
loginevent onwebContents.Original PR URL: electron#48512
PR Type
Enhancement
Description
Add WebSocket authentication handling via login event
Implement OnAuthRequired method in WebRequest for async auth
Move AuthRequiredResponse enum from ProxyingWebSocket to WebRequest
Add LoginHandler constructor overload for WebSocket auth flow
Add comprehensive test for WebSocket authentication
Diagram Walkthrough
File Walkthrough
electron_api_web_request.h
Add auth handling interface and typesshell/browser/api/electron_api_web_request.h
AuthRequiredResponseenum with four states for auth handlingAuthCallbacktype alias for async auth completionOnAuthRequiredmethod to handle authentication challengesOnLoginAuthResultmethod to bridge LoginHandler callbacksMatchesRequestto accept const WebRequestInfo pointerelectron_api_web_request.cc
Implement WebSocket auth handling logicshell/browser/api/electron_api_web_request.cc
,utf_string_conversions, andlogin_handler.hOnAuthRequiredmethod to create LoginHandler and storeblocked request
OnLoginAuthResultcallback to process auth credentialsauth_callbackandlogin_handlerfields toBlockedRequeststructlogin_handler.h
Add WebSocket-specific LoginHandler constructorshell/browser/login_handler.h
auth
flows
login_handler.cc
Implement WebSocket LoginHandler constructorshell/browser/login_handler.cc
proxying_websocket.h
Remove duplicate AuthRequiredResponse enumshell/browser/net/proxying_websocket.h
AuthRequiredResponseenum definition (moved to WebRequest)OnAuthRequiredCompletesignature to useapi::WebRequest::AuthRequiredResponseproxying_websocket.cc
Integrate WebRequest auth handling in WebSocketshell/browser/net/proxying_websocket.cc
OnAuthRequiredCompleteto useapi::WebRequest::AuthRequiredResponseOnHeadersReceivedCompleteForAuthto callOnAuthRequiredAUTH_REQUIRED_RESPONSE_IO_PENDINGto pause processingapi-web-request-spec.ts
Add WebSocket authentication test casespec/api-web-request-spec.ts
callback