]> git.proxmox.com Git - proxmox.git/commitdiff
expand helper function by eab credentials
authorFolke Gleumes <f.gleumes@proxmox.com>
Tue, 14 Nov 2023 14:14:02 +0000 (15:14 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 4 Dec 2023 09:14:44 +0000 (10:14 +0100)
Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
src/client.rs

index 78c83a20e700635ede536802c2e2d3d0e4ebafdc..53f2688a5c9c1b4dea158402b76e6dd47d4e001f 100644 (file)
@@ -367,10 +367,14 @@ impl Client {
         contact: Vec<String>,
         tos_agreed: bool,
         rsa_bits: Option<u32>,
+        eab_creds: Option<(String, String)>,
     ) -> Result<&Account, Error> {
-        let account = Account::creator()
+        let mut account = Account::creator()
             .set_contacts(contact)
             .agree_to_tos(tos_agreed);
+        if let Some((eab_kid, eab_hmac_key)) = eab_creds {
+            account = account.set_eab_credentials(eab_kid, eab_hmac_key)?;
+        }
         let account = if let Some(bits) = rsa_bits {
             account.generate_rsa_key(bits)?
         } else {