From 1def4a7ad7ee3292b4e261dee507efa7e4e89041 Mon Sep 17 00:00:00 2001 From: fmigneault Date: Tue, 7 Dec 2021 14:33:56 -0500 Subject: [PATCH] add workaround impl to ignore arg for cache key generation (relates to https://github.com/bbangert/beaker/issues/201) --- magpie/adapter/magpieowssecurity.py | 5 ++++- requirements.txt | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/magpie/adapter/magpieowssecurity.py b/magpie/adapter/magpieowssecurity.py index af769b7b8..3dd5324a3 100644 --- a/magpie/adapter/magpieowssecurity.py +++ b/magpie/adapter/magpieowssecurity.py @@ -60,7 +60,10 @@ def __init__(self, container): self.twitcher_ssl_verify = asbool(self.settings.get("twitcher.ows_proxy_ssl_verify", True)) self.twitcher_protected_path = self.settings.get("twitcher.ows_proxy_protected_path", "/ows") - @cache_region("service") + # NOTE: Parameter 'ignore_args' is unofficial from 'https://github.com/crim-ca/beaker/commit/0ac88b'. + # Using this parameter, the request UUID is ignored to avoid generating distinct cache keys for each + # new inbound request, nullifying the whole point of caching similar requests to service mapping. + @cache_region("service", ignore_args=["request_uuid"]) def _get_service_cached(self, service_name, request_uuid): # type: (Str, uuid.UUID) -> Tuple[ServiceInterface, Dict[str, AnyValue]] """ diff --git a/requirements.txt b/requirements.txt index 097aac010..85cae6de4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,8 @@ alembic>=1.3.0,<1.5 # leave http port until merged: authomatic[OpenID] @ https://github.com/fmigneault/authomatic/archive/httplib-port.zip bcrypt>=3.1.6 -beaker +# FIXME: integrate when implemnted by official package (see https://github.com/bbangert/beaker/issues/201) +beaker @ https://github.com/crim-ca/beaker/commit/0ac88bcd8cca063a571fc385ffbe9bcc8acaa690 colander cornice<5; python_version < "3" cornice; python_version >= "3"