Transit read-key response documentation omits `latest_version`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- openapi
- Domain
- api, documentation
Research direction
Start with the Read Key page linked in the issue and compare its response example with the live GET /v1/transit/keys/:name response. Inspect /v1/sys/internal/specs/openapi for the corresponding 200 response. Done means the page and sample document latest_version, with its presence and bounds clarified, and the OpenAPI response gap addressed or explicitly scoped.
Written by the indexing model from the issue text.
Description
Describe the bug
GET /v1/transit/keys/:name returns a latest_version field, but it is not documented anywhere:
- The Read Key page does not mention it, and the sample response omits it.
- The OpenAPI spec from
/v1/sys/internal/specs/openapihas no response body definition for this endpoint — the200is a bare"description": "OK"with no schema reference.
The field is only discoverable by calling the endpoint.
Steps to reproduce
Against hashicorp/vault:2.0.4 in dev mode, with transit enabled:
$ vault write -f transit/keys/foo
$ curl -sH "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/transit/keys/foo" \
| jq '.data | {name, latest_version, keys}'
{
"name": "foo",
"latest_version": 1,
"keys": { "1": 1787846981 }
}
$ vault write -f transit/keys/foo/rotate
$ curl -sH "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/transit/keys/foo" \
| jq '.data | {name, latest_version, keys}'
{
"name": "foo",
"latest_version": 2,
"keys": { "1": 1787846981, "2": 1787846983 }
}
Confirming the spec describes no response fields:
$ curl -sH "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/sys/internal/specs/openapi" \
| jq '.paths."/transit/keys/{name}".get.responses'
{ "200": { "description": "OK" } }
Why this matters
We depend on latest_version to detect Transit key rotation. Because it is undocumented, a reviewer questioned whether we should rely on it, and suggested deriving the current version from the largest key of the keys map instead.
We would prefer the scalar. The keys map returns version numbers as JSON object keys, so they must be parsed from strings before comparison, and its value shape appears to vary by key type. A documented scalar is easier to depend on.
Requests
- Please document
latest_versionon the Read Key page, including in the sample response. - Is
latest_versionguaranteed present for all key types, and always>= 1for a key that exists? We currently treat absence as an error and assume no lower bound —min_encryption_versionis documented in the same response as using0as a sentinel for "use the latest version", so we did not want to assume0is impossible here without confirmation. - Are response schemas for the Transit endpoints planned for the generated OpenAPI spec? That would resolve this class of question generally.
Vault version
Vault v2.0.4 (c9e9d1d4ddd4b55aae79a8949adffa9e96338720), built 2026-08-03T16:14:36Z
- Dominant language
- Go
- Stars
- 36.3k
- Forks
- 4.8k
- Avg merge
- 50m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hashicorp/vault
-
bug error-messages helper/ldaputil
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
cryptosec docker
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
agent bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug clientapi
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
File descriptor leak on early return in WriteToken (command/agentproxyshared/sink/file/file_sink.go) Openbug command
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100