feat(kms): add backend capability discovery (#5485)

This commit is contained in:
Zhengchao An
2026-07-31 06:09:43 +08:00
committed by GitHub
parent 40ef0db9cc
commit 342ee1df78
13 changed files with 393 additions and 4 deletions
+7 -1
View File
@@ -21,7 +21,7 @@
//!
//! encrypted_data(plaintext_len+16) || nonce (12 bytes)
use crate::backends::{BackendInfo, KmsBackend, KmsClient};
use crate::backends::{BackendCapabilities, BackendInfo, KmsBackend, KmsClient};
use crate::config::{BackendConfig, KmsConfig};
use crate::encryption::DataKeyEnvelope;
use crate::error::{KmsError, Result};
@@ -435,6 +435,12 @@ impl KmsBackend for StaticKmsBackend {
async fn health_check(&self) -> Result<bool> {
Ok(true)
}
fn capabilities(&self) -> BackendCapabilities {
// Static KMS is a read-only single-key backend: it only performs
// cryptographic operations and rejects every lifecycle mutation.
BackendCapabilities::minimal()
}
}
#[cfg(test)]