Skip to main content

Module api

Module api 

Source
Expand description

Routing and rendering. Public so it can be tested without a socket. Vault HTTP API routing and response rendering, KV version 2 only.

Pure functions: a method and path in, a Route out; a model’s structured answer in, the JSON envelope the vault CLI’s Go client decodes out. What the CLI needs that is not a secret — the mount preflight that tells it the engine is KV v2, seal status, health, the envelope’s request_id / lease_* / wrap_info fields — is NetGet’s. The secrets, key listings and versions are the model’s.

Structs§

VaultIdentity
Identity for the static sys/ endpoints.

Enums§

Route
What a request resolves to.

Constants§

MAX_LIST_KEYS
Largest number of keys one send_vault_list may carry.

Functions§

envelope
The response envelope every secret-engine answer is wrapped in.
errors_body
Vault’s error body: {"errors": [...]}.
health
leader
mount_preflight
/v1/sys/internal/ui/mounts/<path> for a path under a configured mount: what makes the CLI switch to KV v2 paths (<mount>/data/…, <mount>/metadata/…).
preflight_mount
Which mount (if any) a preflight path falls under.
render_error
The status and errors of a send_vault_error.
render_list
LIST <mount>/metadata/<path> body. Keys are names, not paths: a folder ends in /, and a key containing a / anywhere else would claim a nesting the listing does not have.
render_metadata
GET <mount>/metadata/<path> body — built from the same answer as a read.
render_secret
GET <mount>/data/<path> body.
render_write_ok
PUT <mount>/data/<path> body.
request_id
A request id in UUID form. Unique per response; it identifies nothing.
resolve
Resolve a request. path is the URL path; list_query is whether list=true was given.
seal_status