Re: [PATCH proxmox-backup v2 10/27] api: config: add endpoints for encryption key manipulation

Thomas Lamprecht
2026-04-11T08:51:55Z

Am 10.04.26 um 18:54 schrieb Christian Ebner:
> diff --git a/src/api2/config/encryption_keys.rs b/src/api2/config/encryption_keys.rs
> @@ -0,0 +1,203 @@
>
> +pub fn create_key(
> + id: String,
> + key: Option<String>,
> + _rpcenv: &mut dyn RpcEnvironment,
> +) -> Result<KeyConfig, Error> {
> + let key_config = if let Some(key) = &key {
> + serde_json::from_str(key)
> + .map_err(|err| format_err!("failed to parse provided key: {err}"))?
> + } else {

nit: might want to do a trial decrypt here (like check_privs_and_load does) to
catch broken uploads early instead of only at first sync run.

> +fn encryption_key_in_use(id: &str) -> Result<Option<String>, Error> {
> + let job_with_key = list.iter().find(|job| {

nit: this returns only the first matching job. Showing all affected jobs in the
error message would be nicer for the admin to repeatedly running into this for
each such job.