Skip to content

Commit

Permalink
fix: Hash cache key for default memcached cache (#6089)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Aug 8, 2023
1 parent 4653906 commit 7e852ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 7e852ae

Please sign in to comment.