From 428cac2c2e299a7569ea1a0cc816ca062f697684 Mon Sep 17 00:00:00 2001 From: Matyas Selmeci Date: Fri, 24 May 2024 21:19:54 -0500 Subject: [PATCH] Cache parse_authz() results too --- src/webapp/data_federation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webapp/data_federation.py b/src/webapp/data_federation.py index f7ae234ef..db9d7335d 100644 --- a/src/webapp/data_federation.py +++ b/src/webapp/data_federation.py @@ -292,6 +292,7 @@ def _parse_authz_str(authz: str) -> Tuple[AuthMethod, Optional[str]]: return NullAuth(), f"Unknown authz list entry {authz}" +@functools.lru_cache(1024) def parse_authz(authz: Union[str, Dict]) -> Tuple[AuthMethod, Optional[str]]: """Return the instance of the appropriate AuthMethod from a single item in an authz list for a namespace.