feat(p1.9): mobile secure token storage via iOS Keychain#88
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements P1.9 from the roadmap: relocate the mobile app's
atterm.relayblob (containing theatk_…API token) from localStorage to iOS Keychain via a small custom Capacitor plugin. Migrate existing localStorage values on first read after upgrade, then clear them. Strengthen the "Allow insecure HTTP" warning UX.AttermSecureStorage(~80 lines Swift + ~10 lines Obj-C bridge). Single keychain item,kSecAttrService = "com.attson.atterm",kSecAttrAccessible = kSecAttrAccessibleAfterFirstUnlock. No third-party npm dep, no biometric prompt.secureStorage.tswraps the native plugin; falls back to in-memoryMapon web + vitest via Capacitor'sregisterPluginproxy. One-shot detection cached.capacitor.tsmigration on read:relay.load()checks Keychain first; if empty and localStorage has a legacy blob, writes it into Keychain then removes from localStorage.save()writes only to Keychain.clear()wipes both (defensive against interrupted migrations).fetchMe/listRemoteSessionsconsult both stores (Keychain first) so transitions are seamless.InsecureBanner.vue: persistent top banner shown when the active relay URL is HTTP; tap to expand body, "Dismiss" to hide for the session. Returns next launch.MobileSetup.vue: always-visible yellow warning block under the "Allow insecure" checkbox so the consequence is visible before opting in.Info.plistunchanged —NSAllowsArbitraryLoads = truestays (deliberate; per user decision). The deterrent moved to UI rather than runtime ATS.Spec: `docs/superpowers/specs/2026-06-01-mobile-secure-storage-design.md`
Plan: `docs/superpowers/plans/2026-06-01-mobile-secure-storage.md`
Test Plan
Out of scope (in spec §1)