Skip to content

perf(ios): prefilter Vault AutoFill with inverted domain index and clean up unused TOTP/tags paths - #252

Merged
humandebri merged 2 commits into
mainfrom
perf/ios-autofill-domain-index
Dec 3, 2026
Merged

humandebri merged 2 commits into
mainfrom
perf/ios-autofill-domain-index

Conversation

@humandebri

@humandebri humandebri commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add VaultDomainIndex to KinicVaultCore (mirroring the inverted domain index in packages/vault-crypto) and align VaultCredentialCodec.normalizeDomain with WHATWG URL host normalization (IPv6 canonicalization, shorthand/octal/hex IPv4 parsing, leading/trailing/double dot rejection, and rejecting invalid numeric final labels such as android://jp.1).
  • Add an AEAD-encrypted, revision-pinned domain index (encryptedDomainIndexBase64URL) on VaultAutoFillSnapshot derived from all logins in decrypted credential bodies during VaultAutoFillSyncController.synchronize, keeping plaintext domains off disk.
  • Add VaultAutoFillSnapshotStore.listCandidates(rootKey:matchingHosts:) to prefilter covered records via VaultDomainIndex so unrelated credential chunks are skipped during host-scoped AutoFill lookups, while falling back to body decryption for any unindexed or stale-revision record (zero false negatives even for legacy records with partial manifests).
  • Update CredentialProviderViewController to pass serviceHosts directly to listCandidates(rootKey:matchingHosts:) instead of decrypting every credential before filtering.
  • Clean up unused AutoFill TOTP/tags code left over from refactor(vault): remove 2FA/TOTP UI from Web and iOS AutoFill extension #229/refactor(vault): remove passphrase generator, custom fields UI, and tags UI #230 (VaultAutoFillCandidate.hasTotp, VaultAutoFillDecryptedCredential.totpCode, VaultTOTP.generate in decryptCredential, and hidden tags matching in VaultItemSummary.matches(query:)), and prefer decrypted credential body tags over summary tags when preserving legacy fields in VaultItemEditorView.

Verification

  • swift test --package-path mobile/ios/Packages/KinicVaultCore (20/20 passed, including VaultDomainIndex, WHATWG normalizeDomain, and encrypted-index prefilter / partial-manifest tests)
  • swift test --package-path mobile/ios/Packages/KinicVaultNative (18 passed, 1 skipped)
  • xcodebuild build-for-testing -project mobile/ios/Kinic.xcodeproj -scheme Kinic -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO (succeeded)

@humandebri
humandebri merged commit cc1656a into main Dec 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant