mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
Security: - The netplay socket server shared the main server's Redis channel while letting unauthenticated clients name their own rooms, so a netplay socket in room `user:N` or `admin` received that user's pushes and the admin log stream. Netplay now has a channel of its own. - Notifying other users also requires users.write on the token, so an admin token scoped to me.write can only notify its owner. - The create payload rejects NUL characters, NaN/Infinity in data and an empty recipients list instead of failing in the database; mark-read takes at most as many ids as an inbox holds. Correctness and cleanup: - The inbox is cleared whenever the signed-in user changes, so a failed fetch can't leave the previous user's notifications on screen. - Enter no longer sends the admin form, where an unfinished title would go out to everyone. - A notification without its own icon shows its level's, in the list and in a pushed toast alike, from one LEVEL_ICONS map. - One write-only Redis manager per event loop instead of one per push. - Tests for the inbox socket wiring; em-dashes and long docstrings trimmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
447 B
Python
10 lines
447 B
Python
from handler.socket_handler import netplay_socket_handler, socket_handler
|
|
|
|
|
|
def test_netplay_cannot_join_the_main_servers_rooms():
|
|
# Netplay clients are unauthenticated and name their own rooms, so an emit to
|
|
# `user:{id}` or `admin` must not reach a netplay socket that picked that name.
|
|
netplay = netplay_socket_handler.socket_server.manager
|
|
main = socket_handler.socket_server.manager
|
|
assert netplay.channel != main.channel
|