mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 15:46:53 +00:00
feat(admin): expose KMS backend capabilities in status response
Surface the backend capability matrix as an optional, additive 'capabilities' field on the /v3/kms/status response so management clients can discover supported lifecycle operations. The field is skipped when unset, keeping the response shape unchanged for existing consumers, and legacy payloads without it still deserialize. Refs rustfs/backlog#1571 (part of rustfs/backlog#1562)
This commit is contained in:
@@ -438,7 +438,9 @@ mod tests {
|
||||
)
|
||||
.with_insecure_development_defaults();
|
||||
// Constructing the client performs no network I/O with token auth.
|
||||
let backend = vault::VaultKmsBackend::new(config).await.expect("vault kv2 backend should build");
|
||||
let backend = vault::VaultKmsBackend::new(config)
|
||||
.await
|
||||
.expect("vault kv2 backend should build");
|
||||
|
||||
insta::assert_json_snapshot!("vault_kv2_backend_capabilities", capabilities_snapshot(backend.capabilities()));
|
||||
}
|
||||
|
||||
@@ -159,6 +159,11 @@ impl KmsManager {
|
||||
pub async fn health_check(&self) -> Result<bool> {
|
||||
self.backend.health_check().await
|
||||
}
|
||||
|
||||
/// Report the capabilities of the configured backend
|
||||
pub fn backend_capabilities(&self) -> crate::backends::BackendCapabilities {
|
||||
self.backend.capabilities()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -184,6 +184,15 @@ impl ObjectEncryptionService {
|
||||
self.kms_manager.health_check().await
|
||||
}
|
||||
|
||||
/// Report the capabilities of the configured backend
|
||||
///
|
||||
/// # Returns
|
||||
/// The capability matrix advertised by the active KMS backend
|
||||
///
|
||||
pub fn backend_capabilities(&self) -> crate::backends::BackendCapabilities {
|
||||
self.kms_manager.backend_capabilities()
|
||||
}
|
||||
|
||||
/// Create a data encryption key for object encryption
|
||||
///
|
||||
/// # Arguments
|
||||
|
||||
Reference in New Issue
Block a user