Scoped secret store: migration infrastructure for existing keys
Nobody has claimed this yet.
- 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) errorinmigration.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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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