-
Notifications
You must be signed in to change notification settings - Fork 897
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
Add validate_blacklist method for VM pre-provisioning #15513
Conversation
Checked commit https://github.com/djberg96/manageiq/commit/b9c9a7bdd8e2d8e7e8e1decfaba058cd88004b77 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 spec/models/miq_request_workflow_spec.rb
|
@gmcculloug @blomquisg @h-kataria Look ok? |
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
Looks good. The one thing I wanted to mention is that we should always make these types of validations optional so the user can modify the dialog to allow special characters since the dialog is just collecting the initial name to use and it can be modified before passing to the provider. For example, adding the sequence We are going with the 80/20 rule here as most users would not be entering special characters at dialog ordering time. The one exception would likely be an admin setting up a Catalog Item in which case they would have more knowledge of the back-end customizations. |
@miq-bot add_label fine/yes |
Add validate_blacklist method for VM pre-provisioning (cherry picked from commit 34cab60) https://bugzilla.redhat.com/show_bug.cgi?id=1478563
Fine backport details:
|
Add validate_blacklist method for VM pre-provisioning (cherry picked from commit 34cab60) https://bugzilla.redhat.com/show_bug.cgi?id=1478563
This modifies the
MiqRequestWorkflow::DialogFieldValidation
module by adding avalidate_blacklist
method that provisioning templates can then hook into.Specifically, this is needed for Azure (though possibly other providers) which have special blacklists for VM usernames and passwords that would pass a regex check but are not considered valid by Microsoft. For example, you cannot use "abc@123" as a password for Azure VM's, even though that would normally pass a validity check.
These lists are too long to be put into a regex validation directly. It simply isn't practical, so I believe a separate method is necessary.
For more information please see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/faq
Partially solves https://bugzilla.redhat.com/show_bug.cgi?id=1454829. The other half will happen on the Azure provider side.