Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /session_based_access_control /DeepselSystems_deepsel.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client (no JS/TS frontend, SDK or CLI) sends the session_id cookie to the API; the caller (browser) is outside the repo. The cookie is only set server-side by _set_session_cookie in deepsel/apps/core/routers/auth.py:63." | |
| }, | |
| { | |
| "role": "Authentication enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "deepsel/auth/get_current_user.py", | |
| "lines": "56", | |
| "notes": "FastAPI dependency installed on every CRUDRouter route via Depends(self.get_current_user) (deepsel/utils/crud_router.py:80, :245 for the get-one route). It first resolves the session cookie via _resolve_user_from_session (line 85) and raises 401 if neither a session nor a valid Bearer JWT is present; the JWT fallback (lines 98-112) is the verifiable-token mechanism and is not part of this pattern." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "_resolve_user_from_session", | |
| "file": "deepsel/auth/get_current_user.py", | |
| "lines": "30", | |
| "notes": "Called by get_current_user at deepsel/auth/get_current_user.py:85. Reads the session_id cookie, looks it up with session_store.get(session_id) (line 40) and loads the user principal by session_data.user_id; returns None if no open session. AuthService.validate_session (deepsel/auth/service.py:261) is a similar helper not on this path." | |
| }, | |
| { | |
| "role": "Session manager", | |
| "status": "present", | |
| "symbol": "get", | |
| "file": "deepsel/auth/session.py", | |
| "lines": "280", | |
| "notes": "Reached from _resolve_user_from_session at deepsel/auth/get_current_user.py:40 via app.state.session_store, created in main.py:98 by create_session_store. By default (REDIS_URL unset, db_session_factory=get_db_context given) the PostgresSessionStore is used; its get queries the auth_session table, deletes expired rows and returns SessionData. Alternatives: RedisSessionStore.get (session.py:173) when REDIS_URL/SESSION_STORE=redis, FileSessionStore.get (session.py:373) as fallback." | |
| }, | |
| { | |
| "role": "Authorisation enforcer", | |
| "status": "present", | |
| "symbol": "get_one", | |
| "file": "deepsel/orm/mixin.py", | |
| "lines": "835", | |
| "notes": "Called with the authenticated user from the CRUD get-one route at deepsel/utils/crud_router.py:247 (self.db_model.get_one(db, user, item_id)). ORMBaseMixin.get_one calls _check_has_permission(PermissionAction.read, user) and raises 403 if not allowed, then restricts the query by scope via _build_query_based_on_scope (mixin.py:1772). create/update/delete in the same mixin enforce analogously." | |
| }, | |
| { | |
| "role": "Decider", | |
| "status": "present", | |
| "symbol": "_check_has_permission", | |
| "file": "deepsel/orm/mixin.py", | |
| "lines": "1115", | |
| "notes": "Called by get_one at deepsel/orm/mixin.py:844. Filters the user's permission strings (table:action:scope) for this table and action and returns (allowed, highest scope among *, org, own)." | |
| }, | |
| { | |
| "role": "Policy provider", | |
| "status": "present", | |
| "symbol": "get_user_permissions", | |
| "file": "deepsel/orm/user_mixin.py", | |
| "lines": "244", | |
| "notes": "Called by _check_has_permission at deepsel/orm/mixin.py:1131. Collects permission strings from the user's roles, recursively including implied roles (_get_permissions_recursively, user_mixin.py:220), stored as JSON in the role table." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "route", | |
| "file": "deepsel/utils/crud_router.py", | |
| "lines": "242", | |
| "notes": "Generic CRUD get-one handler (closure in CRUDRouter._get_one) guarded by Depends(get_current_user) and authorised via get_one; it returns the record that get_one fetches with the scoped query (deepsel/orm/mixin.py:851-855) or 404. The same pattern covers the other CRUD routes in crud_router.py." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 4.05 kB
- Xet hash:
- 39bc083fc0ec5b336a26ace574244745b65b073f5568b453fc5693dcd0274f8b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.