Skip to content

feat(settings): add option to toggle Keychain usage for credentials#57

Merged
MasamiYui merged 2 commits into
mainfrom
feature/optional-keychain
Feb 13, 2026
Merged

feat(settings): add option to toggle Keychain usage for credentials#57
MasamiYui merged 2 commits into
mainfrom
feature/optional-keychain

Conversation

@MasamiYui

Copy link
Copy Markdown
Member

Summary

  • Add useKeychain toggle in Settings to allow users to choose between Keychain and UserDefaults for credential storage
  • Fix issue where Keychain authorization popup appears even when user has disabled Keychain storage

Changes

Core Logic

  • Add useKeychain property in SettingsStore (default: true for backward compatibility)
  • Add conditional storage helpers (saveSecret/getSecret/deleteSecret) to route credentials based on user preference
  • Fix migrateLegacySecrets() to skip Keychain access when useKeychain is disabled

UI

  • Add Security section in Settings with "Use Keychain" toggle and warning text

Documentation

  • Update doc/04-storage-and-settings.zh-CN.md to document the new storage option
  • Update doc/09-security-and-audit.zh-CN.md to reflect the security implications

Security Note

When Keychain is disabled, credentials are stored in plaintext in UserDefaults plist file. This is intended for development/testing environments or personal devices where repeated Keychain authorization is inconvenient.

- Add guard clause in migrateLegacySecrets() to prevent Keychain access
  when user has disabled Keychain storage
- Update documentation to reflect the new optional Keychain feature
- Fix outdated code comment about secret storage location
@MasamiYui
MasamiYui merged commit f6613ac into main Feb 13, 2026
1 check 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