126
126
than the real memory used. For this reason :const:`RLIMIT_AS` is currently set
132
IVLE provides a web based programming console, exposing similar features to
133
Python's command line console. It is built around python script
134
:file:`services/python-console` which opens up a socket to which `JSON`_
135
encoded chat requests can be made. A new console is typically from launched on
136
demand by the web client to the HTTP API, which in turn calls the wrapper
137
class :class:`ivle.console.Console` to start a new console in the user's jail.
139
.. _JSON: http://json.org
141
User Management Server
142
======================
149
*Chat* is our JSON_-based client/server communication protocol used in
150
communicating to `Python Console`_ processes and `User Management Server`_.
151
Since it is JSON-based it can be called from either Python or JavaScript.
155
The protocol is a fairly simple client/server based one consisting of a single
156
JSON object. Before communication starts a shared secret :const:`MAGIC` must
157
be known by both parties. The shared secret is then used to form a
158
'keyed-Hash Message Authentication Code' to ensure that the content is valid
159
and not been modified in transit.
161
The client request takes the following form::
168
where :const:`DATA` is any valid JSON value and :const:`HASH` is an string
169
containing the MD5 hash of the :const:`DATA` appended to :const:`MAGIC` and
172
The server will respond with a JSON value corresponding to the request.
173
If an error occurs then a special JSON object will be returned of the
179
"traceback": TRACEBACK
182
where :const:`NAME` is a JSON string of the exception type (such as
183
'AttributeError'), :const:`VALUE` is the string value associated with the
184
exception and :const:`TRACEBACK` is a string of the traceback generated by the
185
server's exception handler.
187
See :file:`ivle/chat.py` for details.