Skip to content

Move secrets and MCP server storage to SQLite#571

Merged
swerner merged 2 commits into
mainfrom
move-secrets-mcp-servers-sqlite
Jul 22, 2026
Merged

Move secrets and MCP server storage to SQLite#571
swerner merged 2 commits into
mainfrom
move-secrets-mcp-servers-sqlite

Conversation

@brynary

@brynary brynary commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Migrate secrets storage from the JSON vault file to SQLite (secrets table) with a one-time legacy import that renames the old file to a timestamped .bak
  • Migrate MCP server definitions from mcps/*.toml to SQLite (mcp_servers table) with the same one-time legacy import pattern; reads come from an in-memory catalog, mutations use revision-guarded SQL
  • Add SqlVaultCredentialSource so LLM credential resolution reads from the SQLite-backed store and persists OAuth token refreshes via revision-checked CAS
  • Startup now runs the optional server-env secrets migration against the SQLite store; the old Vault-based migration path is deleted and its tests re-pointed at the production path
  • Post-review cleanup: shared fabro_db::legacy helpers (timestamped backup rename, is_toml_file) and parse_rfc3339_utc replace four per-crate copies; single bind order for MCP INSERT/UPDATE; generic load_store_blocking; snapshot-once env-secrets migration

Test plan

  • cargo nextest run -p fabro-db -p fabro-vault -p fabro-mcp-store -p fabro-variable -p fabro-environment -p fabro-server (803 tests pass)
  • cargo build --workspace, nightly clippy --workspace --all-targets -- -D warnings, and cargo fmt --check --all all clean

🤖 Generated with Claude Code

brynary and others added 2 commits July 22, 2026 13:10
- Delete the dead test-only Vault-based env-secrets migration and point
  the startup migration tests at the production migrate_to_store path
  over a real SQLite-backed SecretStore
- Extract shared legacy-import helpers (timestamped backup rename,
  is_toml_file) into fabro_db::legacy and parse_rfc3339_utc into
  fabro-db, replacing four per-crate copies
- Take one secrets snapshot in migrate_to_store instead of per-name
  queries
- Share one bind order between the MCP store INSERT and UPDATE
  statements
- Return SecretEntry directly from entry_from_row
- Unify the environment/MCP store blocking loaders into a generic
  load_store_blocking helper

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@swerner

swerner commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Rebased onto main now that #570 is merged: the three secrets commits dropped out (already on main), leaving the pure MCP-servers diff (2 commits). One import-line conflict with #585's snapshot change in fabro-db, resolved by keeping both. Migration sequence on this branch: 2026071101_secrets (main) → 2026071102_mcp_servers (this PR) — no renumbering needed. Local: fmt + clippy -D warnings clean, 1981/1981 tests across fabro-db/vault/mcp-store/auth/server/cli.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 22, 2026 17:19
@swerner
swerner force-pushed the move-secrets-mcp-servers-sqlite branch from 6bd855c to 4313998 Compare July 22, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@swerner
swerner merged commit 7792883 into main Jul 22, 2026
13 checks passed
@swerner
swerner deleted the move-secrets-mcp-servers-sqlite branch July 22, 2026 17:29
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.

3 participants