test(kms): pin admin KMS response shapes where they are served (#5626)

The snapshots in crates/kms/src/api_types.rs pinned DeleteKeyResponse,
ListKeysResponse, DescribeKeyResponse and CancelKeyDeletionResponse, none
of which is serialized by any handler: those endpoints answer with
DeleteKmsKeyResponse and siblings in rustfs/src/admin/handlers/kms_keys.rs,
separate types carrying different fields. A breaking change to an admin
response could not fail them. Tag, untag and update-description had the
same gap, where the handler discards the kms-side response and serves its
own KmsKeyMetadataResponse.

Pin the shapes in the crate that produces them, and delete the four kms
mirrors. They were never in the pub use api_types list, had no
constructors and no callers, and only looked live because those snapshots
named them.

Keep the api_types snapshots that pin something real: configure, start,
stop and status are served verbatim by kms_dynamic, and the tag family
are live ObjectEncryptionService return types whose snapshots pin this
crate's public API rather than a wire shape.
This commit is contained in:
Zhengchao An
2026-08-02 19:20:17 +08:00
committed by GitHub
parent b1ddda3bb2
commit 2698a03582
20 changed files with 518 additions and 138 deletions
@@ -1,9 +0,0 @@
---
source: crates/kms/src/api_types.rs
expression: "serde_json::to_value(CancelKeyDeletionResponse\n{\n success: true, message: \"key deletion canceled\".to_string(), key_id:\n \"key-a\".to_string(),\n}).expect(\"cancel deletion response should serialize\")"
---
{
"key_id": "key-a",
"message": "key deletion canceled",
"success": true
}
@@ -1,10 +0,0 @@
---
source: crates/kms/src/api_types.rs
expression: "serde_json::to_value(DeleteKeyResponse\n{\n success: true, message: \"key scheduled for deletion\".to_string(), key_id:\n \"key-a\".to_string(), deletion_date:\n Some(\"2026-07-01T00:00:00Z\".to_string()),\n}).expect(\"delete key response should serialize\")"
---
{
"deletion_date": "2026-07-01T00:00:00Z",
"key_id": "key-a",
"message": "key scheduled for deletion",
"success": true
}
@@ -1,9 +0,0 @@
---
source: crates/kms/src/api_types.rs
expression: "serde_json::to_value(DescribeKeyResponse\n{\n success: false, message: \"key not found\".to_string(), key_metadata: None,\n}).expect(\"describe key response should serialize\")"
---
{
"key_metadata": null,
"message": "key not found",
"success": false
}
@@ -1,14 +0,0 @@
---
source: crates/kms/src/api_types.rs
expression: "serde_json::to_value(ListKeysResponse\n{\n success: true, message: \"keys listed\".to_string(), keys:\n vec![\"key-a\".to_string(), \"key-b\".to_string()], truncated: true,\n next_marker: Some(\"key-b\".to_string()),\n}).expect(\"list keys response should serialize\")"
---
{
"keys": [
"key-a",
"key-b"
],
"message": "keys listed",
"next_marker": "key-b",
"success": true,
"truncated": true
}