Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve validation of (expression) multi-line text fields #2548

Merged
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 @@ -369,7 +369,7 @@
},
"constraints": {
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "Priority must be integer value"
},
"notEmpty": false
Expand Down Expand Up @@ -431,7 +431,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "Must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "Must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
6 changes: 3 additions & 3 deletions connectors/github/element-templates/github-connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^(=.+|refs\\/[^\\/]+\\/[^\\/]*)",
"value": "^(=|refs\\/[^\\/]+\\/[^\\/]*)",
"message": "must be a fully qualified reference (i.e: refs/heads/main) starting with \"refs\" and containing at least two slashes."
}
},
Expand All @@ -1946,7 +1946,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^(=.+|.{40})",
"value": "^(=|.{40})",
"message": "must consist of 40 characters."
}
},
Expand Down Expand Up @@ -2738,7 +2738,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "must be a timeout in seconds (default value is 20 seconds) or a FEEL expression."
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^(=|https?://|\\{\\{secrets\\..+\\}\\}).*$",
"value": "^(=|(https?://|\\{\\{secrets\\..+\\}\\}).*$)",
"message": "Must be a http(s) URL"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "Must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down Expand Up @@ -343,7 +343,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down Expand Up @@ -348,7 +348,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public record GraphQL(
@FEEL
@NotBlank
@Pattern(
regexp = "^(=|http://|https://|secrets|\\{\\{).*$",
regexp = "^(=|(http://|https://|secrets|\\{\\{).*$)",
message = "Must be a http(s) URL")
@TemplateProperty(id = "url", group = "endpoint", label = "URL")
String url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public record OAuthAuthentication(
@FEEL
@NotEmpty
@Pattern(
regexp = "^(=|http://|https://|secrets|\\{\\{).*$",
regexp = "^(=|(http://|https://|secrets|\\{\\{).*$)",
message = "Must be a http(s) URL")
@TemplateProperty(
group = "authentication",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class HttpCommonRequest {

@FEEL
@NotBlank
@Pattern(regexp = "^(=|http://|https://|secrets|\\{\\{).*$", message = "Must be a http(s) URL")
@Pattern(regexp = "^(=|(http://|https://|secrets|\\{\\{).*$)", message = "Must be a http(s) URL")
@TemplateProperty(group = "endpoint", label = "URL")
private String url;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^(=|https?://|secrets\\..+|\\{\\{secrets\\..+\\}\\}).*$",
"value": "^(=|(https?://|secrets\\..+|\\{\\{secrets\\..+\\}\\}).*$)",
"message": "must be a http(s) URL"
}
}
Expand Down Expand Up @@ -440,7 +440,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|secrets\\..+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|secrets\\..+|\\{\\{secrets\\..+\\}\\})$)",
"message": "must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^(=|https?://|secrets\\..+|\\{\\{secrets\\..+\\}\\}).*$",
"value": "^(=|(https?://|secrets\\..+|\\{\\{secrets\\..+\\}\\}).*$)",
"message": "must be a http(s) URL"
}
}
Expand Down Expand Up @@ -441,7 +441,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|secrets\\..+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|secrets\\..+|\\{\\{secrets\\..+\\}\\})$)",
"message": "must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down Expand Up @@ -352,7 +352,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down Expand Up @@ -357,7 +357,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|http://|https://|secrets|\\{\\{).*$",
"value" : "^(=|(http://|https://|secrets|\\{\\{).*$)",
"message" : "Must be a http(s) URL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "must be a timeout in seconds (default value is 30 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|jdbc:|secrets|\\{\\{).*$",
"value" : "^(=|(jdbc:|secrets|\\{\\{).*$)",
"message" : "Must start with 'jdbc:' or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|jdbc:|secrets|\\{\\{).*$",
"value" : "^(=|(jdbc:|secrets|\\{\\{).*$)",
"message" : "Must start with 'jdbc:' or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public record UriConnection(
@NotBlank
@Pattern(
regexp = "^(=|jdbc:|secrets|\\{\\{).*$",
regexp = "^(=|(jdbc:|secrets|\\{\\{).*$)",
message = "Must start with 'jdbc:' or contain a secret reference")
@TemplateProperty(
group = "connection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "must be a timeout in seconds (default value is 30 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|\\{\\{secrets\\..+\\}\\})$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "Must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|amqps?://|secrets|\\{\\{).*$",
"value" : "^(=|(amqps?://|secrets|\\{\\{).*$)",
"message" : "Must start with amqp(s):// or contain a secret reference"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public record UriAuthentication(
@NotBlank
@Pattern(
regexp = "^(=|amqps?://|secrets|\\{\\{).*$",
regexp = "^(=|(amqps?://|secrets|\\{\\{).*$)",
Oleksiivanov marked this conversation as resolved.
Show resolved Hide resolved
message = "Must start with amqp(s):// or contain a secret reference")
@TemplateProperty(
group = "authentication",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^(=|https?://|\\{\\{secrets\\..+\\}\\}).*$",
"value": "^(=|(https?://|\\{\\{secrets\\..+\\}\\}).*$)",
"message": "Must be a http(s) URL."
}
}
Expand Down Expand Up @@ -442,7 +442,7 @@
"constraints": {
"notEmpty": false,
"pattern": {
"value": "^(=.+|[0-9]+|secrets\\..+)$",
"value": "^(=|([0-9]+|\\{\\{secrets\\..+\\}\\})$)",
"message": "Must be a timeout in seconds (default value is 20 seconds) or a FEEL expression"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|[-_a-z0-9]{1,80}$)",
"value" : "^(=|([-_a-z0-9]{1,80}$))",
"message" : "May contain up to 80 lowercase letters, digits, underscores, and dashes"
}
},
Expand Down Expand Up @@ -240,7 +240,7 @@
"constraints" : {
"notEmpty" : true,
"pattern" : {
"value" : "^(=|[-_a-z0-9]{1,80}$)",
"value" : "^(=|([-_a-z0-9]{1,80}$))",
"message" : "May contain up to 80 lowercase letters, digits, underscores, and dashes"
}
},
Expand Down
Loading