fix(kms): tell an empty KV2 prefix from a missing mount on Vault's 404 (#6043)

This commit is contained in:
Zhengchao An
2026-08-13 08:09:17 +08:00
committed by GitHub
parent b2ae430805
commit a70a3787d8
5 changed files with 341 additions and 19 deletions
+11
View File
@@ -57,6 +57,17 @@ impl ScriptedResponse {
}
}
/// The 404 Vault answers a LIST of an empty path with: something routed the
/// request and found nothing under it, so the `errors` array comes back
/// empty. [`ScriptedResponse::error`] cannot stand in — it always fills
/// `errors`, which is what marks a 404 as an unrouted path instead.
pub(crate) fn empty_list_404() -> Self {
Self::Http {
status: 404,
body: serde_json::json!({ "errors": [] }).to_string(),
}
}
/// Close the connection after consuming a request without sending an HTTP response.
pub(crate) fn close() -> Self {
Self::Close