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
+12
View File
@@ -128,6 +128,10 @@ pub enum KmsError {
/// Backup/restore bundle contract violation; see [`crate::backup::BackupError`]
#[error(transparent)]
Backup(#[from] crate::backup::BackupError),
/// Operation is not supported by the active KMS backend
#[error("Operation '{operation}' is not supported by KMS backend '{backend}'")]
UnsupportedCapability { backend: String, operation: String },
}
impl KmsError {
@@ -269,6 +273,14 @@ impl KmsError {
version,
}
}
/// Create an unsupported capability error
pub fn unsupported_capability<S1: Into<String>, S2: Into<String>>(backend: S1, operation: S2) -> Self {
Self::UnsupportedCapability {
backend: backend.into(),
operation: operation.into(),
}
}
}
/// Convert from standard library errors