diff --git a/policies/dotnet/Devolutions.Now.Policy.Model.Tests/PolicyTests.cs b/policies/dotnet/Devolutions.Now.Policy.Model.Tests/PolicyTests.cs index ce0fa99..88b88d1 100644 --- a/policies/dotnet/Devolutions.Now.Policy.Model.Tests/PolicyTests.cs +++ b/policies/dotnet/Devolutions.Now.Policy.Model.Tests/PolicyTests.cs @@ -276,6 +276,7 @@ public void Unsupported_policy_format_versions_are_rejected(string value) } [Theory] + [InlineData("1.18446744073709551616.0")] [InlineData("1.0.0-01")] [InlineData("1.0.0-.")] [InlineData("1.0.0\n")] diff --git a/policies/rust/now-policy-api/openapi/now-policy-api.yaml b/policies/rust/now-policy-api/openapi/now-policy-api.yaml index cb6f555..22463a6 100644 --- a/policies/rust/now-policy-api/openapi/now-policy-api.yaml +++ b/policies/rust/now-policy-api/openapi/now-policy-api.yaml @@ -1269,7 +1269,7 @@ components: each numeric component to an unsigned 64-bit integer. type: string maxLength: 128 - pattern: ^1\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?![\s\S]) + pattern: ^1\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})(?![\s\S]) PolicyManagementResponse: description: Response body for `GET /v1/policy/management`. type: object @@ -2262,7 +2262,7 @@ components: each numeric component to an unsigned 64-bit integer. type: string maxLength: 128 - pattern: ^1\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?![\s\S]) + pattern: ^1\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})(?![\s\S]) PolicyModelPolicyMatch: description: |- Match criteria for a policy rule. All specified fields must match. diff --git a/policies/rust/now-policy/schema/devolutions.now-policy-draft.schema.json b/policies/rust/now-policy/schema/devolutions.now-policy-draft.schema.json index c011677..196da00 100644 --- a/policies/rust/now-policy/schema/devolutions.now-policy-draft.schema.json +++ b/policies/rust/now-policy/schema/devolutions.now-policy-draft.schema.json @@ -250,7 +250,7 @@ "PolicyFormatVersion": { "description": "Software-managed policy document format version.\n\n Readers accept canonical numeric versions in the compatible 1.x line.\n Applications must stamp the current value, `1.0.0`, for new documents and\n must not expose this value as publisher-authored editable metadata.\n Schemas describe the canonical shape; runtime readers additionally bound\n each numeric component to an unsigned 64-bit integer.", "maxLength": 128, - "pattern": "^1\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?![\\s\\S])", + "pattern": "^1\\.(0|[1-9][0-9]{0,18})\\.(0|[1-9][0-9]{0,18})(?![\\s\\S])", "type": "string" }, "PolicyMatch": { diff --git a/policies/rust/now-policy/schema/devolutions.now-policy.schema.json b/policies/rust/now-policy/schema/devolutions.now-policy.schema.json index fc1a12c..e5780b3 100644 --- a/policies/rust/now-policy/schema/devolutions.now-policy.schema.json +++ b/policies/rust/now-policy/schema/devolutions.now-policy.schema.json @@ -190,7 +190,7 @@ "PolicyFormatVersion": { "description": "Software-managed policy document format version.\n\n Readers accept canonical numeric versions in the compatible 1.x line.\n Applications must stamp the current value, `1.0.0`, for new documents and\n must not expose this value as publisher-authored editable metadata.\n Schemas describe the canonical shape; runtime readers additionally bound\n each numeric component to an unsigned 64-bit integer.", "maxLength": 128, - "pattern": "^1\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?![\\s\\S])", + "pattern": "^1\\.(0|[1-9][0-9]{0,18})\\.(0|[1-9][0-9]{0,18})(?![\\s\\S])", "type": "string" }, "PolicyMatch": { diff --git a/policies/rust/now-policy/src/newtypes.rs b/policies/rust/now-policy/src/newtypes.rs index 22292da..ec379eb 100644 --- a/policies/rust/now-policy/src/newtypes.rs +++ b/policies/rust/now-policy/src/newtypes.rs @@ -113,7 +113,7 @@ pub const CURRENT_POLICY_FORMAT_VERSION: &str = "1.0.0"; pub struct PolicyFormatVersion( #[schemars( length(max = 128), - regex(pattern = r"^1\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?![\s\S])") + regex(pattern = r"^1\.(0|[1-9][0-9]{0,18})\.(0|[1-9][0-9]{0,18})(?![\s\S])") )] String, );