-
Notifications
You must be signed in to change notification settings - Fork 899
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
Remove extra authentication created when editing ems_container #9947
Remove extra authentication created when editing ems_container #9947
Conversation
@miq-bot add_label providers/containers, ui, bug @simon3z @AparnaKarve @zeari please review |
…entication Remove the extra default authentication created when creating or editing a container provider Issue ManageIQ#9946
d398615
to
02cd778
Compare
Checked commit yaacov@02cd778 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@miq-bot assign yaacov |
@@ -431,6 +431,7 @@ def build_credentials(ems, mode) | |||
ems.supports_authentication?(:bearer) && !params[:default_password].blank? | |||
creds[:hawkular] = {:auth_key => params[:default_password], :userid => "_"} | |||
creds[:bearer] = {:auth_key => params[:default_password]} | |||
creds.delete(:default) |
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 feels strange to be a UI thing...it also lends itself to breaking UI provider agnosticism. I would say that alternately we should not be creating a default auth at all if it's not used, but then again, the common practice is that default is the main connection...in this case what has been called "bearer" I believe. cc @blomquisg @durandom Thoughts?
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.
it also lends itself to breaking UI provider agnosticism
ems_common
is the opposite of provider agnostic 😁
@juliancheal is tackling this. And until we have a clean way to support stuff like this on the provider side, I am ok with adding more provider specifics in here, because its just not reasonably possible in another way 😒
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.
we should not be creating a default auth at all if it's not used
the default
authentication is created if params[:default_userid]
exists:
https://github.com/ManageIQ/manageiq/pull/9947/files#diff-f402e411cd6dc158c724b14d72ead612L399
I can add an && !ems.kind_of?(ManageIQ::Providers::ContainerManager)
in line 399, but it will not make this more pretty 😢
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.
@Fryguy I like @AparnaKarve 's idea in #9947 (comment), WDYT ?
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.
IMO the build_credentials
method needs a lot of work, of which Containers is going to be just one part.
Looking up higher in the method reveals something of a Jenga game of stacking logic.
Let's stick with how @yaacov has this for now. And, put this on the list for refactoring (cc @juliancheal, add this to your list :) )
@simon3z I switched the assignment back to you as it doesn't make sense to assign a PR to the author :) |
In #9235 It was decided that in the UI the |
@yaacov If I remember correct, in the UI (i.e. in the EMS Container form) we always displayed the word EDIT: I think by UI, you meant the summary screen. How about we change the code in line 399 to something like this, that way we do not have to delete if params[:default_userid]
default_password = params[:default_password] ? params[:default_password] : ems.authentication_password
auth_type = ems.supports_authentication?(:bearer) ? :bearer : :default
creds[auth_type] = {:userid => params[:default_userid], :password => default_password, :save => (mode != :validate)}
end |
@Fryguy the assignee field specifies on whose plate a specific issues/pr is standing. At the moment this is on Yaacov's side as he's still addressing comments. Also the agreement with @chessbyte is that once the PR is ready it should be assigned to one of you guys to be merged. The assignees are also collected by our stats scripts, so unless this is breaking the process on your side I'll keep the previous assignee until the PR is ready. @miq-bot assign yaacov |
Greg, we're ready here. Can you check if this could be accepted? Thanks. @miq-bot assign blomquisg |
@simon3z @blomquisg Darga? |
@chessbyte I'll have to discuss this with @yaacov . Maybe it will become Darga material, but I wouldn't rush this in for this release. @yaacov ping me tomorrow about this one. Thanks. |
@chessbyte I discussed this with @yaacov and we need it in darga. @miq-bot add_label darga/yes |
…ion-for-ems-containers Remove extra authentication created when editing ems_container (cherry picked from commit c036c75)
Darga backport details:
|
…iner provider. PR ManageIQ#9947 solved the removal of the extra "default" authentications only in cases where the params[:default_password] was not blank (this is not always true), this PR fixes that, and remove the extra authenication in all the cases the where the external manegment system is container manager. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1370576 https://bugzilla.redhat.com/show_bug.cgi?id=1389278
Description
Remove the extra "default" authentication created when editing a container provider.
Screenshots
An extra endpoint named "default" is created
With this fix only "bearer" and "hawkular" are created
Bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1361012
Issue
#9946