Closed mabashian closed 4 years ago
note: remove blocked from https://github.com/ansible/awx/issues/5880 when this is finished
After #5274 and #5275 are done we want to transition away from building static subforms for credentials since we'll need to support both default and custom credential types. Custom credential types must be generated based on the response from /api/v2/credential_types/:id
. Inside that response there is an inputs
key that looks something like:
"inputs": {
"fields": [
{
"id": "username",
"type": "string",
"label": "Username"
},
{
"id": "password",
"type": "string",
"label": "Password",
"secret": true
}
],
"required": [
"username",
"password"
]
},
Based on this JSON blob, we'll need to generate fields for the form. Instead of having the default credential types (machine, aws, gce, etc) be defined statically, all of the credential forms should be generated dynamically by inspecting the response from the aforementioned request.
I'm going to work on the GCE portion of the form first. After that we'll probably want to focus on supporting the credential plugins before moving on to some sort of dynamic generator.
verified the GCE portion of the form along with field validation associated with it, everything works as expected 👍 hence removing the issue from needs_test and moving to needs_devel for other credential types
SUMMARY
https://github.com/ansible/awx/issues/5274 and https://github.com/ansible/awx/issues/5275 are covering adding support for machine and scm credential types.
Feel free to break this work up into pieces. Some of these subforms are more complicated than others
As noted in #5274 the intention at this time is to ignore credential plugin support (lookups on many of the fields). That work will come later. This issue is meant to track adding support for the rest of the default credential types: