Skip to content

arisrv: a guest password, and rcon for one connection with the admin's server.* calls (ID2, ID3) - #1295

Merged
transfix merged 4 commits into
feat/arisrv-identityfrom
feat/arisrv-rcon
Nov 16, 2026
Merged

transfix merged 4 commits into
feat/arisrv-identityfrom
feat/arisrv-rcon

Conversation

@transfix

@transfix transfix commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

These are the next two parts of docs/roadmap/ARISRV_IDENTITY.md: ID2, the guest password, and ID3, rcon and the admin calls. They're stacked on #1293 (ID1), which is stacked on #1283.

ID2: the guest password

  • arisrv --guest-password-file PATH, or CVC_ARISRV_GUEST_PASSWORD, is any text of 1 to 256 bytes that a person can type. It is never taken from the command line.
  • A client presents guest_password_bearer(password) (state_identity.h): 64 hex digits of SHA-256 over cvc-guest-password/1, a NUL and the password.
  • That fits the room token's slot on both transports and keeps the password off the wire. The relay expects it exactly where it expects a room token, so the existing pre-admission check does the work and neither transport changed.
  • A relay takes a room token or a guest password, not both.
  • With an @host.authenticate hook, the hook decides, as it does for the room token.
  • Clients:
    • CVC_ARIADNE_GUEST_PASSWORD, for ari and the x hosts with --relay, and for arigl;
    • a relay block's password: env:NAME | file:PATH, which can't be combined with token:;
    • a browser page's #password=, through its config's fragment_env.
  • Changing the password at run time is left out. The transports take their token when they start.

ID3: rcon

  • --rcon-password-file PATH, or CVC_ARISRV_RCON_PASSWORD, turns rcon on.
  • (room-call "server.rcon" P) makes the caller's connection an admin. It's keyed by the link that holds the pid, so it ends when that connection closes or another link takes the pid over, and each new connection logs in again. server.rcon-logout takes it back.
  • Wrong passwords go through rcon_guard:
    • after 3 from one address, or by one client, it locks for 30 s, then twice as long after each further one, up to an hour;
    • each failure is counted in the record, and logged by client id and address, never the password.
  • Without TLS, rcon is taken only from the loopback, unless --rcon-plaintext is given.
  • The admin's calls, all forbidden otherwise. ID is a client id, or a pid:
    • server.clients and server.client ID;
    • server.kick ID, through a new state_transport::disconnect_connection(number) on both transports;
    • server.ban ID and server.unban ID: a banned client's connections are closed as each pass sees them;
    • server.rename ID NAME;
    • server.limits ID {...}: the per-client caps that ID4a will apply. Keys and types are checked here.
  • In arisrvx, an elevated connection's ctx.principal["roles"] include "admin" (a copy of the principal), so @export(roles=["admin"]) is an admin command too.
  • A link report now says whether its connection is TLS (secure).

Tests (Windows, Release)

  • client_registry_test, now 20 cases:
    • elevation, keyed to its connection;
    • what rcon checks about the holder;
    • a ban across reconnections;
    • an admin's rename;
    • limits, checked and cleared;
    • the admin's views;
    • RconGuard.
  • state_identity_test: the guest password and its bearer.
  • New ctests against stock arisrv and ari test:
    • arisrv_guest_password: the password, with spaces in it, lets a client in;
    • arisrv_guest_password_refuses: a wrong password is refused before admission;
    • arisrv_rcon: admin calls are forbidden, a wrong password is counted, the right one elevates, then records, rename, limits and logout work.
  • The ID1 ctests and the 14 neighbour suites pass again. All were run on this branch.
  • arisrvx's main.cpp (with CVC_ARIADNE_PYTHON on) and arigl's main.cpp were syntax-checked (/Zs) against this tree with other local trees' compile commands, because the local build has neither Python nor arigl.

After review (rebased on #1293's 37840b9, then 4746c24)

rcon's admin role in arisrvx (9e88ba8)

arisrvx_rcon_admin_role runs arisrvx with --rcon-password-file and a program whose @export(roles=["admin"]) only an admin may call. It checks three things:

  • the call is forbidden before server.rcon;
  • after rcon, it answers with admin in ctx.principal["roles"];
  • it is forbidden again from the same client's next connection. The client closes its own connection with server.kick, the --relay join redials, and whoami's admin is false.

The arisrvx session ran this commit in a Windows Release build with Python 3.12, pycvc and wasmtime 45. All 161 tests matching arisrv|pycvc_ariadne|RoomRelay|RoomCall|RoomIntrinsics|RoomWriteGate|StateIdentity|ClientRegistry|ServerDocument|ServerBlock|WasmClientGuest|ScriptLane|ScriptEngine pass, arisrvx_rcon_admin_role among them.

…s server.* calls (ID2, ID3)

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 that fits the room token's slot,
and the relay expects it there, 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: (env:/file:), or a page's #password=.

ID3: --rcon-password-file / CVC_ARISRV_RCON_PASSWORD. (room-call "server.rcon" P) makes the
caller's connection an admin until it closes or loses its pid; server.rcon-logout takes it back.
Wrong passwords lock an address or a client out after three, for 30 s and then twice as long each
time (rcon_guard), and are counted in the record. Without TLS, rcon is taken only from the
loopback unless --rcon-plaintext. An admin may call server.clients, server.client, server.kick
(state_transport::disconnect_connection), server.ban / server.unban, server.rename and
server.limits (ID4's per-client caps, checked and kept). In arisrvx an elevated connection's
ctx.principal has the role admin. Link reports say whether a connection is TLS.
…view

From the arisrvx session's review, and Joe's answers to both sessions:

- client_registry keeps a client's limits as client_limits (programs and guests as optional
  booleans; steps, time and memory_mb, where 0 is the document's), and limits(pid) returns them
  as an optional. That is what ServerDocument::set_client_limits (#1296) reads.
- concurrency and python are not keys. Programs and guests run one at a time per client, and ID4c
  adds python.
- The doc:
  - #1290's ledger keys on the principal or the verified device tag, never the client id;
  - packaged clients keep their names;
  - #1296's seam as built;
  - client Python needs a WASI CPython, not W5's Emscripten build;
  - parts are named by session;
  - D2 is being confirmed, since Joe answered the two sessions differently.
ctest arisrvx_rcon_admin_role exercises arisrvx with --rcon-password-file and a program whose
@export(roles=["admin"]) only an admin may call:
- the call is forbidden before server.rcon;
- after it, the call answers with "admin" in ctx.principal["roles"];
- it is forbidden again from the same client's next connection. The test opens that connection by
  closing its own with server.kick, after which the client dials again.

Only a build with arisrvx registers it.
…ove the document's caps, up to the ceiling

Joe confirmed to the arisrvx session "Yes, up to ceiling", as he had told the identity session.
#1296 sets kClientLimitsAboveDocument = true.
@transfix
transfix merged commit 2593bb1 into feat/arisrv-identity Nov 16, 2026
6 of 7 checks passed
@transfix
transfix deleted the feat/arisrv-rcon branch November 16, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant