Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public void Unsupported_policy_format_versions_are_rejected(string value)
}

[Theory]
[InlineData("1.18446744073709551616.0")]
Comment thread
CBenoit marked this conversation as resolved.
[InlineData("1.0.0-01")]
[InlineData("1.0.0-.")]
[InlineData("1.0.0\n")]
Expand Down
4 changes: 2 additions & 2 deletions policies/rust/now-policy-api/openapi/now-policy-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion policies/rust/now-policy/src/newtypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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])")
Comment thread
CBenoit marked this conversation as resolved.
)]
String,
);
Expand Down