-
Notifications
You must be signed in to change notification settings - Fork 357
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 a new "Endpoint URL" field in AWS endpoints #3958
Add a new "Endpoint URL" field in AWS endpoints #3958
Conversation
bdcd0d0
to
00afdd6
Compare
👍 |
@djberg96 There is an unrelated JS spec failure on travis currently - should be resolved soon hopefully. |
@@ -128,7 +128,8 @@ def get_task_args(ems) | |||
connect_opts = [MiqPassword.encrypt(params[:amqp_password]), params.to_hash.symbolize_keys.slice(*OPENSTACK_AMQP_PARAMS)] if params[:cred_type] == "amqp" | |||
connect_opts | |||
when 'ManageIQ::Providers::Amazon::CloudManager' | |||
[user, password, :EC2, params[:provider_region], ems.http_proxy_uri, true] | |||
uri = URI.parse(params[:default_url]) |
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.
incoming params should be escaped for safety
http://devdocs.io/ruby~2.3/uri#method-c-parse:
It's recommended to first ::escape the provided uri_str if there are any invalid URI characters.
http://devdocs.io/ruby~2.3/uri/escape#method-i-escape
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.
Related comment here: ManageIQ/manageiq-providers-amazon#444 (comment) (need to decide where escaping should be made)
@@ -648,6 +650,11 @@ def set_ems_record_vars(ems, mode = nil) | |||
default_endpoint = {:role => :default, :hostname => hostname, :port => port} | |||
end | |||
|
|||
if ems.kind_of?(ManageIQ::Providers::Amazon::CloudManager) | |||
uri = URI.parse(params[:default_url]) |
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.
see above about escaping
a62d85c
to
0e81618
Compare
@AlexanderZagaynov @djberg96 and I were discussing if we need to escape at all... Keeping |
I believe
|
Also:
URI.parse(WEBrick::HTTPUtils.escape 'http://example.com/abc|def?xyz 123?#$').tap do |uri|
ap uri.component.map { |component| [component, uri.public_send(component)] }.to_h
end =>
|
@alexander-demichev @AparnaKarve On second thought, let's just stick with the standard URI library since Addressable isn't in our Gemfile. I realize there are some edge cases that might break it, but I doubt you'll ever see them in practice. If someone does break it (other than QE), then we'll deal with it later. |
@AparnaKarve nope, actually, that's fine. |
@AparnaKarve I vote to ignore the rubocop warning for now. Any of the options that @AlexanderZagaynov mentioned will require an explicit |
@djberg96 I have no issues ignoring rubocop for now. Just one question to you and @AlexanderZagaynov - what do you think about |
@AparnaKarve check examples above, you'll see the result of each option. |
|
@AlexanderZagaynov Thanks. |
0e81618
to
2b26a12
Compare
2b26a12
to
9852eb2
Compare
Checked commits AparnaKarve/manageiq-ui-classic@862788a~...9852eb2 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 **
|
Changed the |
LGTM 👍 |
👍 |
Added a new
Endpoint URL
optional field in AWS endpoints as shown in the screenshot.Depends on ManageIQ/manageiq-providers-amazon#444
Fixes #3907