-
Notifications
You must be signed in to change notification settings - Fork 358
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
Hawkular/add ssl support #460
Hawkular/add ssl support #460
Conversation
@josejulio Cannot apply the following label because they are not recognized: providers/hawkular |
@cben I modified some of your work, could you please take a look and let me know if I should duplicate the code or is OK what i did? |
def container_security_options(security_protocol, certificate_authority) | ||
{ | ||
:security_protocol => security_protocol, | ||
:verify_ssl => %w(ssl-without-validation non-ssl).exclude?(security_protocol), |
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.
@cben
Added non-ssl
to the options that shouldn't be verified by ssl.
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.
Nice. Not all providers will use same logic, but good to share.
Let's rename the function to something more generic, say endpoint_security_options
?
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.
Sure. Will do once your PR is merged. (adding it as a todo).
%div{"ng-if" => defined?(tls_ca_certs_hide) ? false : true} | ||
.form-group{"ng-if"=> "emsCommonModel.emstype == 'rhevm' || " + | | ||
"((emsCommonModel.ems_controller == 'ems_container' || " + | | ||
"emsCommonModel.emstype == 'hawkular') && " + | |
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.
Also using this Trusted CA Certificates
textarea.
@miq-bot add-label WIP |
@@ -143,7 +153,8 @@ | |||
|
|||
%div{"ng-if" => defined?(tls_ca_certs_hide) ? false : true} | |||
.form-group{"ng-if"=> "emsCommonModel.emstype == 'rhevm' || " + | | |||
"(emsCommonModel.ems_controller == 'ems_container' && " + | | |||
"((emsCommonModel.ems_controller == 'ems_container' || " + | | |||
"emsCommonModel.emstype == 'hawkular') && " + | |
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.
This is perhaps too nested, hard to read.
One option that might be more readable if you put the custom condition first (untested):
"(emsCommonModel.#{prefix}_security_protocol == 'ssl-with-validation-custom-ca' &&" |
" (emsCommonModel.ems_controller == 'ems_container' || " + |
" emsCommonModel.emstype == 'hawkular'))"} |
However the meaning of security_protocol is provider-dependent and this file already does a lot of copy-pasting to keep different providers independent.
What do you think of doing separate (container && custom) || (hawkular && custom)?
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.
Grouping them different seems a good option that would give more flexibility to modify them as needed for each provider without having to copy/paste the whole block.
25af1c1
to
eed3141
Compare
@miq-bot add_label middleware, wip, pending core |
eed3141
to
4d6ad1f
Compare
This pull request is not mergeable. Please rebase and repush. |
4d6ad1f
to
b6d0c9d
Compare
b6d0c9d
to
b8d8736
Compare
@miq-bot rm_label wip |
Wouldn't it be better to first put the protocol field, and then after the user selects it, to fill automatically the default port? (which user can of course change) |
I think some providers do reset port based on security protocol: manageiq-ui-classic/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js Lines 360 to 368 in d304589
in which case yes, having protocol above port makes sense. Don't assume #450 is perfect. I missed several spots there, and still chasing a bug there. Will cc you as soon I have a fix. |
If that makes sense for both of you, I'll move the port below the security protocol and fill default values. |
@serenamarie125 and @Loicavenel , please have a look at the UX issue in regards of fields order for protocol, port, etc. Current way of things don't make a lot of sense (and causes a bit more work for the user). Please decide how it should look in all the providers. |
We should at minimum reverse Port and Protocol where it does exist. Some providers does not have Port but use URL as input. If protocols has different port, then default port should be presented and updated baed on the protocol selection |
@abonas @Loicavenel
Currently (on this provider) the Port is only updated (when selecting a protocol) IF port is empty OR port is any of the default ports OR port is invalid (e.g. NaN). |
Since order is shared to all providers, I think separate PR is natural.
P.S. another order you haven't listed is put protocol even before hostname.
(Kinda like proto://host:port URL structure.)
|
That would be the third option! I'll edit #460 (comment) |
@AparnaKarve Updated code so Trusted CA Certificates now affects required validation. Next steps would be: Is there anything else you want me to address on this PR? |
@josejulio Good call on that. Agree about addressing the other issues you mentioned in separate PRs. |
@AparnaKarve wait a bit. I think i missed something. |
8efed47
to
1a2d639
Compare
@AparnaKarve Ok, done, I had an extra ´}´ on the last commit. Just removed it. |
Checked commits josejulio/manageiq-ui-classic@03a478a~...1a2d639 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
1a2d639
to
7413410
Compare
Ummh, @AparnaKarve, #670 also address the Trusted CA certificates, so I'm removing it from this PR because is the same code. |
@josejulio @cben please see @Loicavenel guideline regarding the protocol/port order, it could be applied in this PR or in a separate one, although I don't see much point doing it here in the incorrect way and then redoing it again in another PR. |
@josejulio #670 has some code that you would need to fix this completely, so how about we wait for #670 to get merged first? (which I'm currently reviewing) Once it's merged, it will be easy for you to identify what else needs to be fixed from your end. |
@AparnaKarve Sure: I can wait for it. @abonas We are sharing the security_protocol with others providers. I just want to make sure I don't break anything from their end. By doing a separate PR i could at least try to have them look at only that fix. |
@josejulio The screenshot looks good. So looks like you're all set now. |
LGTM 👍 |
@miq-bot assign @martinpovolny please review & merge |
@abonas 'martinpovolny please review & merge' is an invalid assignee, ignoring... |
@miq-bot assign @martinpovolny |
Adds support for tls endpoints on Hawkular MW provider
ToDo:
container_security_options
toendpoint_security_options
This PR
depends on PR #450 andsupports ManageIQ/manageiq#14054@miq-bot add-label providers/hawkular