Subkeys
See the names inside a secret without its values, to check what it holds before anyone opens it.
AvailableAPI
Subkeys show the shape of a secret: the names of its values, with every value left out. A tool can check that a
secret has the fields it expects, such as user and password, without reading the password itself.
Before you begin
Section titled “Before you begin”- Who: anyone who may view the secret: every right in its vault, or a
viewgrant. - Where: the API. There are no screens yet.
- First: the secret has a live version.
How it works
Section titled “How it works”A GET on https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/subkeys/<path> answers the latest version’s
names, every value replaced by null, with the version’s metadata. Add ?version=<n> for an older version, and
?depth=<d> to stop after <d> levels of nested objects. 0, the default, goes all the way down.
Set it up
Section titled “Set it up”There’s nothing to set up. Read the names in web/github (Call the API shows how to get
$CVYUH_SESSION):
curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/subkeys/web/github \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"{ "data": { "subkeys": { "user": null, "password": null }, "metadata": { "version": 3, "…": "…" } } }When it fails
Section titled “When it fails”| Answer | When | What to do |
|---|---|---|
404 | The path or version isn’t there, the version is deleted or destroyed, or, in a personal vault, you have no access | Ask for a live version |
403 | A use grant, or no right in a group’s or the realm’s vault | Ask for view |
Limits and defaults
Section titled “Limits and defaults”| Limit | Default |
|---|---|
depth | 0, all the way down |
version | the latest |
Audit record
Section titled “Audit record”A subkeys read changes nothing, so it writes no change record; it is an ACCESS record under the reader. See
Secrets audit trail.
Good to know
Section titled “Good to know”- The version must be live. Asking for a deleted or destroyed version answers
404. - It needs
view. Someone with only ausegrant can’t read a secret’s subkeys. - Labels are left out. The metadata in the answer carries no
custom_metadata.
Related
Section titled “Related”- Organize and find secrets: listing and subkeys together.
- Metadata: a secret’s history and settings.