From eb48e763154a30ce32c4cae78f1e963eab9d8c92 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Mon, 7 Aug 2023 17:45:39 -0300 Subject: [PATCH] fix: Hash cache key for default memcached cache --- ietf/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ietf/settings.py b/ietf/settings.py index be2d62c7b9..aea832de0d 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -10,6 +10,7 @@ import sys import datetime import warnings +from hashlib import sha384 from typing import Any, Dict, List, Tuple # pyflakes:ignore warnings.simplefilter("always", DeprecationWarning) @@ -733,6 +734,9 @@ def skip_unreadable_post(record): 'LOCATION': '127.0.0.1:11211', 'VERSION': __version__, 'KEY_PREFIX': 'ietf:dt', + 'KEY_FUNCTION': lambda key, key_prefix, version: ( + f"{key_prefix}:{version}:{sha384(key.encode('utf8')).hexdigest()}" + ), }, 'sessions': { 'BACKEND': 'ietf.utils.cache.LenientMemcacheCache',