Univention Bugzilla – Bug 54232
UDM REST API client should cache LDAP base for all sessions
Last modified: 2022-01-05 10:26:02 CET
The UDM REST API client currently caches the LDAP base in an instance of the Session object. But as the UDM REST API client is best used as a context manager, it has to get the LDAP base from the UDM REST API rather often (every time a new session is started). Cache the LDAP base, so new connections do not require fetching it again and again.
Retrieving the LDAP base requires making two HTTP queries: 301 GET /udm/ldap/base/ 200 GET /udm/container/dc/dc=$LDAP,dc=$BASE While those are responded to very fast, they still sum up to >=35ms each time. When the UDM REST client is used in another REST service like the Kelvin REST API, that time will be added to each call! The LDAP base cannot simply be cached for the whole process, as the client could be used to connect to different servers (with different LDAP bases). But it can safely be assumed, that the LDAP base will not change on a host. So the LDAP base cache can be a process wide mapping from host name to LDAP base. ---------------------------------------------------------------------------------- [master da8b96a] add process wide cache for the LDAP base of each host (Bug #54232) A git tag "1.0.5" was added. * Coverage (100%): https://app.codecov.io/gh/univention/python-udm-rest-api-client * Docs (Published): https://udm-rest-client.readthedocs.io/en/latest/ * Travis CI (success): https://app.travis-ci.com/github/univention/python-udm-rest-api-client * GH Actions - Linting (success): https://github.com/univention/python-udm-rest-api-client/actions?query=workflow%3A%22Code+Linting%22 * GH Actions - Integration tests (success, but wrong badge): https://github.com/univention/python-udm-rest-api-client/actions?query=workflow%3A%22Integration+tests%22 The package was released on https://test.pypi.org/project/udm-rest-client/1.0.5/ When approved by QA, I'll release it via production PyPI.
QA - code OK - pipelines + docu https://udm-rest-client.readthedocs.io/en/latest/history.html#history starts with >1.0.5 () - installation OK - tests pass with lxd OK
The changelog was fixed, a new tag created and a new version released. [tags/1.0.6] be1a971 bump version to 1.0.6
Looks good & released on pypi -> verify
Has been released on pypi.