]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/api2/types.rs: also define PASSWORD_FORMAT and use it correctly
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Jan 2020 10:32:02 +0000 (11:32 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Jan 2020 10:32:02 +0000 (11:32 +0100)
src/api2/types.rs
src/config/remotes.rs

index eb9c4310dfaec20a9c0a4428641977c5e4a7bfca..3fc637e122d4cb6349c2ac892ecbef9b168fc4a9 100644 (file)
@@ -81,6 +81,9 @@ pub const DNS_NAME_OR_IP_FORMAT: ApiStringFormat =
 pub const PROXMOX_USER_ID_FORMAT: ApiStringFormat =
     ApiStringFormat::Pattern(&PROXMOX_USER_ID_REGEX);
 
+pub const PASSWORD_FORMAT: ApiStringFormat =
+    ApiStringFormat::Pattern(&PASSWORD_REGEX);
+
 
 pub const PVE_CONFIG_DIGEST_SCHEMA: Schema = StringSchema::new(r#"\
 Prevent changes if current configuration file has different SHA256 digest.
index 46f3b7803d0619a9e8c80b1a798bc9aaa0602784..bbefea4934e413b22ed47bb06a65f10eb6521b73 100644 (file)
@@ -15,7 +15,7 @@ lazy_static! {
 }
 
 pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth token for remote host.")
-    .format(&PASSWORD_REGEX)
+    .format(&PASSWORD_FORMAT)
     .min_length(1)
     .max_length(1024)
     .schema();