Skip to content

refactor(app): use macOS Keychain for secret storage#27

Merged
pasrom merged 1 commit intomainfrom
refactor/keychain-secrets
Mar 15, 2026
Merged

refactor(app): use macOS Keychain for secret storage#27
pasrom merged 1 commit intomainfrom
refactor/keychain-secrets

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Mar 15, 2026

Summary

  • Replace file-based secret storage (~/.secrets/ with POSIX 600 permissions) with macOS Keychain via Security.framework
  • Uses SecItemAdd, SecItemCopyMatching, SecItemUpdate, SecItemDelete with service name com.meetingtranscriber
  • Same API surface (save/read/delete/exists) — no changes needed in callers (AppSettings)

Test plan

  • swift build compiles
  • swift test — all 491 tests pass (including KeychainHelperTests)
  • ./scripts/lint.sh — 0 violations
  • Manual: App → Settings → set OpenAI API Key → restart app → key persists

@github-actions github-actions bot added the chore Maintenance or non-functional changes label Mar 15, 2026
@pasrom pasrom force-pushed the refactor/keychain-secrets branch from 3b981fc to 3a804cd Compare March 15, 2026 20:41
What: Replace file-based secret storage with Security.framework
(SecItemAdd/CopyMatching/Update/Delete).

Reasoning:
- Problem: Plaintext files in ~/.secrets/ are not allowed in App
  Sandbox and fail Mac App Store review
- Decision: Use macOS Keychain via Security.framework with service
  name from AppPaths.logSubsystem. Same API surface (save/read/delete/
  exists) so no caller changes needed.
@pasrom pasrom force-pushed the refactor/keychain-secrets branch from 5530174 to c9fb1d8 Compare March 15, 2026 20:52
@pasrom pasrom merged commit 9e32399 into main Mar 15, 2026
5 checks passed
@pasrom pasrom deleted the refactor/keychain-secrets branch March 15, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance or non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant