BACKUP_REPO_URL_REGEX: move to api2::types and allow all valid data store names
The repo URL consists of * optional userid * optional host * datastore name All three have defined regex or format, but none of that is used, so for example not all valid datastore names are accepted. Move definition of the regex over to api2::types where we can access all required regexes easily. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
c32186595e
commit
090decbe76
@ -3,12 +3,8 @@ use std::fmt;
|
||||
use anyhow::{format_err, Error};
|
||||
|
||||
use proxmox::api::schema::*;
|
||||
use proxmox::const_regex;
|
||||
|
||||
const_regex! {
|
||||
/// Regular expression to parse repository URLs
|
||||
pub BACKUP_REPO_URL_REGEX = r"^(?:(?:([\w@]+)@)?([\w\-_.]+):)?(\w+)$";
|
||||
}
|
||||
use crate::api2::types::*;
|
||||
|
||||
/// API schema format definition for repository URLs
|
||||
pub const BACKUP_REPO_URL: ApiStringFormat = ApiStringFormat::Pattern(&BACKUP_REPO_URL_REGEX);
|
||||
|
Reference in New Issue
Block a user