caches: don't use deprecated md5 for key calculation.
- md5 isn't a valiable option for compliance reasons
This commit is contained in:
parent
225757aaf3
commit
edc9dc5771
3 changed files with 11 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ import threading
|
|||
from beaker.cache import _cache_decorate, cache_regions, region_invalidate
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from rhodecode.lib.utils import safe_str, md5
|
||||
from rhodecode.lib.utils import safe_str, sha1
|
||||
from rhodecode.model.db import Session, CacheKey
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
|
@ -141,7 +141,7 @@ def compute_key_from_params(*args):
|
|||
"""
|
||||
Helper to compute key from given params to be used in cache manager
|
||||
"""
|
||||
return md5("_".join(map(safe_str, args)))
|
||||
return sha1("_".join(map(safe_str, args)))
|
||||
|
||||
|
||||
def get_repo_namespace_key(prefix, repo_name):
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ from rhodecode.lib.vcs.backends.base import Config
|
|||
from rhodecode.lib.vcs.exceptions import VCSError
|
||||
from rhodecode.lib.vcs.utils.helpers import get_scm, get_scm_backend
|
||||
from rhodecode.lib.utils2 import (
|
||||
safe_str, safe_unicode, get_current_rhodecode_user, md5)
|
||||
safe_str, safe_unicode, get_current_rhodecode_user, md5, sha1)
|
||||
from rhodecode.model import meta
|
||||
from rhodecode.model.db import (
|
||||
Repository, User, RhodeCodeUi, UserLog, RepoGroup, UserGroup)
|
||||
|
|
|
|||
|
|
@ -56,6 +56,14 @@ def md5_safe(s):
|
|||
return md5(safe_str(s))
|
||||
|
||||
|
||||
def sha1(s):
|
||||
return hashlib.sha1(s).hexdigest()
|
||||
|
||||
|
||||
def sha1_safe(s):
|
||||
return sha1(safe_str(s))
|
||||
|
||||
|
||||
def __get_lem(extra_mapping=None):
|
||||
"""
|
||||
Get language extension map based on what's inside pygments lexers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue