-
Notifications
You must be signed in to change notification settings - Fork 31
Improve server side input validation #128
Improve server side input validation #128
Conversation
@@ -63,7 +63,7 @@ export const addReportsTableContent = (data) => { | |||
//TODO: wrong name | |||
timeCreated: report.time_created, | |||
state: report.state, | |||
url: report.query_url, | |||
url: `${location.host}${report.query_url}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does location.host
add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the query_url
is now relative, need to add the host as well for the link rendered in report table -> report source field to be accessible.
@@ -27,32 +29,56 @@ import { | |||
} from '../routes/utils/constants'; | |||
|
|||
export const dataReportSchema = schema.object({ | |||
base_url: schema.uri(), | |||
base_url: schema.string({ | |||
validate(value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the validation fails will this still return an error to the client-side and trigger the error toasts in the UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will, it will also include the error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM- just have some minor questions
Issue #, if available:
#90
Description of changes:
url: pass relative url instead of full url, compose url on server side wiht
localhost:5601
text fields: validate non-empty.
report Name
: validate allowed characters using regexemail recipients
: validate email address formattimestamp fields: validate positive number
cron-expression: validate unix cron-expression (5 digits)
time duration: validate ISO format for time duration. e.g.
PT10M
(10 mintues)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.