PR 3655 regression fixes (#3664)
* chore: undo unintended updater `zip` feature drop, tweak comment * fix: correct unintended regression on version and project validation This was caused by a mistake when coalescing mostly copied and pasted `RE_URL_SAFE` regexes into one.
This commit is contained in:
parent
be425cff6f
commit
e4f0dddf82
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -4387,7 +4387,7 @@ dependencies = [
|
|||||||
"webp",
|
"webp",
|
||||||
"woothee",
|
"woothee",
|
||||||
"yaserde",
|
"yaserde",
|
||||||
"zip",
|
"zip 3.0.0",
|
||||||
"zxcvbn",
|
"zxcvbn",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -8704,6 +8704,7 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
"url",
|
"url",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
|
"zip 2.4.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -8907,7 +8908,7 @@ dependencies = [
|
|||||||
"uuid 1.16.0",
|
"uuid 1.16.0",
|
||||||
"whoami",
|
"whoami",
|
||||||
"winreg 0.55.0",
|
"winreg 0.55.0",
|
||||||
"zip",
|
"zip 3.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -11029,6 +11030,21 @@ dependencies = [
|
|||||||
"syn 2.0.101",
|
"syn 2.0.101",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zip"
|
||||||
|
version = "2.4.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50"
|
||||||
|
dependencies = [
|
||||||
|
"arbitrary",
|
||||||
|
"crc32fast",
|
||||||
|
"crossbeam-utils",
|
||||||
|
"displaydoc",
|
||||||
|
"indexmap 2.9.0",
|
||||||
|
"memchr",
|
||||||
|
"thiserror 2.0.12",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zip"
|
name = "zip"
|
||||||
version = "3.0.0"
|
version = "3.0.0"
|
||||||
|
@ -135,6 +135,7 @@ tauri-plugin-os = "2.2.1"
|
|||||||
tauri-plugin-single-instance = "2.2.3"
|
tauri-plugin-single-instance = "2.2.3"
|
||||||
tauri-plugin-updater = { version = "2.7.1", default-features = false, features = [
|
tauri-plugin-updater = { version = "2.7.1", default-features = false, features = [
|
||||||
"rustls-tls",
|
"rustls-tls",
|
||||||
|
"zip",
|
||||||
] }
|
] }
|
||||||
tauri-plugin-window-state = "2.2.2"
|
tauri-plugin-window-state = "2.2.2"
|
||||||
tempfile = "3.20.0"
|
tempfile = "3.20.0"
|
||||||
|
@ -88,7 +88,7 @@ rust_decimal = { workspace = true, features = [
|
|||||||
"serde-with-float",
|
"serde-with-float",
|
||||||
"serde-with-str",
|
"serde-with-str",
|
||||||
] }
|
] }
|
||||||
redis = { workspace = true, features = ["tokio-comp", "ahash", "r2d2"] } # Locked on 0.29 until deadpool-redis updates to 0.30
|
redis = { workspace = true, features = ["tokio-comp", "ahash", "r2d2"] }
|
||||||
deadpool-redis.workspace = true
|
deadpool-redis.workspace = true
|
||||||
clickhouse = { workspace = true, features = ["uuid", "time"] }
|
clickhouse = { workspace = true, features = ["uuid", "time"] }
|
||||||
uuid = { workspace = true, features = ["v4", "fast-rng", "serde"] }
|
uuid = { workspace = true, features = ["v4", "fast-rng", "serde"] }
|
||||||
|
@ -135,14 +135,14 @@ pub async fn projects_list(
|
|||||||
|
|
||||||
#[derive(Serialize, Deserialize, Validate)]
|
#[derive(Serialize, Deserialize, Validate)]
|
||||||
pub struct EditUser {
|
pub struct EditUser {
|
||||||
#[validate(length(min = 1, max = 39), regex(path = *crate::util::validate::RE_URL_SAFE))]
|
#[validate(length(min = 1, max = 39), regex(path = *crate::util::validate::RE_USERNAME))]
|
||||||
pub username: Option<String>,
|
pub username: Option<String>,
|
||||||
#[serde(
|
#[serde(
|
||||||
default,
|
default,
|
||||||
skip_serializing_if = "Option::is_none",
|
skip_serializing_if = "Option::is_none",
|
||||||
with = "::serde_with::rust::double_option"
|
with = "::serde_with::rust::double_option"
|
||||||
)]
|
)]
|
||||||
#[validate(length(min = 1, max = 64), regex(path = *crate::util::validate::RE_URL_SAFE))]
|
#[validate(length(min = 1, max = 64), regex(path = *crate::util::validate::RE_USERNAME))]
|
||||||
pub name: Option<Option<String>>,
|
pub name: Option<Option<String>>,
|
||||||
#[serde(
|
#[serde(
|
||||||
default,
|
default,
|
||||||
|
@ -358,7 +358,7 @@ pub async fn orgs_list(
|
|||||||
|
|
||||||
#[derive(Serialize, Deserialize, Validate)]
|
#[derive(Serialize, Deserialize, Validate)]
|
||||||
pub struct EditUser {
|
pub struct EditUser {
|
||||||
#[validate(length(min = 1, max = 39), regex(path = *crate::util::validate::RE_URL_SAFE))]
|
#[validate(length(min = 1, max = 39), regex(path = *crate::util::validate::RE_USERNAME))]
|
||||||
pub username: Option<String>,
|
pub username: Option<String>,
|
||||||
#[serde(
|
#[serde(
|
||||||
default,
|
default,
|
||||||
|
@ -7,7 +7,9 @@ use validator::{ValidationErrors, ValidationErrorsKind};
|
|||||||
use crate::models::pats::Scopes;
|
use crate::models::pats::Scopes;
|
||||||
|
|
||||||
pub static RE_URL_SAFE: LazyLock<Regex> =
|
pub static RE_URL_SAFE: LazyLock<Regex> =
|
||||||
LazyLock::new(|| Regex::new(r"^[a-zA-Z0-9_-]*$").unwrap());
|
LazyLock::new(|| Regex::new(r#"^[a-zA-Z0-9!@$()`.+,_"-]*$"#).unwrap());
|
||||||
|
pub static RE_USERNAME: LazyLock<Regex> =
|
||||||
|
LazyLock::new(|| Regex::new(r#"^[a-zA-Z0-9_-]*$"#).unwrap());
|
||||||
|
|
||||||
//TODO: In order to ensure readability, only the first error is printed, this may need to be expanded on in the future!
|
//TODO: In order to ensure readability, only the first error is printed, this may need to be expanded on in the future!
|
||||||
pub fn validation_errors_to_string(
|
pub fn validation_errors_to_string(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user