mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-02 11:29:17 +00:00
refactor(kms): drop the dead duplicate api_types::DeleteKeyRequest (#5601)
api_types carried a second DeleteKeyRequest that nothing referenced: it is absent from the lib.rs re-export list, so rustfs_kms::DeleteKeyRequest has always resolved to types::DeleteKeyRequest through `pub use types::*`, and the admin handler builds the real type via `use rustfs_kms::types::*`. The copy had also drifted apart from the type it shadowed. It still called force_immediate "for development/testing only" and described the 7-30 day window as advisory, and it never gained the confirm_key_id field that the immediate-deletion gate now requires. A caller that reached into api_types and deserialized into it would silently drop confirm_key_id. api_types::DeleteKeyResponse stays: it is live, pinned by the kms_management_responses_have_stable_json_shapes snapshot alongside the list/describe/cancel response shapes, and it mirrors the admin wire response rather than duplicating types::DeleteKeyResponse, whose fields differ. Its doc comment now records why no request twin sits beside it.
This commit is contained in:
@@ -1343,18 +1343,11 @@ pub struct CreateKeyResponse {
|
||||
pub key_metadata: KeyMetadata,
|
||||
}
|
||||
|
||||
/// Request to delete a key
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct DeleteKeyRequest {
|
||||
/// Key ID to delete
|
||||
pub key_id: String,
|
||||
/// Number of days to wait before deletion (7-30 days, optional)
|
||||
pub pending_window_in_days: Option<u32>,
|
||||
/// Force immediate deletion (for development/testing only)
|
||||
pub force_immediate: Option<bool>,
|
||||
}
|
||||
|
||||
/// Response from delete key operation
|
||||
/// JSON shape returned by the admin delete-key endpoint.
|
||||
///
|
||||
/// The delete *request* shape lives in [`crate::types::DeleteKeyRequest`] —
|
||||
/// there is deliberately no copy here, because the immediate-deletion gate
|
||||
/// (`force_immediate` + `confirm_key_id`) must have exactly one definition.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct DeleteKeyResponse {
|
||||
/// Success flag
|
||||
|
||||
Reference in New Issue
Block a user