Skip to content

Commit

Permalink
Update validator dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
sporkmonger committed Nov 26, 2024
1 parent 584a6d5 commit 7ead743
Show file tree
Hide file tree
Showing 9 changed files with 1,999 additions and 350 deletions.
365 changes: 322 additions & 43 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ toml = { version = "0.8.6", features = ["preserve_order"] }
tonic = "^0.9"
tracing = "0.1.40"
url = "2.5.0"
validator = { version = "0.16", features = ["derive"] }
validator = { version = "0.19", features = ["derive"] }

[profile.test]
opt-level = 2
Expand Down
6 changes: 3 additions & 3 deletions crates/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl Default for Metrics {
#[derive(Debug, Validate, Clone, Default)]
pub struct Secret {
/// The secret reference key. Should be limited to ASCII lowercase a-z plus underscores. Maximum 96 characters.
#[validate(length(min = 1, max = 96), regex(path = "RE_VALID_REFERENCE"))]
#[validate(length(min = 1, max = 96), regex(path = *RE_VALID_REFERENCE))]
pub reference: String,
/// The location where the secret can be loaded from.
pub location: SecretLocation,
Expand Down Expand Up @@ -335,7 +335,7 @@ impl Default for PluginVerification {
#[derive(Debug, Validate, Clone, Default)]
pub struct Plugin {
/// The plugin reference key. Should be limited to ASCII lowercase a-z plus underscores. Maximum 96 characters.
#[validate(length(min = 1, max = 96), regex(path = "RE_VALID_REFERENCE"))]
#[validate(length(min = 1, max = 96), regex(path = *RE_VALID_REFERENCE))]
pub reference: String,
/// The location where the plugin WASM can be loaded from.
pub location: PluginLocation,
Expand Down Expand Up @@ -383,7 +383,7 @@ pub struct Permissions {
#[derive(Debug, Validate, Clone)]
pub struct Preset {
/// The preset reference key. Should be limited to ASCII lowercase a-z plus underscores. Maximum 96 characters.
#[validate(length(min = 1, max = 96), regex(path = "RE_VALID_REFERENCE"))]
#[validate(length(min = 1, max = 96), regex(path = *RE_VALID_REFERENCE))]
pub reference: String,
/// The list of references to plugins and other presets contained within this preset.
#[validate(length(min = 1))]
Expand Down
6 changes: 3 additions & 3 deletions crates/config/src/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct Include {
#[derive(Validate, Serialize, Deserialize, Clone)]
struct Secret {
#[serde(rename(serialize = "ref", deserialize = "ref"))]
#[validate(length(min = 1, max = 96), regex(path = "RE_VALID_REFERENCE"))]
#[validate(length(min = 1, max = 96), regex(path = *RE_VALID_REFERENCE))]
reference: String,
#[validate(length(min = 1))]
path: Option<String>,
Expand All @@ -323,7 +323,7 @@ impl TryFrom<&Secret> for crate::config::Secret {
#[derive(Validate, Serialize, Deserialize, Clone)]
struct Plugin {
#[serde(rename(serialize = "ref", deserialize = "ref"))]
#[validate(length(min = 1, max = 96), regex(path = "RE_VALID_REFERENCE"))]
#[validate(length(min = 1, max = 96), regex(path = *RE_VALID_REFERENCE))]
reference: String,
#[validate(length(min = 1))]
path: Option<String>,
Expand Down Expand Up @@ -454,7 +454,7 @@ impl From<TomlPermissions> for crate::config::Permissions {
#[derive(Validate, Serialize, Deserialize, Clone)]
struct Preset {
#[serde(rename(serialize = "ref", deserialize = "ref"))]
#[validate(length(min = 1, max = 96), regex(path = "RE_VALID_REFERENCE"))]
#[validate(length(min = 1, max = 96), regex(path = *RE_VALID_REFERENCE))]
reference: String,
#[validate(length(min = 1))]
plugins: Vec<String>,
Expand Down
Loading

0 comments on commit 7ead743

Please sign in to comment.