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 button for re-checking authentication status for providers #8912
Conversation
/cc @Ladas @juliancheal |
@miq-bot add_label wip,ui,providers |
@@ -273,6 +273,27 @@ def authentication_check(*args) | |||
return status == :valid, details | |||
end | |||
|
|||
def authentication_check_queue(*args) |
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.
Can you use the nearly identical authentication_check_types_queue
?
It's what we call from the schedule worker on a schedule for each model that includes the authentication mixin.
manageiq/app/models/mixins/authentication_mixin.rb
Lines 10 to 13 in fa42171
zone = MiqServer.my_server.zone | |
assoc = name.tableize | |
assocs = zone.respond_to?(assoc) ? zone.send(assoc) : [] | |
assocs.each(&:authentication_check_types_queue) |
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.
If there's something you can't do, please provide a test or script demonstrating what's missing and I'll try to fix the code to do what you want.
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.
@jrafanie authentication_check_types_queue
works just as great! Thanks for pointing me to this method.
However, the only thing that needs to happen before we can use this method is to make sure that ems types that have authentication types other than default
should have this method available - authentications_to_validate
.
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.
Good point @AparnaKarve.
The concept was that classes could dictate what authentication types it used to authenticate via authentications_to_validate
.
Another way is to pass the types, see here. If you don't specify the types, then use authentications_to_validate
will be used.
2527a5b
to
9482367
Compare
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
4ca4f75
to
8934bc5
Compare
@AparnaKarve hm one question, does this recheck authentication of all attached endpoints? E.g. for OpenStack you can have default and events endpoint there, while only amqp can be rechecked If ^ is working, it looks good to me, though I don't have a space to actually try this now. |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@Ladas It rechecks authentications of all attached endpoints. For e.g - There could be a situation where an OpenStack provider has both So just to clarify the above, you cannot "cherry-pick" (for the lack of a better word) what authentication type to recheck. Does that sound OK to you? |
@AparnaKarve yeah, that sounds good. In that case looks 👍 to me :-) |
8934bc5
to
65adf04
Compare
Checked commits AparnaKarve/manageiq@08bb4cb~...d3d58a4 with ruby 2.2.4, rubocop 0.37.2, and haml-lint 0.16.1 app/controllers/ems_common.rb
app/helpers/application_helper/toolbar/ems_cloud_center.rb
app/helpers/application_helper/toolbar/ems_container_center.rb
app/helpers/application_helper/toolbar/ems_infra_center.rb
|
@miq-bot remove_label wip |
def skip? | ||
!@record.is_available?(:authentication_status) | ||
end | ||
end |
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.
You don't need to create several classes with the same code.
If the behavior you need here just checks for auth status on the record, you can just create 1 class for that and share the class for all the buttons
Add a button for re-checking authentication status for providers (cherry picked from commit 027cf91)
@AparnaKarve middleware provider seems out of scope for this feature and PR - any reason why? |
@abonas The main reason would be this feature was targeted for Darga. |
thanks @AparnaKarve , it can definitely be a separate PR. |
Addresses a part of #8643.
While the other major UI changes mentioned in #8643 for the ems editors are still underway, we can move forward with this particular change which basically adds a
Re-check Authentication
button in the EMS Summary screen to update the Authentication status.