-
Notifications
You must be signed in to change notification settings - Fork 36
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 params_for_create and verify_credentials #46
Add params_for_create and verify_credentials #46
Conversation
# } | ||
# } | ||
def self.verify_credentials(args) | ||
raw_connect(*args.dig("endpoints", "default")&.values_at("base_url", "username", "password", "verify_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.
Needs to return boolean.
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 is verify_ssl supposed to be boolean or one of OpenSSL::VERIFY_*?
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, also...needs to try_decrypt the password. I've noticed in other providers that's done in the raw_connect method itself, which seems like a nicer place since it allows decrypting from other entrypoints as well.
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.
Yup, was in WIP until I got it to verify the connection not just return it even if everything was wrong.
Addressed all of those PTAL
6faaec1
to
c3bf25a
Compare
2e92c5b
to
2524116
Compare
@@ -25,13 +25,66 @@ class ManageIQ::Providers::Foreman::Provider < ::Provider | |||
validates :name, :presence => true, :uniqueness => true | |||
validates :url, :presence => true | |||
|
|||
def self.params_for_create | |||
@params_for_create ||= { | |||
:title => "Configure AWS", |
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.
Typo AWS
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.
🤦♂️ thanks, fixed
2524116
to
60ee1cf
Compare
@@ -25,13 +25,66 @@ class ManageIQ::Providers::Foreman::Provider < ::Provider | |||
validates :name, :presence => true, :uniqueness => true | |||
validates :url, :presence => true | |||
|
|||
def self.params_for_create | |||
@params_for_create ||= { | |||
:title => "Configure Foreman", |
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.
So, downstream we rename this to Satellite via monkey patching the description method, so this needs to use description, I think.
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.
Okay there's no description on the provider class so I'll add one, but we'll have to update the downstream monkeypatching to include the 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.
Done
Add a method to return the needed parameters to add a foreman provider and a method to verify credentials with these parametes.
60ee1cf
to
13ed808
Compare
Checked commit agrare@13ed808 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Merging...can you do the downstream patching? |
Yes will have an MR in shortly |
Add a method to return the needed parameters to add a foreman provider
and a method to verify credentials with these parametes.
ManageIQ/manageiq#18818