Organize and find secrets
Keep secrets in folders by naming their paths, list a folder, and see what a secret holds without opening it.
Available, with limitsAPI
With many secrets, you find them by browsing. Paths read like folders: web/github, web/gitlab and db/prod/root
sit in the folders web/ and db/. You list a folder to see what is in it, and read a secret’s names to check what it
holds before anyone opens it.
Before you start: you have a few secrets in your own vault, and you are signed in with your session in
$CVYUH_SESSION (Call the API shows how).
Find a secret
Section titled “Find a secret”-
List the top of your vault:
Terminal window curl "https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/metadata?list=true" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"The realm answers
{ "data": { "keys": ["db/", "web/"] } }. Folders end in/. -
List a folder:
Terminal window curl "https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/metadata/web/?list=true" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"The realm answers
{ "data": { "keys": ["github", "gitlab"] } }. TheLISTmethod on the same address does the same. -
See what a secret holds, without its values:
Terminal window curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/subkeys/web/github \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"The realm answers
{ "subkeys": { "user": null, "password": null }, … }underdata. Add?depth=1to stop at the first level.
Check it worked
Section titled “Check it worked”A listing with nothing under the prefix answers 404. A secret you deleted whole is no longer listed.
Good to know
Section titled “Good to know”- A listing straight after a write can miss the newest path for a moment, on some sites. Read the path itself when you need it at once. See Known limitations.
- Through a grant, you see what you may view. Someone with a
viewgrant who lists your vault sees only the secrets they may view.