freeipa/ipalib
Rob Crittenden b842b825ab Make the schema cache TTL user-configurable
The API schema is not checked for changes until after a TTL
is expired. A one-hour TTL was hardcoded which makes development
tedious because the only way to force a schema update is to
remember to remove files between invocations.

This adds a new environment variable, schema_ttl, to configure
the TTL returned by the server to schema() calls. This can be
set low to ensure a frequent refresh during development.

If the client is in compat mode, that is if client is working
against a server that doesn't support the schema() command,
then use the client's schema_ttl instead so that the user still
has control.

Re-check validity before writing the cache. This saves us both
a disk write and the possibility of updating the expiration
with a ttl of 0. This can happen if the fingerprint is still
valid (not expired, no language change) the schema check is
skipped so we have no server-provided ttl.

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

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2021-11-03 10:59:10 +01: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 Make the schema cache TTL user-configurable 2021-11-03 10:59:10 +01: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 krb_utils: Simplify get_credentials 2021-06-12 11:19:25 +03: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 plugins: Don't treat keys of api as bytes 2021-06-28 14:16:56 +03: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 When loading certificates verify that it is X.509 v3 2021-06-14 15:19:42 -04:00