Adds an eye-icon toggle to the master password field (UnlockView) so
users can verify what they typed before submitting.
Also maps KDBX4's ERROR_HEADER_HASH_VERIFICATION_FAILED -- surfaced
via the header HMAC check, which is password-derived -- to
KDBXError.invalidPassword alongside the existing
passwordAndOrKeyfileWrong check. KeePassKit uses this same error code
for both a wrong password/keyfile and genuine file corruption (it
doesn't distinguish the two), so the message hedges: "Incorrect
password, or this vault file is corrupted." Found while testing
against a real KDBX4 vault, which was surfacing this as a raw,
unreadable NSError string before the previous commit's LocalizedError
fix, and as *no* friendly message at all before this one (the error
code wasn't in the recognized set yet).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
UnlockViewModel.openFile(url:) called unlockWithPassword() immediately
after saving the bookmark, but the first-open UI (openFileSection) has
no password field yet -- password is still "" at that point, so every
first file pick failed before the user could type anything. Picking a
file now only saves the bookmark; the view naturally switches to the
password-entry state for the user to unlock explicitly.
Also makes KDBXError conform to LocalizedError with readable messages
per case, so any error path that reaches the generic catch clause
shows something useful instead of the default
"The operation couldn't be completed (MyPassCore.KDBXError error N)".
Found while testing the Phase 4 UI against a real KDBX file in the
simulator.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Completes Phase 4 (Task 17) -- ContentView now routes between UnlockView
and the vault UI (NavigationStack on iOS, 3-column NavigationSplitView on
macOS) instead of the leftover SwiftData template, finally resolving the
long-standing "cannot find type Item" build break. Vault locks on
scene-background (iOS) / resign-active (macOS).
Fixes two more real bugs surfaced now that everything actually links
together: EntryEditViewModel.save's dismiss closure needed @escaping
(used inside Task {}), and UnlockView's UTType(filenameExtension:)
needed `import UniformTypeIdentifiers`.
Also restores MyPass.entitlements, which had regressed to an empty
App Group array with Keychain Sharing missing entirely since the
"wire up AutoFill extension target" commit -- likely clobbered by
Xcode reconciling capabilities at some point without a rebuild in
between to catch it. Verified clean `xcodebuild` on both iOS Simulator
and macOS destinations, and `swift test` still passes all 18 tests.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Also fixes real bugs found while making Phase 4 build clean on both
platforms:
- FileBookmarkService used .withSecurityScope unconditionally, but
that bookmark option is macOS-only -- iOS grants scoped access
automatically once the user picks a file. Now conditional per platform.
- EntryEditViewModel's groupId was non-optional with no default, but
EntryDetailView's edit-sheet call site (Task 14) has no group
reference to pass -- only the "add new entry" path actually needs
it, so groupId is now optional and validated at save time instead.
- Missing `import Combine` in EntryDetailView (Timer.publish/autoconnect)
and UnlockViewModel/VaultViewModel/EntryEditViewModel (@Published).
- GroupBrowserView's `group: Group` property collided with SwiftUI's
own Group view type -- qualified as MyPassCore.Group.
- EntryEditView's .keyboardType(.URL) and .navigationBarTitleDisplayMode
are iOS-only APIs, guarded with #if os(iOS) for the macOS build.
Verified clean (aside from the known, expected ContentView.swift/Item
breakage) on both iOS Simulator and macOS destinations.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Phase 3 (Tasks 10-11) app services: FileBookmarkService persists a
security-scoped bookmark for the KDBX file in the shared App Group;
BiometricAuthService wraps LAContext for Face ID/Touch ID; ClipboardService
copies text with an expiring clipboard entry on iOS/macOS.
Also fixes a real build issue found while verifying: the AutoFill
extension (iOS-only) was being embedded/signed unconditionally,
breaking macOS builds of the MyPass scheme with a bogus provisioning
error. Added platformFilters = (ios) to both the embed build file and
the target dependency so macOS builds skip it. Verified both iOS
Simulator and macOS builds now fail only on the known, expected
ContentView.swift/Item SwiftData breakage.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Adds App Groups + Keychain Sharing entitlements to the AutoFill
target (matching the main app's group.org.antiloop222.mypass /
org.antiloop222.mypass), sets REGISTER_APP_GROUPS so automatic
signing registers the capability, and links MyPassCore as a
framework dependency by reusing the existing local package product
reference. Verified with `xcodebuild -scheme AutoFill build` for the
iOS Simulator: the AutoFill.appex target builds, signs, and embeds
cleanly (the only build failure is the pre-existing, expected
ContentView.swift/Item SwiftData breakage in the MyPass app target,
unrelated to this change).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Research confirmed macOS AutoFill has no real scope reduction vs iOS
(same API, same app-or-website coverage) beyond requiring manual
per-platform enablement, and that Associated Domains is the
responsibility of the app being logged into, not the password
manager's extension -- MyPass's existing CredentialMatcher already
handles both domain- and bundle-ID-based serviceIdentifiers correctly.
Adds an onboarding note since enabling the extension can't be
automated on either platform.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Identifiers, the AutoFillExtension -> AutoFill rename, and the KDBX
library choice had all drifted from the approved spec since it was
written in May. Updates the spec to match what was actually built and
closes the now-resolved "which KDBX library" open question.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Also drops the stray empty AutoFillExtension/ directory left over from
an earlier abandoned attempt at creating this target, and cleans up
duplicate/stale scheme entries in xcschememanagement.plist.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
The KeePassKit package never actually compiled: its Package.swift
didn't declare KissXML, the nested Argon2 submodule, or the in-tree
ChaCha20/TwoFish ciphers as dependencies, and its umbrella header's
framework-style <KeePassKit/...> imports don't resolve under SwiftPM's
non-framework header layout. Vendors KissXML locally (same issue as
KeePassKit) and fixes the resulting Swift-side API mismatches in
KDBXMapper/KDBXDocument (NSUUID bridges to UUID automatically,
KPKKey is abstract so KPKPasswordKey must be used directly, and a
few KeePassKit selectors were renamed by Swift's importer). Also
untracks MyPassCore/.build, which had been accidentally committed.
`swift test` now builds and passes all 18 tests.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Adds the AutoFill Credential Provider Extension target (App Group +
Keychain Sharing capabilities, autofill-credential-provider
entitlement), removes the leftover SwiftData bootstrap from
MyPassApp.swift now that Item.swift is gone, and switches the bundle
ID / App Group / Keychain group prefix from com.christophevila to
org.antiloop222 to match the project's existing identifier.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
Implements KDBXError, KDBXMapper, and KDBXDocument for reading and writing KDBX files using KeePassKit.
Adds KDBXDocumentTests with fixture from KeePassKit's own test suite (Test_Password_1234.kdbx, password "1234").
Fixes KeePassKit Package.swift to include defaultLocalization for SPM compatibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add MyPassCore local Swift Package with directory structure for
Models, KDBX, TOTP, Keychain, AutoFill, and Session modules
- Add KeePassKit as git submodule (Vendor/KeePassKit) with SPM wrapper
Package.swift since upstream has no native SPM support
- Delete SwiftData boilerplate Item.swift from main app target
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>