Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /authentication_pwd /AmberLee2427_nancy-brain.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "present", | |
| "symbol": "login", | |
| "file": "connectors/http_api/streamlit_auth.py", | |
| "lines": "26", | |
| "notes": "Streamlit client helper login (streamlit_auth.py) POSTs username/password as form data to the API /login endpoint (line 32); it is invoked by the admin UI sidebar login form at nancy_brain/admin_ui.py:454. It targets the traced Enforcer login in connectors/http_api/app.py:323." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "login", | |
| "file": "connectors/http_api/app.py", | |
| "lines": "323", | |
| "notes": "FastAPI route POST /login (decorator at app.py:322) receives OAuth2PasswordRequestForm credentials from the Subject and calls auth.authenticate_user at app.py:324; it refuses with HTTP 400 'Incorrect username or password' when verification fails (app.py:325-326), else issues tokens." | |
| }, | |
| { | |
| "role": "Verification manager", | |
| "status": "present", | |
| "symbol": "authenticate_user", | |
| "file": "connectors/http_api/auth.py", | |
| "lines": "315", | |
| "notes": "Called by Enforcer login at app.py:324. Fetches the user record via get_user (auth.py:316) and passes the plain password and stored bcrypt hash to verify_password (auth.py:319), returning the user row or False." | |
| }, | |
| { | |
| "role": "Password store", | |
| "status": "present", | |
| "symbol": "get_user", | |
| "file": "connectors/http_api/auth.py", | |
| "lines": "299", | |
| "notes": "Called by authenticate_user at auth.py:316. Runs SELECT * FROM users WHERE username = ? on the SQLite users table (created in create_user_table auth.py:47 with a hashed_password column; DB path from NB_USERS_DB)." | |
| }, | |
| { | |
| "role": "Hasher", | |
| "status": "external", | |
| "symbol": "verify", | |
| "file": "connectors/http_api/auth.py", | |
| "lines": "310", | |
| "notes": "Reached from authenticate_user (auth.py:319) via the thin wrapper verify_password (auth.py:306), which calls passlib CryptContext.verify; the context is configured with bcrypt at auth.py:21 (pwd_context = CryptContext(schemes=[\"bcrypt\"])). One library call both re-hashes with the stored salt and compares, so it covers Hasher and Comparator." | |
| }, | |
| { | |
| "role": "Pepper store", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No pepper on the verification path: authenticate_user/verify_password (auth.py:306-321) use only plain bcrypt via passlib; the bcrypt salt is not a pepper. SECRET_KEY (auth.py:13) is the JWT signing key, unrelated to password hashing." | |
| }, | |
| { | |
| "role": "Encrypter", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No encryption of the password hash with a pepper/key anywhere in connectors/http_api/auth.py; the hash is a plain bcrypt hash stored and compared by passlib." | |
| }, | |
| { | |
| "role": "Comparator", | |
| "status": "external", | |
| "symbol": "verify", | |
| "file": "connectors/http_api/auth.py", | |
| "lines": "310", | |
| "notes": "Same call as Hasher: passlib CryptContext(bcrypt).verify inside wrapper verify_password (auth.py:306), called from authenticate_user at auth.py:319, recomputes the bcrypt hash and compares it with the stored hashed_password, returning True/False (ValueError mapped to False)." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "create_access_token", | |
| "file": "connectors/http_api/auth.py", | |
| "lines": "324", | |
| "notes": "Success branch of Enforcer login (app.py:327) calls auth.create_access_token, which issues the HS256 JWT access token (python-jose jwt.encode); login also creates and stores a refresh token (app.py:328-331) and returns them to the Subject." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.83 kB
- Xet hash:
- c4054b8a138152bcf2dc82482db6c59d21cf4122c48e338d4ad599b8eb557b0d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.