fix(channels): validate Buzz relay host - #4689
Draft
RerankerGuo wants to merge 1 commit into
Draft
Conversation
Reject ws and wss relay URLs without a hostname during channel construction so invalid configuration cannot create an empty workspace identity and an endless reconnect loop. Signed-off-by: RerankerGuo <121015044+RerankerGuo@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
BuzzChannelpreviously validatedrelay_urlwith a string-prefix check.Values such as
ws://,wss://, andws:///missing-hostpassed constructioneven though they have no hostname.
That leaves
workspace_idempty and letsstart()launch a relay task that canonly fail and reconnect forever. Invalid configuration should fail immediately
with the same actionable validation error used for non-WebSocket URLs.
What changed
wsorwssscheme and a non-empty hostname.Valid relay paths, query strings, ports, and existing workspace identities are
unchanged.
Surface area
frontend/backend/appdocker/or sandboxed executionskills/Screenshots / Recording
Not applicable.
Bug fix verification
main: HTTPS was rejected, but all three hostless WebSocket formswere accepted (
1 passed, 3 failed).142 passed).Validation
cd backend && PYTHONPATH=. uv run --extra buzz pytest tests/test_buzz_channel.py tests/test_buzz_nostr.py -q- 142 passedcd backend && make testwith the Buzz extra installed -11205 passed, 72 skipped
git diff --checkpassedDuplicate check
Searched open issues and PRs for Buzz relay URL, WebSocket host, and invalid URL
validation; no active report or implementation was found.
AI assistance
Tool(s) used: TRAE
How you used it: Audited the newly merged Buzz connector, wrote the
parameterized failing configuration test first, implemented the minimal
constructor validation, and ran focused plus full validation. I reviewed the
final diff and can explain each changed line.