-
Notifications
You must be signed in to change notification settings - Fork 900
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 common validate_credentials API and method for getting all provider create params #19120
Add a common validate_credentials API and method for getting all provider create params #19120
Conversation
Sample output:
And the expected payload for AWS's validate_credentials method would look like: {
"region" => "",
"endpoints" => {
"ec2" => {
"access_key" => "",
"secret_access_key" => "",
}
}
} |
0744c2f
to
2d6f0cb
Compare
2d6f0cb
to
99155de
Compare
I'm going to drop the change to |
Checked commit agrare@99155de with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@skateman @Hyperkid123 @martinpovolny can you review this and ManageIQ/manageiq-providers-amazon#551 |
I'm okay with this, but could this be used for multiple auth types in a single form? Sometimes we have multiple tabs for providers where you can set different credentials for C&U or something else. |
@skateman assuming the tab has same fields it can be used. We can add prefixes likes |
@agrare is there way to unify the field output names and the expected payload fo the validation endpoint? Frankly this does not really help us. Yes we know how many fields the validation needs but we still have to rename them (by hard coding it in UI) in order to match the expected structure in the validation endpoint. Based on the expected validation input:
the field names should look like this:
|
@Hyperkid123 the question was more towards the backend being able to handle it than the UI being able to render it... |
Since this only has one I simplified it so not need the endpoints array, but if you'd rather keep it consistent then yeah I can go back to having multiple endpoints possible here |
@agrare this is not my call, depends on what @Hyperkid123 wants for other providers where we have multiple endpoints... |
I would like to avoid having another switch cases based on provider type. I would rather have just one data structure we can just take and use it directly without additional changes everywhere. |
@Hyperkid123 done |
This changes validate_credentials_task from calling raw_connect with
different args for every provider to call a common validate_credentials
method that will be implemented for each provider.
It also adds a top-level method for retrieving each provider's
json-schema create params so that the UI can use data-driven-forms and
build the validate_credentials_task args generically rather than having
to have a case for each provider.
Related: ManageIQ/manageiq-providers-amazon#551
#18818