Buckets:

download
raw
4.62 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "present",
"symbol": "session_admin_global",
"file": "randovania/network_client/network_client.py",
"lines": "895",
"notes": "In-repo desktop client: session_admin_global in NetworkClient emits the AdminSession socket.io event via call_server -> server_call -> sio.call (network_client.py:538) over the logged-in socket.io connection whose sid is the opaque session id. Reaches the Authentication enforcer _handler registered at server_app.py:310 via server_signals.register."
},
{
"role": "Authentication enforcer",
"status": "present",
"symbol": "_handler",
"file": "randovania/server/server_app.py",
"lines": "330",
"notes": "_handler (inner function of ServerApp.on, registered via sio.on for every socket.io event, e.g. AdminSession in session_admin.py:823) intercepts the event, resolves the sid via get_current_user (server_app.py:341) and runs the callback, turning NotLoggedInError/InvalidSessionError raised during the action into an error reply (server_app.py:366). Caveat: it does not reject anonymous calls by itself; rejection happens when the action's get_current_user call (via verify_has_admin, session_admin.py:54) raises."
},
{
"role": "Verifier",
"status": "present",
"symbol": "get_current_user",
"file": "randovania/server/server_app.py",
"lines": "283",
"notes": "Called by _handler (server_app.py:341) and by verify_has_admin (session_admin.py:54). Looks up the socket.io session for the sid, reads 'user-id' and loads the User, raising NotLoggedInError if no user is bound to the session and InvalidSessionError if the user no longer exists."
},
{
"role": "Session manager",
"status": "external",
"symbol": "get_session",
"file": "randovania/server/server_app.py",
"lines": "287",
"notes": "get_current_user calls python-socketio AsyncServer.get_session(sid) (server-side, in-memory per-sid session store, server provided by socketio_handler SocketManager in socketio.py:19). The user id is bound to the sid at login via sio.session(sid) in user_session.py:111-113 and restore_user_session (save_session, user_session.py:134). The FastAPI SessionMiddleware/Fernet x-randovania-session header (get_user, server_app.py:480) are self-contained client-side sessions and were not used."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "verify_has_admin",
"file": "randovania/server/multiplayer/session_admin.py",
"lines": "43",
"notes": "Called first by the action handlers dispatched from admin_session, e.g. _change_title (session_admin.py:341); it raises NotAuthorizedForActionError (session_admin.py:66) so the action does not run, and _handler returns the error to the subject. The decision is inline, so it is also cited as Decider. Caveat: DELETE_SESSION in admin_session (session_admin.py:467) runs without any verify_has_admin check."
},
{
"role": "Decider",
"status": "present",
"symbol": "verify_has_admin",
"file": "randovania/server/multiplayer/session_admin.py",
"lines": "43",
"notes": "Same method as the Authorisation enforcer (decision inline): gets the principal via get_current_user (session_admin.py:54), fetches the membership via get_membership_for (session_admin.py:55) and allows only if membership.admin or the user equals admin_user_id (or no admins exist when allow_when_no_admins). verify_has_admin_or_claimed (session_admin.py:69) is the analogous decider for world-level actions."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "get_by_ids",
"file": "randovania/server/database.py",
"lines": "537",
"notes": "Reached from verify_has_admin -> session_common.get_membership_for (session_common.py:28, call at line 40) -> MultiplayerMembership.get_by_ids, a peewee query of the MultiplayerMembership table (user, session) whose admin flag is the privilege; missing membership raises NotAuthorizedForActionError."
},
{
"role": "System",
"status": "present",
"symbol": "_change_title",
"file": "randovania/server/multiplayer/session_admin.py",
"lines": "340",
"notes": "Dispatched from admin_session (session_admin.py:423, CHANGE_TITLE branch) and runs the rename/save/audit only after verify_has_admin (session_admin.py:341) passes. Other admin actions (_change_password, _change_visibility, ...) follow the same structure."
}
]
}

Xet Storage Details

Size:
4.62 kB
·
Xet hash:
e05386a0db109fe0ff5219e11c2bb6338e52c8ffdd682d232a3859c57e8bb811

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