fix(auth): enable real OS keyring backends for secure-storage#40
Conversation
keyring 3.x has no default platform stores and falls back to an in-memory mock, so --features secure-storage did not persist secrets on macOS/Windows/Linux (issue #33). Wire apple-native, windows-native, and linux-native-sync-persistent, reject the mock backend on writes, and stop blaming code-signing for mock readback failures. Closes #33
CI and release never enabled --features secure-storage, so the mock-backend regression guard could not run and official binaries lacked OS keyring support. Install libdbus on Linux, add Cross.toml for aarch64, and enable the feature on test/clippy/release builds.
Thermo-nuclear review — PR #40Scope: full branch vs Verdict: merge when CI is green (no structural blockers)Fixes the real #33 defect. Not an apple-only one-liner. CI/release follow-up makes the regression guard real. 1. Structural regressionsNone. Net improvement:
2. Code judoLanded: one matrix, shared secret helpers, hard Follow-up (non-blocking):
3. SpaghettiNo new ad-hoc branches in unrelated flows. Auth error demotes signing to macOS Keychain-only secondary hint. 4. Contract checklist
5. File size
6. Residual risks
Approval bar
Ship when the OS matrix is green. |
Thermo-nuclear review (final) — PR #40CI is flaky/slow on the runner side right now; this is a local + diff review, not a green-check stamp. Verdict: approve to merge for #33No structural blockers in the branch diff. Root cause is fixed cross-platform; mock is fail-closed; CI/release wiring is correct in source even if runners are currently unhappy. What landed (branch vs master)
Local verification (this machine)
Approval bar
Non-blocking follow-ups
Ship when you're ready; re-check CI when the runner issue clears. Cannot self-approve on GitHub (own PR). |
Summary
Fixes #33:
--features secure-storagewas enabling keyring without platform credential-store features. keyring 3.x then uses its in-memory mock backend, so OAuth/API-key writes appeared to succeed and immediate readback failed (misreported as a macOS code-signing issue).Changes
apple-native(Keychain)windows-native(Credential Manager)linux-native-sync-persistent+crypto-rust(keyutils + Secret Service)is_available()is false for mockauth oauth --securedefault_backend_is_not_mock--features secure-storage; installlibdbus-1-devon Linux;Cross.tomlfor aarch64 dbusTest plan
cargo tree --features secure-storage -i keyring -e featuresshows platform nativescargo test --features secure-storage default_backend_is_not_mockauth oauth --secure+auth status --validateauth login --secureround-tripCloses #33