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

Fixes #23587: Add checks annd validation on parameter name #5105

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche VinceMacBuche commented Oct 17, 2023

@@ -62,26 +63,38 @@ techniqueParameter model technique param opened =
( "Parameter cannot be empty and needs a value.\nIf you add a parameter to an existing technique, policy generation will fail and you will need to update all directives with the new parameter value"
, "btn-info"
)
(invalidParamClass, invalidParamElem) =
if (Regex.contains ((Regex.fromString >> Maybe.withDefault Regex.never) "[^_a-zA-Z\\d]") param.name) then
("error", ul [class "row"] [ li [ class "text-danger col-sm-8" ] [ text "Invalid variable name is required, valid characters are [_a-zA-Z\\d]" ] ] )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you write it in a nicer way ?
Like "The variable name is invalid, only alphanumerical characters and _ are accepted" ?

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/5105
-- Your faithful QA
Kant merge: "It is beyond a doubt that all our knowledge begins with experience."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/74858/console)

@amousset
Copy link
Member

OK, squash merging this PR

@amousset amousset merged commit 638f170 into Normation:branches/rudder/8.0 Oct 17, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants