[PR #4933] [MERGED] Launcher: keep each account's secrets in one macOS keychain item #5951

Closed
opened 2026-11-03 05:16:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4933
Author: @socksprox
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/4912-macos-keychain-items


📝 Commits (2)

  • 8b10fe0 Launcher: keep each account's secrets in one macOS keychain item
  • f7f2747 Launcher: put split secrets back when the keychain refuses a delete

📊 Changes

3 files changed (+238 additions, -14 deletions)

View changed files

📝 docs/microsoft-account.md (+7 -4)
📝 launcher/src/account.rs (+98 -10)
📝 launcher/src/account/tests.rs (+133 -0)

📄 Description

🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox personally.

Summary

Closes #4912.

On macOS a sign-in's secrets were stored split into ~1 KB pieces (<uuid>, <uuid>.1, <uuid>.2...) — a workaround for Windows Credential Manager's 2560-byte item limit, which the Keychain doesn't have. Every piece is its own keychain item with its own consent ACL, so "Horizon wants to use your confidential information" appeared once per piece; and with the shipped builds signed ad hoc, "Always Allow" binds to the binary's cdhash and dies on every self-update — a prompt storm after nearly every start.

  • macOS now keeps the whole secret in the account's one item; the piece layout stays Windows-only, where the limit is real. Reads still concatenate key + key.N, so legacy split secrets fold into the single item on first read and writes remove leftover pieces. Launchers that still split read a merged item as its "piece 0", so the layouts interoperate both ways.
  • Accounts::has_owner checks the selected account first — when it owns the game that's one item read, not every account's.

A start that read ~6 items (3 accounts × 2 pieces) now reads ~1: prompts after an update drop from one per piece to at most one per account — typically a single prompt. Ending the prompt entirely needs shipped builds signed with a stable identity (MACOS_SIGN_IDENTITY, packaging/macos/README.md); noted in the issue as release-infrastructure scope, not this PR.

Test plan

  • cd launcher && cargo test — 303 lib tests pass, including new a_split_secret_folds_into_one_item (legacy pieces fold on first read) and has_owner_asks_the_selected_account_first
  • cargo clippy --all-targets -- -D warnings, cargo fmt --check clean
  • tools/pr_ready.py --quick:
pr_ready: 3 files changed since origin/main; checks on local
  Public tree: pass (1 s)
  Python tests: pass (39 s)
  launcher rustfmt: pass (3 s)
  launcher clippy: pass (1 s)
  launcher tests: pass (4 s)
Check Result
Scope ✅ 3 files, +131 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 486 passed
launcher rustfmt/clippy/tests ✅ 303 passed
Parity ➖ 254 listed for CI (--quick); no launcher/ path is a harness dependency, the launcher is its own workspace

🤖 Generated with Devin


🔄 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/4933 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/4912-macos-keychain-items` --- ### 📝 Commits (2) - [`8b10fe0`](https://github.com/horizon-rust/horizon/commit/8b10fe0f2addd721d4516d14c952f26fa99f3b7b) Launcher: keep each account's secrets in one macOS keychain item - [`f7f2747`](https://github.com/horizon-rust/horizon/commit/f7f274772468a11b892b839049c22836497ca5fa) Launcher: put split secrets back when the keychain refuses a delete ### 📊 Changes **3 files changed** (+238 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/microsoft-account.md` (+7 -4) 📝 `launcher/src/account.rs` (+98 -10) 📝 `launcher/src/account/tests.rs` (+133 -0) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox personally. ## Summary Closes #4912. On macOS a sign-in's secrets were stored split into ~1 KB pieces (`<uuid>`, `<uuid>.1`, `<uuid>.2`...) — a workaround for Windows Credential Manager's 2560-byte item limit, which the Keychain doesn't have. Every piece is its own keychain item with its own consent ACL, so "Horizon wants to use your confidential information" appeared once per piece; and with the shipped builds signed ad hoc, "Always Allow" binds to the binary's cdhash and dies on every self-update — a prompt storm after nearly every start. - macOS now keeps the whole secret in the account's one item; the piece layout stays Windows-only, where the limit is real. Reads still concatenate `key` + `key.N`, so legacy split secrets fold into the single item on first read and writes remove leftover pieces. Launchers that still split read a merged item as its "piece 0", so the layouts interoperate both ways. - `Accounts::has_owner` checks the selected account first — when it owns the game that's one item read, not every account's. A start that read ~6 items (3 accounts × 2 pieces) now reads ~1: prompts after an update drop from one per piece to at most one per account — typically a single prompt. Ending the prompt entirely needs shipped builds signed with a stable identity (`MACOS_SIGN_IDENTITY`, `packaging/macos/README.md`); noted in the issue as release-infrastructure scope, not this PR. #### Test plan - [x] `cd launcher && cargo test` — 303 lib tests pass, including new `a_split_secret_folds_into_one_item` (legacy pieces fold on first read) and `has_owner_asks_the_selected_account_first` - [x] `cargo clippy --all-targets -- -D warnings`, `cargo fmt --check` clean - [x] `tools/pr_ready.py --quick`: ``` pr_ready: 3 files changed since origin/main; checks on local Public tree: pass (1 s) Python tests: pass (39 s) launcher rustfmt: pass (3 s) launcher clippy: pass (1 s) launcher tests: pass (4 s) ``` | Check | Result | | --- | --- | | Scope | ✅ 3 files, +131 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 486 passed | | launcher rustfmt/clippy/tests | ✅ 303 passed | | Parity | ➖ 254 listed for CI (--quick); no `launcher/` path is a harness dependency, the launcher is its own workspace | 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:10 +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#5951
No description provided.