refactor(desktop): share relay request construction - #7667
Merged
Merged
Conversation
Signed-off-by: coder 0 <d97ebdbb198c7237c94f84ea8bb8a73583ea067407eebd0062abbb3962527fb1@buzz.block.builderlab.xyz>
🔐 Codex Security Review
|
bradseiler
marked this pull request as ready for review
September 16, 2026 04:05
baxen
approved these changes
Sep 16, 2026
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.
Summary
This is a behavior-preserving refactor that gives the desktop relay HTTP bridge one helper for authenticated request construction. It moves the repeated
Authorization, JSON content type, optionalx-auth-tag, body, and timeout setup intobuild_authenticated_relay_request.The helper uses the final URL, auth header, and body bytes passed by the caller. It does not sign, reserialize, normalize, send, parse, classify errors, choose a client, or handle rate limits.
Excluded paths: media, WebSocket, Git, agents, mobile, and NIP-FI. The query send helper only routes through the new request builder so the timeout and
x-auth-tagbehavior are covered by the same seam.Related issue
None found. This prepares for the enterprise identity follow-up to be smaller than #7663.
Testing
cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --checkpassed at356676a2f70f6bdf80cfdcb9084f1f7548359ecb.cargo test --manifest-path desktop/src-tauri/Cargo.toml relay::tests::authenticated -- --nocapturepassed at356676a2f70f6bdf80cfdcb9084f1f7548359ecb.just desktop-tauri-checkpassed at356676a2f70f6bdf80cfdcb9084f1f7548359ecb.just desktop-tauri-testpassed at356676a2f70f6bdf80cfdcb9084f1f7548359ecb.just desktop-tauri-clippypassed at356676a2f70f6bdf80cfdcb9084f1f7548359ecb.Generated with Codex