RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix: admin client (#13699)
Lynne12147f5b9ef
diff --git a/admin/client/pyproject.toml b/admin/client/pyproject.tomlindex 1b79c85c31..d2af4bb6ca 100644--- a/admin/client/pyproject.toml+++ b/admin/client/pyproject.toml@@ -11,13 +11,13 @@ dependencies = ["beartype>=0.20.0,<1.0.0","pycryptodomex>=3.10.0","lark>=1.1.0",+ "requests-toolbelt>=1.0.0",][dependency-groups]test = ["pytest>=8.3.5","requests>=2.32.3",- "requests-toolbelt>=1.0.0",][tool.setuptools]diff --git a/admin/client/user.py b/admin/client/user.pyindex 823e2a1300..6e6a36eeea 100644--- a/admin/client/user.py+++ b/admin/client/user.py@@ -26,7 +26,19 @@ class AuthException(Exception):def encrypt_password(password_plain: str) -> str:try:- from api.utils.crypt import crypt+ import base64+ from Cryptodome.PublicKey import RSA+ from Cryptodome.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5+ def crypt(line):+ """+ decrypt(crypt(input_string)) == base64(input_string), which frontend and ragflow_cli use.+ """+ pub = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB\n-----END PUBLIC KEY-----"+ rsa_key = RSA.importKey(pub)+ cipher = Cipher_pkcs1_v1_5.new(rsa_key)+ password_base64 = base64.b64encode(line.encode('utf-8')).decode("utf-8")+ encrypted_password = cipher.encrypt(password_base64.encode())+ return base64.b64encode(encrypted_password).decode('utf-8')except Exception as exc:raise AuthException("Password encryption unavailable; install pycryptodomex (uv sync --python 3.12 --group test)."