Repository navigation
arisrv: an admin's server.limits apply to that client's programs and guests (ID4) - #1406
Merged
Merged
Conversation
…guests (ID4) An admin could already set a client's limits with server.limits (ID3). They were kept in the client's record and shown under limits.*, but nothing used them. #1296 (ID4a) added the hook, ServerDocument::set_client_limits, and this sets it in arisrv's main() from client_registry::limits(pid) (docs/roadmap/ARISRV_IDENTITY.md §2.6). - A programs or guests flag set false refuses the client that kind (forbidden). true allows only what the document already allows. - steps, time and memory_mb (in bytes; a huge value saturates) replace the document's caps where they aren't 0. Under D2 that means lower, or higher up to the action lane's caps, which the document enforces. - It's asked at each start, on the room loop's thread, so a change applies from the client's next program or guest. - At shutdown the callback is cleared before the registry it reads goes away. Test: ctest arisrv_client_limits runs stock arisrv with client_programs_server.ari (5000 steps) and rcon. The client makes itself an admin, then: - refuses its own programs (forbidden); - allows them again with t; - lowers its steps to 5, so a 40-addition program ends resource_exhausted; - sets steps back to 0, the document's, and the program runs again.
transfix
enabled auto-merge (squash)
November 20, 2026 21:08
transfix
disabled auto-merge
November 21, 2026 06:58
transfix
enabled auto-merge (squash)
November 21, 2026 06:58
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.
An admin could already set a client's limits with
server.limits(ID3, #1293). They were kept in the client's record and shown underlimits.*, but nothing applied them. #1296 (ID4a) added the hook,ServerDocument::set_client_limits. This PR sets it in arisrv'smain()fromclient_registry::limits(pid), asdocs/roadmap/ARISRV_IDENTITY.md§2.6 plans.What changes
programsorgueststo false refuses the client that kind of code (forbidden). Setting it to true allows only what the document already allows.steps,timeandmemory_mbreplace the document's caps where they aren't 0.memory_mbis converted to bytes, and a huge value saturates instead of overflowing. Under D2 a client's cap can be lower than the document's, or higher up to the action lane's caps, which the document still enforces.call_step). A change takes effect from the client's next program or guest, not one that's already running.ARISRV_IDENTITY.md's status line and §2.6 now describe this as built.Tests
New ctest
arisrv_client_limits: stock arisrv withclient_programs_server.ari(5000 steps) and--rcon-password-file. The client makes itself an admin, then:forbidden);t;resource_exhausted;With the callback disabled, cases c (
forbidden) and e (resource_exhausted) fail, so the test does catch a missing hook.Local runs, Windows Release on MSVC 14.44 (
build-identity):arisrv_client_limits,arisrv_rcon,arisrv_identity_{grpc,ws},arisrv_guest_password{,_refuses}andarisrv_room_call_program: 7/7 pass.rcon_admin_roleand arigl room-call tests: 14/14 pass.Not tested end to end: the
guestsbranch of the callback. The local tree has no wasmtime arisrvx, andServerDocumentTest.EachClientsLimitsCapItsGuests(#1296) covers guest caps at the document level.