freeipa/ipatests/test_ipaserver
Alexander Bokovoy ef955c9015
support more DateTime attributes in LDAP searches in IPA API
LDAPSearch class constructs a filter from a set of attributes and their
values passed in by the command. During this construction process a
limited set of attributes gets converted to a special form, the rest is
simply taken as a string and escaped according to LDAP rules.

This means DateTime class would simply be converted to string using
str(DateTime) and that uses default formatting method. For LDAP we need
to apply a specific formatting method instead.

Following LDAP attributes now handled as datetime.datetime:

 ( 1.3.6.1.4.1.5322.21.2.5 NAME 'krbLastAdminUnlock' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE)
 ( 2.16.840.1.113719.1.301.4.6.1 NAME 'krbPrincipalExpiration' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE)
 ( 2.16.840.1.113719.1.301.4.37.1 NAME 'krbPasswordExpiration' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE)
 ( 2.16.840.1.113719.1.301.4.45.1 NAME 'krbLastPwdChange' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE)
 ( 2.16.840.1.113719.1.301.4.48.1 NAME 'krbLastSuccessfulAuth' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE)
 ( 2.16.840.1.113719.1.301.4.49.1 NAME 'krbLastFailedAuth' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE)
 ( 2.16.840.1.113730.3.8.16.1.3  NAME 'ipatokenNotBefore' DESC 'Token validity date' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-ORIGIN 'IPA OTP')
 ( 2.16.840.1.113730.3.8.16.1.4  NAME 'ipatokenNotAfter' DESC 'Token expiration date' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-ORIGIN 'IPA OTP')

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

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Antonio Torres <antorres@redhat.com>
2023-08-21 16:28:04 +02:00
..
data ipa-otptoken-import: Make PBKDF2 refer to the pkcs5 namespace 2017-09-01 10:50:34 +02:00
test_install pylint: Fix useless-object-inheritance 2023-01-10 08:30:58 +01:00
__init__.py pytest 3.x compatibility 2017-03-27 18:03:14 +02:00
httptest.py pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
test_adtrust_mockup.py pytest: Migrate unittest/nose to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_changepw.py pytest: Migrate unittest/nose to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_dnssec.py ipapython: move dnssec, p11helper and secrets to ipaserver 2016-11-29 14:50:51 +01:00
test_i18n_messages.py Add tests for "i18n_messages" end point 2018-07-17 15:32:28 -04:00
test_ipap11helper.py Py3: Remove subclassing from object 2018-09-27 11:49:04 +02:00
test_jsplugins.py ipatests: Skip test_jsplugins in server less environments 2021-03-30 13:16:36 +03:00
test_kadmin.py ipa-kdb: test kadmin.local getprincs command 2020-09-10 11:57:14 -04:00
test_ldap.py support more DateTime attributes in LDAP searches in IPA API 2023-08-21 16:28:04 +02:00
test_migratepw.py pytest: Migrate xunit-style setups to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_otptoken_import.py Py3: Remove subclassing from object 2018-09-27 11:49:04 +02:00
test_rpcserver.py Py3: Remove subclassing from object 2018-09-27 11:49:04 +02:00
test_secrets.py pytest: Migrate unittest/nose to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_secure_ajp_connector.py pylint: remove useless suppression 2023-01-10 08:30:58 +01:00
test_serverroles.py Use api.env.container_sysaccounts 2020-04-28 11:28:29 +02:00
test_topology_plugin.py ds: Support renaming of a replication plugin in 389-ds 2021-06-01 17:09:28 +03:00
test_version_comparison.py Py3: Remove subclassing from object 2018-09-27 11:49:04 +02:00