Repository navigation
feat(accounts): unify launcher and Minecraft account ownership - #44
xinvxueyuan wants to merge 6 commits into
Conversation
Bind saved accounts to the current device user and group Minecraft identities under local launcher accounts. Migrate flat documents without moving credentials, and scope sign-in, refresh, cleanup, and launch to the account's owner. Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
|
Sorry @xinvxueyuan, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 3 days and 7 hours by commenting |
Impact analysisNote Advisory only: the affected test list is broad by design and does not gate this pull request. A missing index fails the job instead of posting an empty result. 31 changed files · 18 source · 8 test · 5 other · 112 affected test files
Changed files
Affected testsCodeGraph followed imports 5 steps deep from the changed sources with Mirrors (
|
PR Summary by QodoScope Minecraft accounts to device users and local launcher accounts
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
Keep document internals inside their owner and expose scoped credential access and iterators instead of collection borrows. Reduce nesting in the launcher picker and document the data scope. Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Keep a stable namespace in the local user configuration directory when the native device principal is unavailable. Reuse the namespace across worker restarts and bind it to the native identity once it recovers. Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Resolve the local account-binding directory through DataDir rather than adding another entry point to the layout module. Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Stage the namespace and its native anchor in the local user configuration directory before publishing each digest. Losing concurrent workers reuse the winning binding. Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Resolve the native anchor in its own operation before associating the installation namespace with that device. Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
Summary
The existing Accounts panel now groups Minecraft accounts under local launcher accounts for the current device user. Users can switch launcher accounts, keep separate Minecraft profiles and selections, or play as a temporary offline player without signing in.
Motivation
The flat account list had no OS-user ownership or grouping. The same launcher data directory could show the same Minecraft records after another OS user or another machine opened it, even though the secrets did not travel with the directory.
Changes
accounts.jsonusesschema_version: 4anddevice_roots, keyed by the device-user digest. A root storeslauncher_accounts,selected_launcher, and its own optionalretired_credentials. Each launcher account has a UUID v4id,name(nullfor the anonymous account),mc_accounts, and a nullableselectedMinecraft ID. Each Minecraft record keeps its provider-qualifiedid,name, optionalserverand optionalcredential. IDs remain the Microsoft or offline profile UUID, or the Yggdrasil profile UUID plus its server identity.MachineGuid, or effective UID and Linux/etc/machine-id(D-Bus machine ID if unavailable or invalid) or macOSIOPlatformUUID. Raw OS principals and machine IDs are not persisted or logged. Account requests cannot supply a root ID. Mutations, cached sessions, authentication attempts, cleanup, and saved-player launch resolution stay inside the current root and the explicitly addressed launcher account where applicable.AXLauncher/device-usersunder the local user configuration directory, outside the portable data root. When machine identity lookup fails, it reuses the saved namespace or atomically creates one from a random installation ID. With the same OS principal, recovery binds the existing namespace to the native digest without switching accounts; a different native identity does not reuse the old binding. When no OS principal can be queried, the local profile directory supplies the scope. If neither a native identity nor a usable local configuration binding is available, the worker fails rather than changing identities each run.{"key":"<UUID v4>"}for a new entry keyed by<device digest>:<UUID>in the same system store. Inline tokens and passwords are not written.Testing
cargo nextest run --locked -p axlauncher_storage -p axlauncher_accounts --test-threads 1— 41 passed, including native lookup failure, restart, recovery, principal isolation, and concurrent initialization.cargo nextest run --locked -p axlauncher_core -p axlauncher_frontend -p axlauncher_launch -p axlauncher_state -p axlauncher_policy_tests --test-threads 1— 293 passed; 15 packaged-only tests skipped by design.node scripts/desktop.ts exec cargo clippy --workspace --all-targets --all-features --locked -- -D warningspassed;node scripts/desktop.ts exec cargo nextest run --workspace --locked --test-threads 1passed 595 tests;node scripts/desktop.ts smokepassed the 15 packaged-only tests. Builds and tests ran sequentially withCARGO_BUILD_JOBS=1,CARGO_INCREMENTAL=0and one test thread.cargo fmt --all --check,cargo shear,cargo deny check,prek run --all-files --stage pre-commit,pnpm install --frozen-lockfile,pnpm nojs,pnpm tsc,pnpm eslint,pnpm test:scripts(58 tests),pnpm file-length,tombi format --check,tombi lint,typos ., andreuse lint— passed.pnpm architecturepassed locally and in the Ubuntu CI lane. CI desktop Clippy, tests, and packaged smoke passed on Windows, Linux, and macOS. The Nix newest, legacy, and output checks also passed.Breaking Changes
Pre-schema-4 versions cannot reopen migrated account data. Back up
accounts.jsonbefore upgrade if rollback is needed; restoring the backup does not restore any subsequently retired system credentials. A flat file has no provable owner, so open an existing shared/portable directory first as the user who owns its credentials. After migration, another OS principal or machine gets its own empty anonymous account in the directory (if filesystem permissions permit); metadata inside the shared file is not encrypted. No re-login is required on the original machine and user when the corresponding system keyring entries still exist.Related
No linked issue.