We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Access to all keys out of the CyberArk object
### Please confirm the following

- [X] I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.
- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.

### Feature type

Enhancement to Existing Feature

### Feature Summary

https://issues.redhat.com/browse/AAPRFE-28

We want to pull all the Keys out of the CyberArk object instead of just the content key or the content value. When we run the API call from the playbook, CyberArk presents all the keys and values associated with that object. We can set the fact and use the keys and values as variables in the playbook. But when we use the custom credential it only gives us the content value and does not give us any other keys and values. We want to be able to use custom credential to pull all the keys and values associated with an object and assigned into variables in AAP natively using the credential plugin.

This feature request is for changes to the credential lookup plugin as used in AAP2.

### Select the relevant components

- [X] UI
- [ ] API
- [ ] Docs
- [ ] Collection
- [ ] CLI
- [ ] Other

### Steps to reproduce

1. Configure a credential using the credential type "CyberArk Central Credential Provider Lookup".
2. Only "Content" key value from JSON response is returned.  "Content" is the password value of the account object.

### Current results

The credential plugin "CyberArk Central Credential Provider Lookup" is hardcoded to only return the "Content" key value from a JSON response that includes more keys that could be utilized.

### Sugested feature result

The suggested feature would include an additional field in the metadata of the credential plugin to allow the user to specify a different key value to utilize outside of the "Content" which should still remain as the default key.

### Additional information

Spoke with Oleksii Baranov on 01-05-2023 about how to include this feature.  Being developed by CyberArk's @infamousjoeg.  PR to come shortly.

For more information, please reference the Issue at https://issues.redhat.com/browse/AAPRFE-28.
Access to all keys out of the CyberArk object
### Please confirm the following

- [X] I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.
- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.

### Feature type

Enhancement to Existing Feature

### Feature Summary

https://issues.redhat.com/browse/AAPRFE-28

We want to pull all the Keys out of the CyberArk object instead of just the content key or the content value. When we run the API call from the playbook, CyberArk presents all the keys and values associated with that object. We can set the fact and use the keys and values as variables in the playbook. But when we use the custom credential it only gives us the content value and does not give us any other keys and values. We want to be able to use custom credential to pull all the keys and values associated with an object and assigned into variables in AAP natively using the credential plugin.

This feature request is for changes to the credential lookup plugin as used in AAP2.

### Select the relevant components

- [X] UI
- [ ] API
- [ ] Docs
- [ ] Collection
- [ ] CLI
- [ ] Other

### Steps to reproduce

1. Configure a credential using the credential type "CyberArk Central Credential Provider Lookup".
2. Only "Content" key value from JSON response is returned.  "Content" is the password value of the account object.

### Current results

The credential plugin "CyberArk Central Credential Provider Lookup" is hardcoded to only return the "Content" key value from a JSON response that includes more keys that could be utilized.

### Sugested feature result

The suggested feature would include an additional field in the metadata of the credential plugin to allow the user to specify a different key value to utilize outside of the "Content" which should still remain as the default key.

### Additional information

Spoke with Oleksii Baranov on 01-05-2023 about how to include this feature.  Being developed by CyberArk's @infamousjoeg.  PR to come shortly.

For more information, please reference the Issue at https://issues.redhat.com/browse/AAPRFE-28.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `awx/main/credential_plugins/aim.py`
Content:
```
1 from .plugin import CredentialPlugin, CertFiles, raise_for_status
2 
3 from urllib.parse import quote, urlencode, urljoin
4 
5 from django.utils.translation import gettext_lazy as _
6 import requests
7 
8 aim_inputs = {
9     'fields': [
10         {
11             'id': 'url',
12             'label': _('CyberArk CCP URL'),
13             'type': 'string',
14             'format': 'url',
15         },
16         {
17             'id': 'webservice_id',
18             'label': _('Web Service ID'),
19             'type': 'string',
20             'help_text': _('The CCP Web Service ID. Leave blank to default to AIMWebService.'),
21         },
22         {
23             'id': 'app_id',
24             'label': _('Application ID'),
25             'type': 'string',
26             'secret': True,
27         },
28         {
29             'id': 'client_key',
30             'label': _('Client Key'),
31             'type': 'string',
32             'secret': True,
33             'multiline': True,
34         },
35         {
36             'id': 'client_cert',
37             'label': _('Client Certificate'),
38             'type': 'string',
39             'secret': True,
40             'multiline': True,
41         },
42         {
43             'id': 'verify',
44             'label': _('Verify SSL Certificates'),
45             'type': 'boolean',
46             'default': True,
47         },
48     ],
49     'metadata': [
50         {
51             'id': 'object_query',
52             'label': _('Object Query'),
53             'type': 'string',
54             'help_text': _('Lookup query for the object. Ex: Safe=TestSafe;Object=testAccountName123'),
55         },
56         {'id': 'object_query_format', 'label': _('Object Query Format'), 'type': 'string', 'default': 'Exact', 'choices': ['Exact', 'Regexp']},
57         {
58             'id': 'reason',
59             'label': _('Reason'),
60             'type': 'string',
61             'help_text': _('Object request reason. This is only needed if it is required by the object\'s policy.'),
62         },
63     ],
64     'required': ['url', 'app_id', 'object_query'],
65 }
66 
67 
68 def aim_backend(**kwargs):
69     url = kwargs['url']
70     client_cert = kwargs.get('client_cert', None)
71     client_key = kwargs.get('client_key', None)
72     verify = kwargs['verify']
73     webservice_id = kwargs['webservice_id']
74     app_id = kwargs['app_id']
75     object_query = kwargs['object_query']
76     object_query_format = kwargs['object_query_format']
77     reason = kwargs.get('reason', None)
78     if webservice_id == '':
79         webservice_id = 'AIMWebService'
80 
81     query_params = {
82         'AppId': app_id,
83         'Query': object_query,
84         'QueryFormat': object_query_format,
85     }
86     if reason:
87         query_params['reason'] = reason
88 
89     request_qs = '?' + urlencode(query_params, quote_via=quote)
90     request_url = urljoin(url, '/'.join([webservice_id, 'api', 'Accounts']))
91 
92     with CertFiles(client_cert, client_key) as cert:
93         res = requests.get(
94             request_url + request_qs,
95             timeout=30,
96             cert=cert,
97             verify=verify,
98             allow_redirects=False,
99         )
100     raise_for_status(res)
101     return res.json()['Content']
102 
103 
104 aim_plugin = CredentialPlugin('CyberArk Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend)
105
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/awx/main/credential_plugins/aim.py b/awx/main/credential_plugins/aim.py
--- a/awx/main/credential_plugins/aim.py
+++ b/awx/main/credential_plugins/aim.py
@@ -54,6 +54,12 @@
             'help_text': _('Lookup query for the object. Ex: Safe=TestSafe;Object=testAccountName123'),
         },
         {'id': 'object_query_format', 'label': _('Object Query Format'), 'type': 'string', 'default': 'Exact', 'choices': ['Exact', 'Regexp']},
+        {
+            'id': 'object_property',
+            'label': _('Object Property'),
+            'type': 'string',
+            'help_text': _('The property of the object to return. Default: Content Ex: Username, Address, etc.'),
+        },
         {
             'id': 'reason',
             'label': _('Reason'),
@@ -74,6 +80,7 @@
     app_id = kwargs['app_id']
     object_query = kwargs['object_query']
     object_query_format = kwargs['object_query_format']
+    object_property = kwargs.get('object_property', '')
     reason = kwargs.get('reason', None)
     if webservice_id == '':
         webservice_id = 'AIMWebService'
@@ -98,7 +105,18 @@
             allow_redirects=False,
         )
     raise_for_status(res)
-    return res.json()['Content']
+    # CCP returns the property name capitalized, username is camel case
+    # so we need to handle that case
+    if object_property == '':
+        object_property = 'Content'
+    elif object_property.lower() == 'username':
+        object_property = 'UserName'
+    elif object_property not in res:
+        raise KeyError('Property {} not found in object'.format(object_property))
+    else:
+        object_property = object_property.capitalize()
+
+    return res.json()[object_property]
 
 
 aim_plugin = CredentialPlugin('CyberArk Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend)

{"golden_diff": "diff --git a/awx/main/credential_plugins/aim.py b/awx/main/credential_plugins/aim.py\n--- a/awx/main/credential_plugins/aim.py\n+++ b/awx/main/credential_plugins/aim.py\n@@ -54,6 +54,12 @@\n             'help_text': _('Lookup query for the object. Ex: Safe=TestSafe;Object=testAccountName123'),\n         },\n         {'id': 'object_query_format', 'label': _('Object Query Format'), 'type': 'string', 'default': 'Exact', 'choices': ['Exact', 'Regexp']},\n+        {\n+            'id': 'object_property',\n+            'label': _('Object Property'),\n+            'type': 'string',\n+            'help_text': _('The property of the object to return. Default: Content Ex: Username, Address, etc.'),\n+        },\n         {\n             'id': 'reason',\n             'label': _('Reason'),\n@@ -74,6 +80,7 @@\n     app_id = kwargs['app_id']\n     object_query = kwargs['object_query']\n     object_query_format = kwargs['object_query_format']\n+    object_property = kwargs.get('object_property', '')\n     reason = kwargs.get('reason', None)\n     if webservice_id == '':\n         webservice_id = 'AIMWebService'\n@@ -98,7 +105,18 @@\n             allow_redirects=False,\n         )\n     raise_for_status(res)\n-    return res.json()['Content']\n+    # CCP returns the property name capitalized, username is camel case\n+    # so we need to handle that case\n+    if object_property == '':\n+        object_property = 'Content'\n+    elif object_property.lower() == 'username':\n+        object_property = 'UserName'\n+    elif object_property not in res:\n+        raise KeyError('Property {} not found in object'.format(object_property))\n+    else:\n+        object_property = object_property.capitalize()\n+\n+    return res.json()[object_property]\n \n \n aim_plugin = CredentialPlugin('CyberArk Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend)\n", "issue": "Access to all keys out of the CyberArk object\n### Please confirm the following\n\n- [X] I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).\n- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.\n- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.\n\n### Feature type\n\nEnhancement to Existing Feature\n\n### Feature Summary\n\nhttps://issues.redhat.com/browse/AAPRFE-28\r\n\r\nWe want to pull all the Keys out of the CyberArk object instead of just the content key or the content value. When we run the API call from the playbook, CyberArk presents all the keys and values associated with that object. We can set the fact and use the keys and values as variables in the playbook. But when we use the custom credential it only gives us the content value and does not give us any other keys and values. We want to be able to use custom credential to pull all the keys and values associated with an object and assigned into variables in AAP natively using the credential plugin.\r\n\r\nThis feature request is for changes to the credential lookup plugin as used in AAP2.\n\n### Select the relevant components\n\n- [X] UI\n- [ ] API\n- [ ] Docs\n- [ ] Collection\n- [ ] CLI\n- [ ] Other\n\n### Steps to reproduce\n\n1. Configure a credential using the credential type \"CyberArk Central Credential Provider Lookup\".\r\n2. Only \"Content\" key value from JSON response is returned.  \"Content\" is the password value of the account object.\n\n### Current results\n\nThe credential plugin \"CyberArk Central Credential Provider Lookup\" is hardcoded to only return the \"Content\" key value from a JSON response that includes more keys that could be utilized.\n\n### Sugested feature result\n\nThe suggested feature would include an additional field in the metadata of the credential plugin to allow the user to specify a different key value to utilize outside of the \"Content\" which should still remain as the default key.\n\n### Additional information\n\nSpoke with Oleksii Baranov on 01-05-2023 about how to include this feature.  Being developed by CyberArk's @infamousjoeg.  PR to come shortly.\r\n\r\nFor more information, please reference the Issue at https://issues.redhat.com/browse/AAPRFE-28.\nAccess to all keys out of the CyberArk object\n### Please confirm the following\n\n- [X] I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).\n- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.\n- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.\n\n### Feature type\n\nEnhancement to Existing Feature\n\n### Feature Summary\n\nhttps://issues.redhat.com/browse/AAPRFE-28\r\n\r\nWe want to pull all the Keys out of the CyberArk object instead of just the content key or the content value. When we run the API call from the playbook, CyberArk presents all the keys and values associated with that object. We can set the fact and use the keys and values as variables in the playbook. But when we use the custom credential it only gives us the content value and does not give us any other keys and values. We want to be able to use custom credential to pull all the keys and values associated with an object and assigned into variables in AAP natively using the credential plugin.\r\n\r\nThis feature request is for changes to the credential lookup plugin as used in AAP2.\n\n### Select the relevant components\n\n- [X] UI\n- [ ] API\n- [ ] Docs\n- [ ] Collection\n- [ ] CLI\n- [ ] Other\n\n### Steps to reproduce\n\n1. Configure a credential using the credential type \"CyberArk Central Credential Provider Lookup\".\r\n2. Only \"Content\" key value from JSON response is returned.  \"Content\" is the password value of the account object.\n\n### Current results\n\nThe credential plugin \"CyberArk Central Credential Provider Lookup\" is hardcoded to only return the \"Content\" key value from a JSON response that includes more keys that could be utilized.\n\n### Sugested feature result\n\nThe suggested feature would include an additional field in the metadata of the credential plugin to allow the user to specify a different key value to utilize outside of the \"Content\" which should still remain as the default key.\n\n### Additional information\n\nSpoke with Oleksii Baranov on 01-05-2023 about how to include this feature.  Being developed by CyberArk's @infamousjoeg.  PR to come shortly.\r\n\r\nFor more information, please reference the Issue at https://issues.redhat.com/browse/AAPRFE-28.\n", "before_files": [{"content": "from .plugin import CredentialPlugin, CertFiles, raise_for_status\n\nfrom urllib.parse import quote, urlencode, urljoin\n\nfrom django.utils.translation import gettext_lazy as _\nimport requests\n\naim_inputs = {\n    'fields': [\n        {\n            'id': 'url',\n            'label': _('CyberArk CCP URL'),\n            'type': 'string',\n            'format': 'url',\n        },\n        {\n            'id': 'webservice_id',\n            'label': _('Web Service ID'),\n            'type': 'string',\n            'help_text': _('The CCP Web Service ID. Leave blank to default to AIMWebService.'),\n        },\n        {\n            'id': 'app_id',\n            'label': _('Application ID'),\n            'type': 'string',\n            'secret': True,\n        },\n        {\n            'id': 'client_key',\n            'label': _('Client Key'),\n            'type': 'string',\n            'secret': True,\n            'multiline': True,\n        },\n        {\n            'id': 'client_cert',\n            'label': _('Client Certificate'),\n            'type': 'string',\n            'secret': True,\n            'multiline': True,\n        },\n        {\n            'id': 'verify',\n            'label': _('Verify SSL Certificates'),\n            'type': 'boolean',\n            'default': True,\n        },\n    ],\n    'metadata': [\n        {\n            'id': 'object_query',\n            'label': _('Object Query'),\n            'type': 'string',\n            'help_text': _('Lookup query for the object. Ex: Safe=TestSafe;Object=testAccountName123'),\n        },\n        {'id': 'object_query_format', 'label': _('Object Query Format'), 'type': 'string', 'default': 'Exact', 'choices': ['Exact', 'Regexp']},\n        {\n            'id': 'reason',\n            'label': _('Reason'),\n            'type': 'string',\n            'help_text': _('Object request reason. This is only needed if it is required by the object\\'s policy.'),\n        },\n    ],\n    'required': ['url', 'app_id', 'object_query'],\n}\n\n\ndef aim_backend(**kwargs):\n    url = kwargs['url']\n    client_cert = kwargs.get('client_cert', None)\n    client_key = kwargs.get('client_key', None)\n    verify = kwargs['verify']\n    webservice_id = kwargs['webservice_id']\n    app_id = kwargs['app_id']\n    object_query = kwargs['object_query']\n    object_query_format = kwargs['object_query_format']\n    reason = kwargs.get('reason', None)\n    if webservice_id == '':\n        webservice_id = 'AIMWebService'\n\n    query_params = {\n        'AppId': app_id,\n        'Query': object_query,\n        'QueryFormat': object_query_format,\n    }\n    if reason:\n        query_params['reason'] = reason\n\n    request_qs = '?' + urlencode(query_params, quote_via=quote)\n    request_url = urljoin(url, '/'.join([webservice_id, 'api', 'Accounts']))\n\n    with CertFiles(client_cert, client_key) as cert:\n        res = requests.get(\n            request_url + request_qs,\n            timeout=30,\n            cert=cert,\n            verify=verify,\n            allow_redirects=False,\n        )\n    raise_for_status(res)\n    return res.json()['Content']\n\n\naim_plugin = CredentialPlugin('CyberArk Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend)\n", "path": "awx/main/credential_plugins/aim.py"}], "after_files": [{"content": "from .plugin import CredentialPlugin, CertFiles, raise_for_status\n\nfrom urllib.parse import quote, urlencode, urljoin\n\nfrom django.utils.translation import gettext_lazy as _\nimport requests\n\naim_inputs = {\n    'fields': [\n        {\n            'id': 'url',\n            'label': _('CyberArk CCP URL'),\n            'type': 'string',\n            'format': 'url',\n        },\n        {\n            'id': 'webservice_id',\n            'label': _('Web Service ID'),\n            'type': 'string',\n            'help_text': _('The CCP Web Service ID. Leave blank to default to AIMWebService.'),\n        },\n        {\n            'id': 'app_id',\n            'label': _('Application ID'),\n            'type': 'string',\n            'secret': True,\n        },\n        {\n            'id': 'client_key',\n            'label': _('Client Key'),\n            'type': 'string',\n            'secret': True,\n            'multiline': True,\n        },\n        {\n            'id': 'client_cert',\n            'label': _('Client Certificate'),\n            'type': 'string',\n            'secret': True,\n            'multiline': True,\n        },\n        {\n            'id': 'verify',\n            'label': _('Verify SSL Certificates'),\n            'type': 'boolean',\n            'default': True,\n        },\n    ],\n    'metadata': [\n        {\n            'id': 'object_query',\n            'label': _('Object Query'),\n            'type': 'string',\n            'help_text': _('Lookup query for the object. Ex: Safe=TestSafe;Object=testAccountName123'),\n        },\n        {'id': 'object_query_format', 'label': _('Object Query Format'), 'type': 'string', 'default': 'Exact', 'choices': ['Exact', 'Regexp']},\n        {\n            'id': 'object_property',\n            'label': _('Object Property'),\n            'type': 'string',\n            'help_text': _('The property of the object to return. Default: Content Ex: Username, Address, etc.'),\n        },\n        {\n            'id': 'reason',\n            'label': _('Reason'),\n            'type': 'string',\n            'help_text': _('Object request reason. This is only needed if it is required by the object\\'s policy.'),\n        },\n    ],\n    'required': ['url', 'app_id', 'object_query'],\n}\n\n\ndef aim_backend(**kwargs):\n    url = kwargs['url']\n    client_cert = kwargs.get('client_cert', None)\n    client_key = kwargs.get('client_key', None)\n    verify = kwargs['verify']\n    webservice_id = kwargs['webservice_id']\n    app_id = kwargs['app_id']\n    object_query = kwargs['object_query']\n    object_query_format = kwargs['object_query_format']\n    object_property = kwargs.get('object_property', '')\n    reason = kwargs.get('reason', None)\n    if webservice_id == '':\n        webservice_id = 'AIMWebService'\n\n    query_params = {\n        'AppId': app_id,\n        'Query': object_query,\n        'QueryFormat': object_query_format,\n    }\n    if reason:\n        query_params['reason'] = reason\n\n    request_qs = '?' + urlencode(query_params, quote_via=quote)\n    request_url = urljoin(url, '/'.join([webservice_id, 'api', 'Accounts']))\n\n    with CertFiles(client_cert, client_key) as cert:\n        res = requests.get(\n            request_url + request_qs,\n            timeout=30,\n            cert=cert,\n            verify=verify,\n            allow_redirects=False,\n        )\n    raise_for_status(res)\n    # CCP returns the property name capitalized, username is camel case\n    # so we need to handle that case\n    if object_property == '':\n        object_property = 'Content'\n    elif object_property.lower() == 'username':\n        object_property = 'UserName'\n    elif object_property not in res:\n        raise KeyError('Property {} not found in object'.format(object_property))\n    else:\n        object_property = object_property.capitalize()\n\n    return res.json()[object_property]\n\n\naim_plugin = CredentialPlugin('CyberArk Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend)\n", "path": "awx/main/credential_plugins/aim.py"}]}