Skip to content

Commit

Permalink
chore: updated regex to allow whitespace and removed dynamic config r…
Browse files Browse the repository at this point in the history
…egex
  • Loading branch information
sandeepdsvs committed Jan 8, 2025
1 parent d8b88d9 commit 832f99f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions src/configurations/destinations/http/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"properties": {
"to": {
"type": "string",
"pattern": "^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$"
"pattern": "^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~\\- ]{1,100}$"
},
"from": {
"type": "string",
Expand All @@ -82,7 +82,7 @@
},
"from": {
"type": "string",
"pattern": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$"
"pattern": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~\\- /\\\\]{1,100}$"
}
}
}
Expand Down Expand Up @@ -965,7 +965,7 @@
"properties": {
"username": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$"
"pattern": "^(.{0,100})$"
}
},
"required": ["username"]
Expand All @@ -984,7 +984,7 @@
"properties": {
"password": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
"pattern": "^(.{0,100})$"
}
},
"required": ["password"]
Expand All @@ -1003,7 +1003,7 @@
"properties": {
"bearerToken": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,255})$"
"pattern": "^(.{1,255})$"
}
},
"required": ["bearerToken"]
Expand All @@ -1020,9 +1020,9 @@
},
"then": {
"properties": {
"bearerToken": {
"apiKeyName": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$"
"pattern": "^(\\S{1,100})$"
}
},
"required": ["apiKeyName"]
Expand All @@ -1039,9 +1039,9 @@
},
"then": {
"properties": {
"bearerToken": {
"apiKeyValue": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$"
"pattern": "^(.{1,100})$"
}
},
"required": ["apiKeyValue"]
Expand All @@ -1060,7 +1060,7 @@
"properties": {
"maxBatchSize": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^([1-9][0-9]{0,1}|100)$"
"pattern": "^([1-9][0-9]{0,1}|100)$"
}
},
"required": ["maxBatchSize"]
Expand Down
16 changes: 8 additions & 8 deletions src/configurations/destinations/http/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"type": "textInput",
"label": "Username",
"configKey": "username",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$",
"regex": "^(.{0,100})$",
"regexErrorMessage": "Invalid Username",
"placeholder": "e.g. test username",
"preRequisites": {
Expand All @@ -66,7 +66,7 @@
"type": "textInput",
"label": "Password",
"configKey": "password",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$",
"regex": "^(.{0,100})$",
"regexErrorMessage": "Invalid Password",
"placeholder": "e.g. test password",
"secret": true,
Expand All @@ -83,7 +83,7 @@
"type": "textInput",
"label": "Token",
"configKey": "bearerToken",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,255})$",
"regex": "^(.{1,255})$",
"regexErrorMessage": "Invalid Token",
"placeholder": "e.g. test token",
"secret": true,
Expand All @@ -100,7 +100,7 @@
"type": "textInput",
"label": "Key",
"configKey": "apiKeyName",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$",
"regex": "^(\\S{1,100})$",
"regexErrorMessage": "Invalid Key Name",
"default": "x-api-key",
"preRequisites": {
Expand All @@ -116,7 +116,7 @@
"type": "textInput",
"label": "Value",
"configKey": "apiKeyValue",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$",
"regex": "^(.{1,100})$",
"regexErrorMessage": "Invalid Value",
"placeholder": "e.g. test value",
"secret": true,
Expand Down Expand Up @@ -250,7 +250,7 @@
"type": "textInput",
"label": "Maximum Batch Size",
"configKey": "maxBatchSize",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^([1-9][0-9]{0,1}|100)$",
"regex": "^([1-9][0-9]{0,1}|100)$",
"regexErrorMessage": "Invalid Batch Size",
"placeholder": "e.g. 10",
"preRequisites": {
Expand Down Expand Up @@ -514,7 +514,7 @@
"type": "textInput",
"configKey": "to",
"label": "Key",
"regex": "^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$",
"regex": "^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~\\- ]{1,100}$",
"regexErrorMessage": "JSON path is not supported. Please enter a constant",
"placeholder": "e.g: customerId"
},
Expand Down Expand Up @@ -552,7 +552,7 @@
"type": "textInput",
"configKey": "from",
"label": "Value",
"regex": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$",
"regex": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~\\- /\\\\]{1,100}$",
"regexErrorMessage": "Please enter a valid JSON path or a constant",
"placeholder": "e.g. application/json"
}
Expand Down
2 changes: 1 addition & 1 deletion test/data/validation/destinations/http.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"result": false,
"err": [
"maxBatchSize must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^([1-9][0-9]{0,1}|100)$\"",
"maxBatchSize must match pattern \"^([1-9][0-9]{0,1}|100)$\"",
" must match \"then\" schema"
]
},
Expand Down

0 comments on commit 832f99f

Please sign in to comment.