[pbs-devel] [PATCH backup] tfa: remove/empty description for recovery keys
    Wolfgang Bumiller 
    w.bumiller at proxmox.com
       
    Mon Jan 18 15:11:16 CET 2021
    
    
  
While the user chosen description is not allowed to be
empty, we do leave it empty for recovery keys, as a "dummy
description" makes little sense...
Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 src/config/tfa.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/config/tfa.rs b/src/config/tfa.rs
index aff1b3d8..f957cd75 100644
--- a/src/config/tfa.rs
+++ b/src/config/tfa.rs
@@ -343,6 +343,7 @@ pub struct TfaInfo {
     pub id: String,
 
     /// User chosen description for this entry.
+    #[serde(skip_serializing_if = "String::is_empty")]
     pub description: String,
 
     /// Creation time of this entry as unix epoch.
@@ -359,7 +360,7 @@ impl TfaInfo {
     pub(crate) fn recovery(created: i64) -> Self {
         Self {
             id: "recovery".to_string(),
-            description: "recovery keys".to_string(),
+            description: String::new(),
             enable: true,
             created,
         }
-- 
2.20.1
    
    
More information about the pbs-devel
mailing list