mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-11 13:07:46 +01:00
Desktop builds of todo/diet-guard/home_inventory are Flutter *web* in a Chrome --app window, so FlutterSecureStorage resolves to the web backend: AES-encrypted localStorage keyed inside the browser profile. That makes the account unsettable from outside the page -- `secret-tool` writes the wrong store (libsecret, which only the Linux build would read), and a Dart CLI cannot even import flutter_secure_storage, since it is a Flutter plugin and fails to resolve on the VM. Verified both, rather than assumed. The one process that can read the filesystem *and* reach the page is the wrapper already serving it -- the same seam diet-guard uses to keep the GitHub token out of the browser. So this adds the shared half of a wrapper route: the path constant, the opt-in env var, an opt-out marker key, and accountFromWrapper(), which fetches and hands the body to the existing FirebaseAccount.tryParse. Additive only, so consumers adopt it per-app on their own schedule; nothing forces a phone rebuild. Route handlers stay per-app because each wrapper owns its own server. Deliberately opt-in (CRDT_SYNC_SERVE_ACCOUNT): the route hands a credential with database write access to anything that can reach the wrapper's port, so it is set once to provision an install rather than left on. kSyncAccountOptOutKey exists so "Disconnect" cannot be silently undone by the next launch re-adopting the account. Every failure path returns null rather than throwing -- an absent route is the *normal* case -- so the caller degrades to "not configured", which the settings screens already handle by asking. 254 tests, analyzer clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0177xwzcpfpWG2qca8Mr39q9 |
||
|---|---|---|
| .. | ||
| device_test.dart | ||
| firebase_account_provisioning_test.dart | ||
| firebase_auth_rest_test.dart | ||
| firebase_client_test.dart | ||
| firebase_config_test.dart | ||
| firebase_settings_test.dart | ||
| github_client_test.dart | ||
| hlc_test.dart | ||
| log_test.dart | ||
| mirror_store_test.dart | ||
| record_test.dart | ||
| secure_credential_store_test.dart | ||
| store_test.dart | ||
| sync_revisions_test.dart | ||
| sync_test.dart | ||