ansible / ansible-ui

The UIs for Ansible Projects such as AWX, EDA, and HUB.
https://ansible.github.io/ansible-ui/
Apache License 2.0
75 stars 65 forks source link

Custom credential source without metadata test fails #3075

Open minsis opened 4 weeks ago

minsis commented 4 weeks ago

I've created a custom credential type which is loaded into AWX just fine. It has no metadata associated with it since I don't need to specify any kind of identifier to return data. In the AWX UI when clicking the "test" button it fails with an error.

image

Full text:

TypeError: undefined is not an object (evaluating 'r.inputs.metadata.reduce')
P1@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:2168142
ao@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:851392
Ks@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:903737
Al@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:890983
Tl@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:890911
El@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:890774
yl@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:887740
@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:837184
@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:933490
Ki@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:837130
Wi@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:837065
Le@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:908276
Yt@http://127.0.0.1:49287/static/js/main.fcec0bf3.js:2:815676

My inputs:

github_app_inputs = {
    "fields": [
        {"id": "app_id", "label": "Application ID", "type": "string", "required": True},
        {"id": "installation_id", "label": "Installation ID", "type": "integer", "required": True},
        {"id": "private_key", "label": "Private Key", "type": "string", 'multiline': True, "required": True, "secret": True},
        {"id": "jwt_expiry", "label": "JWT Token Expiry (sec)", "type": "integer", "default": 600},
    ],
    "required": ["app_id", "installation_id", "private_key"],
}
minsis commented 4 weeks ago

If I provide an empty metadata it the "test" button works now.