aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-07-30 11:17:09 +0100
committerGravatar GitHub <[email protected]>2024-07-30 11:17:09 +0100
commit9bc1c81d6b8aadd687a5f4536cf52d7c40f9c763 (patch)
treed71c40dc9f5c16c8ddb39241a0063e8f5f5f84e4
parentMerge pull request #249 from python-discord/jb3-patch-1 (diff)
Disable caching of FreeIPA client
Tokens issued by calling the Client.login() method have a TTL, which means once the TTL is reached the cached client is no longer valid. This can be reintroduced in future if we can find a way to discover the validity of tokens or their TTL and use a time-based cache.
-rw-r--r--arthur/apis/directory/freeipa.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/arthur/apis/directory/freeipa.py b/arthur/apis/directory/freeipa.py
index 9da9d76..cf4ba23 100644
--- a/arthur/apis/directory/freeipa.py
+++ b/arthur/apis/directory/freeipa.py
@@ -1,6 +1,5 @@
"""API utilities for modifying data via FreeIPA."""
-from functools import cache
from secrets import token_urlsafe
try:
@@ -18,7 +17,6 @@ from arthur.constants import LDAP_ROLE_MAPPING
PW_LENGTH = 20
-@cache
def create_client() -> ClientMeta:
"""Create a new client and login to FreeIPA."""
username = LDAPDN(CONFIG.ldap_bind_user).rdns[0][0][1]