Buckets:

download
raw
3.6 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The /login caller (WebUI or HTTP client) is outside the repo; the cloned repo has no lightrag_webui sources or in-repo client posting credentials to /login (only tests, which do not count)."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "login",
"file": "lightrag/api/lightrag_server.py",
"lines": "2714",
"notes": "FastAPI route @app.post(\"/login\") in create_app receives OAuth2PasswordRequestForm (username, password), applies LoginRateLimiter, calls auth_handler.verify_password (lightrag_server.py:2759-2760) and raises 401 'Incorrect credentials' on failure. Only active when AUTH_ACCOUNTS is configured; otherwise it returns a guest token."
},
{
"role": "Verification manager",
"status": "present",
"symbol": "verify_password",
"file": "lightrag/api/auth.py",
"lines": "113",
"notes": "Reached from login (lightrag_server.py:2760). AuthHandler.verify_password fetches the stored spec via self.accounts.get(username) (auth.py:127), then delegates to passwords.verify_password (auth.py:143), running a dummy bcrypt for unknown/plaintext accounts to equalize timing."
},
{
"role": "Password store",
"status": "present",
"symbol": "__init__",
"file": "lightrag/api/auth.py",
"lines": "51",
"notes": "AuthHandler.__init__ parses AUTH_ACCOUNTS env (config.py:871) into the in-memory dict self.accounts (auth.py:94), read by verify_password at auth.py:127. Caveat: entries may be '{bcrypt}<hash>' (hashed) or plaintext passwords from config."
},
{
"role": "Hasher",
"status": "external",
"symbol": "checkpw",
"file": "lightrag/api/passwords.py",
"lines": "22",
"notes": "AuthHandler.verify_password (auth.py:143) -> passwords.verify_password (passwords.py:15) -> bcrypt.checkpw, which hashes the candidate with the stored salt; the same call also performs the comparison (Comparator). Library: bcrypt (pyca). Plaintext-configured accounts are not hashed (hmac.compare_digest at passwords.py:32)."
},
{
"role": "Pepper store",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No pepper on the verification path: lightrag/api/passwords.py and auth.py use only bcrypt salt; TOKEN_SECRET is a JWT signing key, not a pepper."
},
{
"role": "Encrypter",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No encryption of the password hash with a pepper key in passwords.verify_password or AuthHandler.verify_password; bcrypt hashing only."
},
{
"role": "Comparator",
"status": "external",
"symbol": "checkpw",
"file": "lightrag/api/passwords.py",
"lines": "22",
"notes": "Same bcrypt.checkpw call as the Hasher (one library call covers both roles), reached via passwords.verify_password (passwords.py:15) from auth.py:143; returns the boolean decision. For plaintext accounts, hmac.compare_digest at passwords.py:32 compares instead."
},
{
"role": "System",
"status": "present",
"symbol": "create_token",
"file": "lightrag/api/auth.py",
"lines": "145",
"notes": "On successful verification, login's success branch calls auth_handler.create_token (lightrag_server.py:2777) which issues the signed JWT access token returned to the client."
}
]
}

Xet Storage Details

Size:
3.6 kB
·
Xet hash:
58a0adb76d2f72e7dee9d126f22e521c6ede9e7c9a13d6dfc37683f6d88e50e7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.