stacklok / stacklok/toolhive

Scoped secret store: migration infrastructure for existing keys

Open
#4,226 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

authentication enhancement go
Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Summary

Phase 3 of the scoped secret store implementation (#4192).

Existing users may have registry tokens and workload auth secrets stored under bare keys (no __thv_ prefix). This phase adds crash-safe migration infrastructure to rename them into the correct scope on first run.

Work

  • MigrateSystemKeys(ctx, provider, migrations []KeyMigration) error in migration.go
  • Uses BulkDeleteSecrets (store-before-delete ordering) so a crash mid-migration does not leave secrets unreachable
  • Guarded by a config flag so migration only runs once
  • Unit tests covering full migration, partial failure, and idempotency

Dependencies

Depends on Phase 2. Must ship together with Phase 4 (wire callers) — shipping migration without updated callers, or updated callers without migration, would break existing users.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in migration.go at MigrateSystemKeys(ctx, provider, migrations []KeyMigration), then inspect the existing BulkDeleteSecrets behavior and configuration handling. Use the stated full-migration, partial-failure, and idempotency cases as the unit-test targets. Done means crash-safe first-run migration of bare keys into scoped keys, with the migration guarded to run once and compatible with Phase 4 callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.