ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.97k stars 3.41k forks source link

Support all default credential types in credential forms #5879

Closed mabashian closed 4 years ago

mabashian commented 4 years ago
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:

Screen Shot 2020-02-11 at 9 51 36 AM Screen Shot 2020-02-11 at 9 52 17 AM Screen Shot 2020-02-11 at 9 53 42 AM Screen Shot 2020-02-11 at 9 54 11 AM Screen Shot 2020-02-11 at 9 54 44 AM Screen Shot 2020-02-11 at 9 55 13 AM Screen Shot 2020-02-11 at 9 56 03 AM Screen Shot 2020-02-11 at 9 57 51 AM Screen Shot 2020-02-11 at 9 58 25 AM Screen Shot 2020-02-11 at 9 59 13 AM Screen Shot 2020-02-11 at 9 59 44 AM Screen Shot 2020-02-11 at 10 00 51 AM Screen Shot 2020-02-11 at 10 01 17 AM Screen Shot 2020-02-11 at 10 01 49 AM Screen Shot 2020-02-11 at 10 02 19 AM Screen Shot 2020-02-11 at 10 02 51 AM Screen Shot 2020-02-11 at 10 03 30 AM Screen Shot 2020-02-11 at 10 04 05 AM Screen Shot 2020-02-11 at 10 04 36 AM Screen Shot 2020-02-11 at 10 05 08 AM
jakemcdermott commented 4 years ago

note: remove blocked from https://github.com/ansible/awx/issues/5880 when this is finished

mabashian commented 4 years ago

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.

mabashian commented 4 years ago

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.

appuk commented 4 years ago

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