diff --git a/libs/core/garf/core/cache.py b/libs/core/garf/core/cache.py index 587742d..6f839a0 100644 --- a/libs/core/garf/core/cache.py +++ b/libs/core/garf/core/cache.py @@ -83,7 +83,7 @@ def load( """ args_hash = args.hash if args else '' kwargs_hash = ( - hashlib.md5(json.dumps(kwargs).encode('utf-8')).hexdigest() + hashlib.md5(json.dumps(kwargs).encode('utf-8'), usedforsecurity=False).hexdigest() if kwargs else '' ) @@ -117,7 +117,7 @@ def save( self.location.mkdir(parents=True, exist_ok=True) args_hash = args.hash if args else '' kwargs_hash = ( - hashlib.md5(json.dumps(kwargs).encode('utf-8')).hexdigest() + hashlib.md5(json.dumps(kwargs).encode('utf-8'), usedforsecurity=False).hexdigest() if kwargs else '' ) diff --git a/libs/core/garf/core/query_editor.py b/libs/core/garf/core/query_editor.py index 6c59eba..dbfbe73 100644 --- a/libs/core/garf/core/query_editor.py +++ b/libs/core/garf/core/query_editor.py @@ -45,7 +45,7 @@ class GarfQueryParameters(pydantic.BaseModel): @property def hash(self) -> str: hash_fields = self.model_dump(exclude_none=True) - return hashlib.md5(json.dumps(hash_fields).encode('utf-8')).hexdigest() + return hashlib.md5(json.dumps(hash_fields).encode('utf-8'), usedforsecurity=False).hexdigest() def __eq__(self, other) -> bool: return (self.macro, self.template) == (other.macro, other.template) @@ -121,7 +121,7 @@ def request(self) -> str: @property def hash(self) -> str: hash_fields = self.model_dump(exclude_none=True, exclude={'title', 'text'}) - return hashlib.md5(json.dumps(hash_fields).encode('utf-8')).hexdigest() + return hashlib.md5(json.dumps(hash_fields).encode('utf-8'), usedforsecurity=False).hexdigest() class CommonParametersMixin: