[PR #5107] [MERGED] Preserve vanilla LAN authentication fallback #6080

Closed
opened 2026-11-03 06:11:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5107
Author: @oskal675-design
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/lan-login-authentication


📝 Commits (1)

  • db171db Preserve LAN authentication fallback during server login

📊 Changes

12 files changed (+398 additions, -61 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+5 -3)
📝 crates/horizon-client/src/game/extras.rs (+3 -3)
📝 crates/horizon-client/src/game/remote.rs (+30 -11)
📝 crates/horizon-client/src/game/startup_menu.rs (+6 -3)
📝 crates/horizon-client/src/lan/discovery.rs (+9 -0)
📝 crates/horizon-client/src/multiplayer.rs (+67 -14)
📝 crates/horizon-client/src/net.rs (+142 -14)
📝 crates/horizon-client/src/reconnect.rs (+26 -11)
📝 crates/horizon-client/src/title.rs (+7 -2)
📝 crates/horizon-client/src/title/tests.rs (+1 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaLanAuthOracle.java (+60 -0)
➕ tools/test_lan_auth_parity.py (+42 -0)

📄 Description

🤖 Opened by oskal675-design's AI agent (Codex, GPT-6.1), not by oskal675-design personally.

What and why

Fixes #4995. Selecting a discovered LAN game currently loses its ServerData.Type.LAN equivalent before login. Horizon then stops on a missing or invalid session, although vanilla logs that authentication failure and continues encryption for LAN entries, letting the host decide whether to admit the player.

Carry the selected entry's LAN kind through title actions, deferred resource loading and reconnects. Continue after failed session authentication only for that kind. Direct Connection, saved servers (including the same local IP), command-line joins and transfer destinations retain ordinary-server authentication behavior.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players
  • extra: Horizon-only, off by default
  • tooling
  • docs

Vanilla reference

Pinned 26.3 ClientHandshakePacketListenerImpl.handleHello and its authentication task (lambda$handleHello$0): a non-null authentication error disconnects unless serverData.isLan(), in which case it is logged before setEncryption. ServerData.Type.LAN comes from the selected LAN list entry, not an IP-address heuristic.

tools/test_lan_auth_parity.py invokes the real vanilla listener with a rejecting session service and records encryption/denial for LAN and OTHER entries. The Rust side exercises the network thread against a peer that validates its RSA reply and sends an AES-encrypted message.

Other projects' code

none.

Self-check

pr_ready (tools/pr_ready.py --quick on omarchy, against origin/main at c3905131b, 3 min 10 s)

Check Result
Scope ✅ 12 files, +399 −61
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed (22 s)
rustfmt ✅ (5 s)
clippy ✅ (21 s)
tests: horizon-client ✅ 1343 passed (2 min 15 s)
doc tests ✅ 0 passed (4 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 313 affected, to run in CI (--quick): block_removal, block_survival, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair, chorus_plant and 301 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Additional validation:

  • python3 tools/parity.py lan_auth online_mode: both pass, including the existing 43 online-mode checks.
  • Real multiplayer-screen path in isolated network namespaces: the original client refuses the discovered LAN entry before encryption; the fixed client completes the RSA/AES exchange and reads the peer's encrypted response.
  • The same UI scenario with a session rejected by a local mock session service also completes encryption for the LAN entry.
  • Direct Connection and a saved entry at the same IP still refuse without an account. Direct Connection still refuses a session rejected by the mock service.
  • Regression tests retain the LAN kind through deferred startup and reconnects; the list test distinguishes a saved entry and a discovered entry sharing an address.
  • Compatibility with #5096: merges cleanly; the combined client library and binary pass cargo check, and all 12 network tests pass.

Self-check used an isolated network namespace: on this machine an egress proxy accepts connections to the TEST-NET address the existing dead-address test expects to be unreachable. The same test fails on clean main outside isolation.

🤖 Generated with Codex.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5107 **Author:** [@oskal675-design](https://github.com/oskal675-design) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/lan-login-authentication` --- ### 📝 Commits (1) - [`db171db`](https://github.com/horizon-rust/horizon/commit/db171db98f6b80c69f0d5549a8581e0894ac88f4) Preserve LAN authentication fallback during server login ### 📊 Changes **12 files changed** (+398 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -3) 📝 `crates/horizon-client/src/game/extras.rs` (+3 -3) 📝 `crates/horizon-client/src/game/remote.rs` (+30 -11) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+6 -3) 📝 `crates/horizon-client/src/lan/discovery.rs` (+9 -0) 📝 `crates/horizon-client/src/multiplayer.rs` (+67 -14) 📝 `crates/horizon-client/src/net.rs` (+142 -14) 📝 `crates/horizon-client/src/reconnect.rs` (+26 -11) 📝 `crates/horizon-client/src/title.rs` (+7 -2) 📝 `crates/horizon-client/src/title/tests.rs` (+1 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaLanAuthOracle.java` (+60 -0) ➕ `tools/test_lan_auth_parity.py` (+42 -0) </details> ### 📄 Description > 🤖 Opened by oskal675-design's AI agent (Codex, GPT-6.1), not by oskal675-design personally. ## What and why Fixes #4995. Selecting a discovered LAN game currently loses its `ServerData.Type.LAN` equivalent before login. Horizon then stops on a missing or invalid session, although vanilla logs that authentication failure and continues encryption for LAN entries, letting the host decide whether to admit the player. Carry the selected entry's LAN kind through title actions, deferred resource loading and reconnects. Continue after failed session authentication only for that kind. Direct Connection, saved servers (including the same local IP), command-line joins and transfer destinations retain ordinary-server authentication behavior. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players - [ ] extra: Horizon-only, off by default - [ ] tooling - [ ] docs ## Vanilla reference Pinned 26.3 `ClientHandshakePacketListenerImpl.handleHello` and its authentication task (`lambda$handleHello$0`): a non-null authentication error disconnects unless `serverData.isLan()`, in which case it is logged before `setEncryption`. `ServerData.Type.LAN` comes from the selected LAN list entry, not an IP-address heuristic. `tools/test_lan_auth_parity.py` invokes the real vanilla listener with a rejecting session service and records encryption/denial for LAN and OTHER entries. The Rust side exercises the network thread against a peer that validates its RSA reply and sends an AES-encrypted message. ## Other projects' code none. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on omarchy, against origin/main at c3905131b, 3 min 10 s) | Check | Result | | --- | --- | | Scope | ✅ 12 files, +399 −61 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed (22 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (21 s) | | tests: horizon-client | ✅ 1343 passed (2 min 15 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 313 affected, to run in CI (--quick): block_removal, block_survival, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair, chorus_plant and 301 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Additional validation: - `python3 tools/parity.py lan_auth online_mode`: both pass, including the existing 43 online-mode checks. - Real multiplayer-screen path in isolated network namespaces: the original client refuses the discovered LAN entry before encryption; the fixed client completes the RSA/AES exchange and reads the peer's encrypted response. - The same UI scenario with a session rejected by a local mock session service also completes encryption for the LAN entry. - Direct Connection and a saved entry at the same IP still refuse without an account. Direct Connection still refuses a session rejected by the mock service. - Regression tests retain the LAN kind through deferred startup and reconnects; the list test distinguishes a saved entry and a discovered entry sharing an address. - Compatibility with #5096: merges cleanly; the combined client library and binary pass `cargo check`, and all 12 network tests pass. Self-check used an isolated network namespace: on this machine an egress proxy accepts connections to the TEST-NET address the existing dead-address test expects to be unreachable. The same test fails on clean main outside isolation. 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:11:28 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6080
No description provided.