Skip to content

feat: migrate API keys to Obsidian SecretStorage (keychain)#2200

Draft
logancyang wants to merge 1 commit intomasterfrom
keychain-migration
Draft

feat: migrate API keys to Obsidian SecretStorage (keychain)#2200
logancyang wants to merge 1 commit intomasterfrom
keychain-migration

Conversation

@logancyang
Copy link
Copy Markdown
Owner

@logancyang logancyang commented Feb 22, 2026

Summary

  • Adds design doc (docs/KEYCHAIN_MIGRATION.md) for migrating all API keys and tokens from data.json to Obsidian's native SecretStorage API (OS keychain)
  • Covers upgrade path: existing keys auto-migrate to keychain on first load, data.json fields cleared, one-time notice shown
  • Deprecates the broken encryptionService.ts (hardcoded Web Crypto key + cross-platform failures)
  • Documents the MarkdownRenderer breaking change from the required Obsidian API bump (1.2.5 → 1.12.2)

Key decisions

  • Keychain only — no dual-write, no toggle. Simple single code path.
  • One-time migration — decrypt legacy enc_ values, write to keychain, clear data.json. Idempotent.
  • No sync — keys are device-local (same model as SSH keys, 1Password). Users re-enter on other devices once.
  • All reads become synchronousgetDecryptedKey (async) replaced by keychain.getProviderKey() (sync)

Test plan

  • Review design doc for completeness and correctness
  • Implementation follows in subsequent PRs

🤖 Generated with Claude Code

Design doc for migrating all API keys and tokens from data.json to
Obsidian's native SecretStorage (keychain) API. Covers the upgrade
path for existing users, legacy encryption deprecation, and
MarkdownRenderer breaking change from the API version bump.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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