freeipa/ipalib
Rob Crittenden a4675f6f50 Implement simple LDAP cache layer
Insert a class before LDAPClient to cache the return value
of get_entry() and certain exceptions (NotFound and
EmptyResult). The cache uses an OrderedDict for the cases
where a large cache might result an LRU model can be used.

The cache be enabled (default) or disabled using
ldap_cache=True/False.

This cache is per-request so is not expected to grow
particularly large except in the case of a large batch
command.

The key to the cache entry is the dn of the object
being requested.

Any write to or referencing a cached dn is evicted from
the cache.

The set of attributes is somewhat taken into consideration.
"*" does not always match everything being asked for by
a plugin so unless the requested set of attributes is a
direct subset of what is cached it will be re-fetched. Err
on the side of safety.

Despite this rather conserative approach to caching 29%
of queries are saved with ipatests/xmlrpc_tests/*

https://pagure.io/freeipa/issue/8798

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
2021-05-12 10:45:57 -04:00
..
install pylint: Fix several warnings 2021-03-30 09:58:42 +02:00
__init__.py pylint: Clean up comment 2020-02-12 18:08:32 +02:00
aci.py De-duplicate ACI attributes and permissions 2020-09-14 09:15:59 +03:00
backend.py Fix Pylint 2.0 violations 2018-07-14 12:04:19 +02:00
base.py Py3: Replace six.string_types with str 2018-09-27 16:11:18 +02:00
capabilities.py Replace LooseVersion 2016-11-24 15:46:40 +01:00
cli.py Make tab completion in console more useful 2020-07-07 12:36:10 +02:00
config.py Fix detection logic for api.env.in_tree 2020-05-14 18:16:20 +02:00
constants.py Implement simple LDAP cache layer 2021-05-12 10:45:57 -04:00
crud.py ipalib, ipaserver: fix incorrect API.register calls in docstrings 2016-05-25 16:06:26 +02:00
dns.py dnsrecord-mod: allow to modify ttl without passing the record 2019-07-01 09:16:21 +02:00
errors.py rpcserver: fix exception handling for FAST armor failure 2020-10-30 19:06:11 +02:00
facts.py Fall back to old server installation detection when needed 2020-08-18 11:11:26 +02:00
frontend.py Add __signature__ to plugins 2020-07-07 12:36:10 +02:00
krb_utils.py ccache_sweeper: Add gssproxy service 2021-03-04 14:17:01 +02:00
Makefile.am Build: Makefiles for Python packages 2016-11-09 13:08:32 +01:00
messages.py Handle missing LWCA certificate or chain 2019-06-18 10:36:24 +10:00
misc.py Add fix for ipa plugins command 2017-02-17 10:22:07 +01:00
output.py Generate same API.txt under Python 2 and 3 2018-02-15 09:41:30 +01:00
parameters.py Add max/min safe integer 2021-04-27 13:10:26 -04:00
pkcs10.py Change FreeIPA references to IPA and Identity Management 2021-01-21 13:51:45 +01:00
plugable.py cli: When parsing options require name/value pairs 2020-08-25 10:31:19 -04:00
request.py Py3: Remove subclassing from object 2018-09-27 11:49:04 +02:00
rpc.py pylint: fix inconsistent-return-statements 2021-02-22 16:18:11 -05:00
setup.cfg Port all setup.py to setuptools 2016-10-20 18:43:37 +02:00
setup.py Add helpers for resolve1 and nameservers 2020-09-23 16:44:26 +02:00
sysrestore.py Address legacy pylint issues in sysrestore.py 2020-08-07 16:44:28 -04:00
text.py Create ipasphinx package for Sphinx plugins 2020-04-28 20:03:21 +02:00
util.py ipalib/util.py: add print_replication_status 2021-03-02 11:48:59 +01:00
x509.py Change FreeIPA references to IPA and Identity Management 2021-01-21 13:51:45 +01:00