Skip to content

feat(team-vault): delete secrets when an object leaves the vault - #3

Merged
kipavy merged 1 commit into
mainfrom
feat/team-vault-secret-deletion
Aug 5, 2026
Merged

feat(team-vault): delete secrets when an object leaves the vault#3
kipavy merged 1 commit into
mainfrom
feat/team-vault-secret-deletion

Conversation

@kipavy

@kipavy kipavy commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

delete_object soft-deleted the object but left team_vault_secrets untouched, so a password removed from a team vault stayed readable by everyone with VIEW_SECRETS.

  • delete_object now cascades to team_vault_secrets.
  • New DELETE /v1/teams/:team_id/secrets/:secret_id for objects that move out of a vault rather than being deleted — the client calls this when a cut/paste or a Move-to-vault takes an object elsewhere. It gates on the secret's own type, not the object's, because the object row is soft-deleted or gone by the time it runs.
  • Migration 030 sweeps the rows already orphaned by the old behaviour.

Verified: 5 new authz tests plus the existing suite (145 tests) pass against a real Postgres; migration 030 checked against a scratch DB to purge exactly the orphans and keep live secrets.

The client half is already on voltius dev (1cf73d3) and needs this deployed — until then the DELETE 404s, which the client treats as success and degrades to the old behaviour.

delete_object soft-deleted the object but left team_vault_secrets
untouched, so a removed password stayed readable by everyone with
VIEW_SECRETS. Adds the cascade, a DELETE /secrets/:secret_id route for
objects that move out rather than die, and a migration sweeping the rows
already orphaned. The route gates on the secret's own type so it still
works once the object row is gone.
@kipavy
kipavy merged commit fa43e3f into main Aug 5, 2026
2 checks 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