-
Notifications
You must be signed in to change notification settings - Fork 43
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
Validate rule guidance
strictly.
#4304
Conversation
c3f6b52
to
1ff34d3
Compare
Note: this might be overly strict in that characters like I'll put this back to draft and verify what options we have. |
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.
Good idea
this validation probably merits adding unit tests |
1ff34d3
to
b4e86de
Compare
9b6fd1a
to
7104864
Compare
82fa702
to
6509b96
Compare
This change uses `bluemonday` library to perform strict validation of `guidance` field of rule types. In case sanitized input is different from the input itself, rule type creation/update is rejected returning a meaningful error message. The way input is sanitized is in line with the way it is rendered in the CLI by the `glamour` library.
6509b96
to
afcff20
Compare
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.
Love the focus on input validation. Thanks for doing this!
Summary
This change uses
bluemonday
library to perform strict validation ofguidance
field of rule types. In case sanitized input is different from the input itself, rule type creation/update is rejected returning a meaningful error message.The way input is sanitized is in line with the way it is rendered in the CLI by the
glamour
library.Change Type
Mark the type of change your PR introduces:
Testing
Manual tests.
Review Checklist: