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
API: Allow security_protocol specified during provider creation #9570
Conversation
@@ -5,7 +5,7 @@ module Providers | |||
CREDENTIALS_ATTR = "credentials" | |||
AUTH_TYPE_ATTR = "auth_type" | |||
DEFAULT_AUTH_TYPE = "default" | |||
ENDPOINT_ATTRS = %w(hostname ipaddress port) | |||
ENDPOINT_ATTRS = %w(hostname ipaddress port security_protocol).freeze |
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.
I see other attributes being delegated to Endpoint in the newer providers (app/models/providers.rb), like verify_ssl, url, pah, etc. I wonder if we shouldn't get this list from the Endpoint model, i.e. Endpoint.columns_hash.keys or something like Endpoint.supported_attributes
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.
I think the app/models/provider.rb
is not relevant here.
The problem is that Provider
and ExtManagementSystem
class each delegate different set of attributes to a default endpoint. Further, default endpoint of a Provider is just first default endpoint of any ExtManagementSystems assigned to the Provider
.
More importantly, the '/api/providers' manages only ExtManagementSystem
records. We may want to add support for Provider
records. Do we have a ticket for this in backlog somewhere?
Currently, there are only three sub-classes of the Provider
class.
$ git grep '<\s*[:]*Provider'
app/models/manageiq/providers/ansible_tower/provider.rb:class ManageIQ::Providers::AnsibleTower::Provider < ::Provider
app/models/manageiq/providers/foreman/provider.rb:class ManageIQ::Providers::Foreman::Provider < ::Provider
app/models/manageiq/providers/openstack/provider.rb:class ManageIQ::Providers::Openstack::Provider < ::Provider
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 support both types with /api/providers, see provider_class="provider" parameter. This capability was added when Foreman was being introduced.
Specs: Also ensure that the security_protocol is set. Fixing https://bugzilla.redhat.com/show_bug.cgi?id=1351253 Regression since ManageIQ#7157.
Checked commit isimluk@7731386 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
👍 we can always extend in future to have end point attrs to be provider specific. |
API: Allow security_protocol specified during provider creation (cherry picked from commit 0a5456b)
Purpose or Intent
Fix minor api regression. And write relevant spec.
Links
security_protocol
field fromExtManagementSystem
toEndpoint
(Migrate security protocol to Endpoints #7157)@miq-bot add_label api, bug, providers, darga/yes
@miq-bot assign @abellotti