freeipa/install/ui
Alexander Bokovoy 6c5f2bcb30 ipaldap: fix conversion from boolean OID to Python
In IPA framework we don't properly convert to Python bool type and just
return a string (TRUE or FALSE). This can be seen with many boolean
attributes, like

        Bool('idnsallowdynupdate?',
            cli_name='dynamic_update',
            label=_('Dynamic update'),
            doc=_('Allow dynamic updates.'),
            attribute=True,
            default=False,
            autofill=True
        ),

in 'ipa dnszone-show':

> > > api.Command.dnszone_show('ipa.test')['result']['idnsallowdynupdate']
['TRUE']

This is because we don't have the reverse (from LDAP to Python) mapping
for the LDAP boolean OID 1.3.6.1.4.1.1466.115.121.1.7.

When Web UI asks for the entry, it gets back JSON output that contains
this 'TRUE' value:

            "idnsallowdynupdate": [
                "TRUE"
            ],

Add proper mapping from LDAP to Python bool type. With this, a simple
'checkbox' type can be used in Web UI instead of a complex radio-box
setup.

Note that when IPA API is asked to return raw values, 'TRUE' and 'FALSE'
still returned. These are the actual LDAP boolean attribute values. Care
needs to be done in tests:

 - if output is from a command with --raw option, 'TRUE' or 'FALSE'
   should be expected

 - if output if from a normal (non-raw) command, True or False would be
   returned

Fixes: https://pagure.io/freeipa/issue/9171

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2022-06-10 09:25:27 +02:00
..
build WebUI: use python3-rjsmin to minify JavaScript files 2020-05-12 09:50:28 +02:00
css Debian: use -m lesscpy instead of hard-coded name 2019-04-24 14:08:20 +02:00
doc webui: topology graph facet 2015-11-27 15:50:56 +01:00
images Replace old login screen logo with new one 2018-08-21 17:38:32 +02:00
js Create symlink to qunit.js 2017-12-14 18:57:37 +01:00
less WebUI: Fix notification area layout 2019-11-21 16:44:11 +01:00
src ipaldap: fix conversion from boolean OID to Python 2022-06-10 09:25:27 +02:00
test External IdP: add Web UI to manage IdP references 2022-05-10 15:52:41 +03:00
util Also use uglifyjs on CentOS Stream 8 2021-04-01 08:51:41 -04:00
favicon.ico Replace logo images with new one (version 4.7) 2018-08-13 14:25:06 +02:00
Gruntfile.js Make WebUI unit tests to generate results as JUnit 2018-03-16 14:26:48 +01:00
ie.css Fixed display of attributes_widget in IE9 2012-07-17 15:55:44 +02:00
index.html Change FreeIPA references to IPA and Identity Management 2021-01-21 13:51:45 +01:00
ipa.css WebUI: Fix notification area layout 2019-11-21 16:44:11 +01:00
jsl.conf Fix javascript 'errors' found by jslint 2018-09-27 16:33:25 +02:00
Makefile.am Clean up reset_password.js file from project 2018-09-12 12:41:19 +02:00
package.json Add Gruntfile and package.json to ui directory 2017-12-14 18:57:37 +01:00
README-LICENSE.txt WebUI build: replace uglifyjs with system package 2018-07-12 15:38:01 +02:00
reset_password.html Change FreeIPA references to IPA and Identity Management 2021-01-21 13:51:45 +01:00
sync_otp.html Change FreeIPA references to IPA and Identity Management 2021-01-21 13:51:45 +01:00