Skip to content

Consolidate importer credentials into a single keychain item - #95

Closed
Nef10 with Copilot wants to merge 15 commits into
mainfrom
copilot/use-one-keychain-entry
Closed

Consolidate importer credentials into a single keychain item#95
Nef10 with Copilot wants to merge 15 commits into
mainfrom
copilot/use-one-keychain-entry

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

Importers were persisting credentials as separate keychain items, which could trigger repeated password prompts. This change moves importer credential storage behind one shared keychain record while preserving the existing importer-facing API.

  • Credential storage

    • Replace per-key keychain writes with a single serialized credential dictionary stored under one keychain item.
    • Keep saveCredential(_:for:) / readCredential(_:) unchanged for importers, so the change stays isolated to ImportManager.
  • Legacy migration

    • When a credential is requested and only an older per-key entry exists, migrate it into the shared record on read.
    • Clean up the legacy item after the shared write succeeds.
  • Concurrency and failure handling

    • Serialize credential access during reads/writes and migration.
    • Add targeted logging for shared-store reads, migration failures, and legacy cleanup paths without logging credential identifiers.
private enum CredentialStorage {
    static let keychainKey = "importer-credentials"
}

func saveCredential(_ value: String, for key: String) {
    if !saveCredentialLocked(value, for: key) {
        Logger.importer.error("Failed to save credential into shared storage")
    }
}

Copilot AI linked an issue May 31, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix multiple password popups by using one keychain entry Consolidate importer credentials into a single keychain item May 31, 2026
Copilot AI requested a review from Nef10 May 31, 2026 08:36
Copilot finished work on behalf of Nef10 May 31, 2026 08:36
@Nef10 Nef10 closed this Jun 25, 2026
@Nef10
Nef10 deleted the copilot/use-one-keychain-entry branch June 25, 2026 05:30
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.

Use one keychain entry

2 participants