use schema verify methods

the old, deprecated ones only forward to these anyway.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-12-30 13:55:54 +01:00
parent 9987872382
commit 7f6c169b25
2 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ regex = "1.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
proxmox-lang = "1.0.0" proxmox-lang = "1.0.0"
proxmox-schema = { version = "1.0.1", features = [ "api-macro" ] } proxmox-schema = { version = "1.1", features = [ "api-macro" ] }
proxmox-serde = "0.1" proxmox-serde = "0.1"
proxmox-time = "1.1.1" proxmox-time = "1.1.1"
proxmox-uuid = { version = "1.0.0", features = [ "serde" ] } proxmox-uuid = { version = "1.0.0", features = [ "serde" ] }

View File

@ -39,7 +39,7 @@ fn test_cert_fingerprint_schema() -> Result<(), anyhow::Error> {
]; ];
for fingerprint in invalid_fingerprints.iter() { for fingerprint in invalid_fingerprints.iter() {
if parse_simple_value(fingerprint, &schema).is_ok() { if schema.parse_simple_value(fingerprint).is_ok() {
bail!("test fingerprint '{}' failed - got Ok() while exception an error.", fingerprint); bail!("test fingerprint '{}' failed - got Ok() while exception an error.", fingerprint);
} }
} }
@ -50,7 +50,7 @@ fn test_cert_fingerprint_schema() -> Result<(), anyhow::Error> {
]; ];
for fingerprint in valid_fingerprints.iter() { for fingerprint in valid_fingerprints.iter() {
let v = match parse_simple_value(fingerprint, &schema) { let v = match schema.parse_simple_value(fingerprint) {
Ok(v) => v, Ok(v) => v,
Err(err) => { Err(err) => {
bail!("unable to parse fingerprint '{}' - {}", fingerprint, err); bail!("unable to parse fingerprint '{}' - {}", fingerprint, err);
@ -83,7 +83,7 @@ fn test_proxmox_user_id_schema() -> Result<(), anyhow::Error> {
]; ];
for name in invalid_user_ids.iter() { for name in invalid_user_ids.iter() {
if parse_simple_value(name, &Userid::API_SCHEMA).is_ok() { if Userid::API_SCHEMA.parse_simple_value(name).is_ok() {
bail!("test userid '{}' failed - got Ok() while exception an error.", name); bail!("test userid '{}' failed - got Ok() while exception an error.", name);
} }
} }
@ -97,7 +97,7 @@ fn test_proxmox_user_id_schema() -> Result<(), anyhow::Error> {
]; ];
for name in valid_user_ids.iter() { for name in valid_user_ids.iter() {
let v = match parse_simple_value(name, &Userid::API_SCHEMA) { let v = match Userid::API_SCHEMA.parse_simple_value(name) {
Ok(v) => v, Ok(v) => v,
Err(err) => { Err(err) => {
bail!("unable to parse userid '{}' - {}", name, err); bail!("unable to parse userid '{}' - {}", name, err);