Take back a change
Undo a mistaken write softly, bring it back if you were wrong, remove a version's values for good, or delete a whole secret.
API
You wrote the wrong value, or an old credential must be gone for certain. You choose how final each step is: a delete can be undone, a destroy can’t, and deleting the whole secret frees the path to start again.
Before you start: you can write the secret: here, web/github in your own vault. You are signed in with your
session in $CVYUH_SESSION (Call the API shows how).
Take it back
Section titled “Take it back”-
Delete the latest version, softly:
Terminal window curl -X DELETE https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/data/web/github \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"Reading that version now answers
404, with its metadata showing when it was deleted. To delete chosen versions, send{ "versions": [2, 3] }to…/me/delete/web/github. -
If you were wrong, bring versions back:
Terminal window curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/undelete/web/github \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "versions": [3] }' -
To remove values for good, destroy the versions:
Terminal window curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/destroy/web/github \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "versions": [1] }'A destroyed version answers
404with its metadata markeddestroyed, and nothing brings it back. -
To delete the whole secret, every version and its settings:
Terminal window curl -X DELETE https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/metadata/web/github \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
Each call answers 204.
Check it worked
Section titled “Check it worked”A GET on https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/metadata/web/github shows each version’s
deletion_time and destroyed. After the whole secret is deleted, the path and its metadata answer 404, and the
next write is version 1.
Related
Section titled “Related”- Delete, undelete and destroy: what each step leaves.
- Limit a secret’s history: have versions lapse by themselves.