asobi_join_ctx (asobi v0.75.1)

View Source

Bounds on the client-supplied join context.

The context is opaque to asobi - only the game module interprets it - but it is still attacker-controlled input handed to game code, so its shape is constrained here: a flat map, binary keys, scalar values, no nesting.

asobi never interprets, echoes, or logs the context. See asobi_match:join/3.

Summary

Functions

Extract and validate ctx from a request payload.

Functions

parse/1

-spec parse(term()) -> {ok, map()} | {error, binary()}.

Extract and validate ctx from a request payload.

Absent context is {ok, #{}} rather than an error: most joins carry none, and a game that requires one rejects the empty map itself.

Takes term(), not map(): the caller passes a decoded JSON payload, and a client is free to send "payload": "a string", so a non-map reaching here is untrusted input rather than a caller bug.