mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #23790] [CLOSED] fix(terminals): mirror HTTP auth modes in websocket terminal proxy #66225
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23790
Author: @shaun0927
Created: 4/16/2026
Status: ❌ Closed
Base:
dev← Head:fix-terminal-ws-auth📝 Commits (2)
cf81ae8Keep terminal websocket auth aligned with the HTTP proxyaf20f85Keep websocket session auth tied to the validated login token📊 Changes
3 files changed (+174 additions, -41 deletions)
View changed files
📝
backend/open_webui/routers/terminals.py(+22 -41)➕
backend/open_webui/test/util/test_terminals.py(+102 -0)➕
backend/open_webui/utils/terminals.py(+50 -0)📄 Description
Terminal connections already advertise multiple auth modes, and
proxy_terminalforwards bearer, session, and system_oauth credentials.ws_terminalonly sent an upstream auth frame for bearer, so session-backed and OAuth-backed terminal connections had no equivalent upstream auth material on the websocket path.This extracts the terminal auth assembly into a shared helper and reuses it for both the HTTP proxy and the websocket handshake. The websocket keeps the existing bearer auth frame and now sends the same handshake headers/cookies used by the HTTP proxy for the other auth modes.
Related: #23788
Testing
python3 -m py_compile backend/open_webui/routers/terminals.py backend/open_webui/utils/terminals.pyPYTHONPATH=backend PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -q backend/open_webui/test/util/test_terminals.pybearerbut nothing forsessionorsystem_oauthChangelog Entry
Description
Added
Fixed
Additional Information
#22581(ws://vswss://under HTTPS).#23603) on terminal websocket auth; this keeps the scope narrow and fixes the currentmainmismatch betweenproxy_terminalandws_terminal.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.