[PATCH proxmox-backup 08/20] api: config: allow encryption key manipulation for sync job

Christian Ebner
2026-04-01T07:55:59Z

Since the SyncJobConfig got extended to include an optional
encryption key, set the default to none. Extend the api config
update handler to also set or delete the encryption key based on
the provided parameters.

They encryption key will be used to encrypt unencrypted backup
snapshots (push) or decrypt snapshots with matching key fingerprint
(pull) during the sync.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/config/sync.rs | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/src/api2/config/sync.rs b/src/api2/config/sync.rs
index dff447cb6..e69b0a1ae 100644
--- a/src/api2/config/sync.rs
+++ b/src/api2/config/sync.rs
@@ -345,6 +345,8 @@ pub enum DeletableProperty {
UnmountOnDone,
/// Delete the sync_direction property,
SyncDirection,
+ /// Delete the encryption_key property,
+ EncryptionKey,
}

#[api(
@@ -471,6 +473,9 @@ pub fn update_sync_job(
DeletableProperty::SyncDirection => {
data.sync_direction = None;
}
+ DeletableProperty::EncryptionKey => {
+ data.encryption_key = None;
+ }
}
}
}
@@ -530,6 +535,10 @@ pub fn update_sync_job(
data.sync_direction = Some(sync_direction);
}

+ if let Some(encryption_key) = update.encryption_key {
+ data.encryption_key = Some(encryption_key);
+ }
+
if update.limit.rate_in.is_some() {
data.limit.rate_in = update.limit.rate_in;
}
@@ -705,6 +714,7 @@ acl:1:/remote/remote1/remotestore1:write@pbs:RemoteSyncOperator
run_on_mount: None,
unmount_on_done: None,
sync_direction: None, // use default
+ encryption_key: None,
};

// should work without ACLs
--
2.47.3