Input Validation for Monitor Fields#1779
Open
vikhy-aws wants to merge 4 commits intoopensearch-project:mainfrom
Open
Input Validation for Monitor Fields#1779vikhy-aws wants to merge 4 commits intoopensearch-project:mainfrom
vikhy-aws wants to merge 4 commits intoopensearch-project:mainfrom
Conversation
… a monitor. add tests to ensure that functionality of existing monitors do not break. Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
AWSHurneyt
reviewed
Feb 6, 2025
| throw IllegalArgumentException("Illegal trigger type, ${it.javaClass.name}, for bucket level monitor") | ||
| throw IllegalArgumentException("Illegal trigger type, ${it.javaClass.name}, for bucket level monitor.") | ||
| } | ||
| if (!isValidName(it.name)) { |
Collaborator
There was a problem hiding this comment.
Discussed with @vikhy-aws offline that it would be helpful to add a validate function to the trigger interface to validate the various fields rather than adding each check here. Specific trigger types (e.g., bucket level trigger) can then override the interface's validate function as needed to accommodate their specific validation scenarios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds regex validations to monitor name, trigger name and destination id fields of a monitor. Validations are only added before creating/updating a monitor to ensure that functionality of the existing monitors do not break due to these new validation constraints. Includes tests for the same.
This PR depends on the changes in opensearch-project/common-utils#771
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.