Repository navigation
arisrv: a record of each client, its username and its connections, under a client id (ID1) - #1293
Merged
Merged
Conversation
This was referenced Nov 16, 2026
…der a client id (ID1) The relay now keeps a client_registry (docs/roadmap/ARISRV_IDENTITY.md, which this adds). Each client gets an id, "c" and 31 hex digits of a salted hash of its device id, or of its addresses when it sends none. Its record holds its username, its device tag, first and last seen, whether it is active, and a log of its last 32 connections (pid, transport, public and local address, opened, closed, active). The records are mirrored under arisrv.clients, outside conf and every publish: namespace, so no client is sent them; they last for this run only. profile.name is now the relay's. room_join on a relay asks for its name with server.set, and the relay writes it, unique among the active clients. server.whoami and server.set are reserved names that call_step answers itself, before a call can reach Python. Hello gains local_address (the client's own end, from a UDP socket connected toward the relay), and each link report its connection number, peer address and reported local address.
…eers in brackets From the arisrvx session's review of ID1: - A client that predates server.set (a packaged ari or arigl) writes its own profile.name. The gate still refuses that write, and now hands its value to the relay (room_write_gate:: set_name_requests), which grants it as a rename on the room loop, made unique. Such a client keeps its name instead of showing guest-xxxx. - Without bound writes there is no gate, so the relay leaves the names to the clients, as before. - Every server.* call first takes the links as they are, so a pid taken over since the last pass is its new holder's. - The WebSocket transport writes an IPv6 peer as "[::1]:5678", as gRPC does, so its port can be cut off. Before, "::1:5678" gave each connection of one client its own address.
transfix
force-pushed
the
feat/arisrv-identity
branch
from
November 16, 2026 06:01
37840b9 to
38a5793
Compare
…s server.* calls (ID2, ID3) (#1295) ID2: --guest-password-file / CVC_ARISRV_GUEST_PASSWORD takes any text a person can type. A client presents guest_password_bearer(password), a SHA-256 hash in the room token's slot, so the transports' check before admission does the work. A relay takes a room token or a guest password, not both. Clients take it from CVC_ARIADNE_GUEST_PASSWORD, a relay block's password:, or a page's #password=. ID3: --rcon-password-file / CVC_ARISRV_RCON_PASSWORD. server.rcon makes the caller's connection an admin until it closes or loses its pid. Wrong passwords lock out after three (rcon_guard). Without TLS, rcon is taken only from the loopback unless --rcon-plaintext. An admin's calls are server.clients, client, kick (state_transport::disconnect_connection), ban/unban, rename and limits (client_limits, in ServerDocument::set_client_limits's shape). In arisrvx an elevated connection's ctx.principal has the role admin, and ctest arisrvx_rcon_admin_role covers it. ARISRV_IDENTITY.md records D1-D4, with D2 settled: a client's limits may go above the document's caps, up to the ceiling.
# Conflicts: # src/cvc/CMakeLists.txt
# Conflicts: # src/arisrv/main.cpp # src/cvc/CMakeLists.txt
transfix
enabled auto-merge (squash)
November 19, 2026 00:59
… joining carries it arisrvx_bridge_arigl_* (#1302's bridged users) failed on this branch: arigl joined as Alice and posted at once, and the bridge's echo said "echo Alice_xlq7eb: hello hub", the pid, not "echo Alice: hello hub". server.set had succeeded, but the relay wrote a name only for a participant already present. The call came before the presence.joined that room-join wrote with it, so the name waited for the next net step, about 250 ms later. Before this branch, the client wrote its own name in the same batch as its presence. Now: - server.set writes the caller's profile.name at once (client_registry::write_name), present or not. The roster shows nobody until their presence.joined, so an early name shows nothing. - An older client's own name write, refused by the gate, is granted every room step, before the calls, instead of every net step.
transfix
added a commit
that referenced
this pull request
Nov 19, 2026
cy-pca/cvcpkg#624 republished boost, datachannel-wasm, freetype, libjpeg-turbo, libpng, lua, mujoco, mujoco3, qhull, tiff and vtk for wasm and wasm-mt, built with -fwasm-exceptions. libcvc still builds with JS exceptions until JX2, and the two don't link. #1293's physics replay failed because libboost_thread.a needs __cpp_exception. .github/scripts/pin-wasm-pre-jx1.sh runs after a wasm job installs its deps. For each pinned package the prefix holds, it re-installs the last bundle built the old way, with cvcpkg install --no-deps, then checks the lockfile. Seven jobs call it: physics replay, ports, wasm-guests, permissive geometry, ari terminal backend, arigl-web and ariglx-web. JX2 deletes the script and its calls.
# Conflicts: # src/cvc/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first part of the identity and admin work in docs/roadmap/ARISRV_IDENTITY.md, which this PR adds. It's stacked on #1283 (G4), because both touch arisrv's
call_step. It will be rebased onto master when #1283 lands.What it adds
A record of every client. The relay keeps a
client_registry, a caller-owned object in arisrv'smain(), with no singleton.cplus 31 hex digits of a salted SHA-256 of its device id. A client that sends no device id is hashed on its addresses instead.--clients-max,--client-log-max).Kept private. The records are mirrored under
arisrv.clients.*. That root is outsideconfand everypublish:namespace, so no client is ever sent it. The e2e test subscribes toarisrvand checks that nothing arrives.Usernames belong to the server.
participants.<pid>.profile.nameis now relay-owned (room_write_gate), and the relay writes it from the record.room_joinon a relay asks for the name withserver.set {username, unique: true}instead of writing it. In a mesh it still writes it itself.guest-xxxx. A returning client keeps its last name.The relay's own calls. These are reserved
server.*names, whichcall_stepanswers before a call can reach Python, in stock arisrv as in arisrvx:(room-call "server.whoami")returns{client_id, username, verified, device, admin};(room-call "server.set" (dict "username" "ana"))renames the caller;server.*name isnot_found.Transport changes:
Hello.local_address(field 5) carries the client's own end of the connection. It comes fromlocal_address_toward, which connects a UDP socket toward the relay, sends nothing, and reads the socket's local address. A browser sends "".state_link_reportnow has the connection's number, the peer address the relay saw, and the reported local address.Tests (Windows, Release, gRPC + WS)
client_registry_test, 13 cases:room_relay_integration_test:AClientsRecordComesFromItsLink: real gRPC and WS links carry the local address, the peer address and a connection number into the registry.RoomJoinAsksTheRelayForItsName.arisrv_identity_grpcandarisrv_identity_ws: stock arisrv againstari test, covering whoami, set, the refusals, and thatarisrv.*never reaches a client.profile.nameas the relay's.Not in this part
admininserver.whoamiis always false until then.host.clients,ctx.clientand@host.geolocate. The geo fields of the log come with ID4c.After review (37840b9)
The arisrvx session reviewed this. Changes:
server.set, such as a packaged ari or arigl, writesprofile.nameitself.room_write_gate::set_name_requests), which grants it on the room loop as a rename withunique.--bind-writes offthere's no gate, so the relay writes no names, as before.server.*call. Each call first updates the registry from the links as they are now. A pid taken over since the last pass then belongs to its new holder.[::1]:5678, as gRPC does.::1:5678couldn't have its port removed.RoomWriteGate.AClientsOwnNameWriteIsARenameRequesttest covers the gate. Retested: room_intrinsics, client_registry, state_transport_ws, the relay integration cases, andarisrv_identity_grpc/_ws.The bridged-users fix (0390dc8)
After master was merged in, #1302's
arisrvx_bridge_arigl_wsfailed: on CI it timed out, and locally both variants failed. arigl joined as Alice and posted at once, and the bridge's echo carried her pid instead of her name.The cause:
server.sethad succeeded, but the relay wrote names only for participants already present. The call arrived before thepresence.joinedthat room-join wrote with it, so the name waited for the next net step, about 250 ms later.The fix:
server.setnow writes the caller'sprofile.nameat once (client_registry::write_name), whether the caller is present yet or not.Reproduced and checked locally with arisrvx, pycvc and arigl built:
arisrvx_bridge_arigl_grpc/_wspass in 1.8 s each. So do the arigl room-call tests, all 60 arisrvx, arisrv, pycvc_ariadne and arix ctests (arisrvx_rcon_admin_roleamong them), and client_registry_test (21). The eight wasm reds are the cvcpkg bundle break that #1360 pins around.