From 6a94b58ad196d60bc12502e1045b3a6b350c9edd Mon Sep 17 00:00:00 2001 From: taohe Date: Wed, 10 Jun 2026 22:53:07 +0800 Subject: [PATCH] Fix safe user id digest algorithm --- backend/packages/harness/deerflow/config/paths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/packages/harness/deerflow/config/paths.py b/backend/packages/harness/deerflow/config/paths.py index f01959657..8b16b76b1 100644 --- a/backend/packages/harness/deerflow/config/paths.py +++ b/backend/packages/harness/deerflow/config/paths.py @@ -47,7 +47,7 @@ def make_safe_user_id(raw: str) -> str: sanitized = _UNSAFE_USER_ID_CHAR_RE.sub("-", raw) if sanitized == raw: return raw - digest = hashlib.sha1(raw.encode("utf-8")).hexdigest()[:_SAFE_USER_ID_DIGEST_HEX_LEN] + digest = hashlib.sha256(raw.encode("utf-8")).hexdigest()[:_SAFE_USER_ID_DIGEST_HEX_LEN] return f"{sanitized}-{digest}"