aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tomcat/catalina-ha.jar
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-10-11 10:35:20 +0300
committerKostya <mail@sartin.in>2026-10-11 10:35:48 +0300
commit1cb67cec8951553fdb5969d947e49f2288f3847f (patch)
treed5ed5cb64692e81514484c127a9cad86161b26c6 /lib/tomcat/catalina-ha.jar
parent6f0ab9c9a20b96890ed60bc168b28d29f5db39e5 (diff)
downloadguess-market-1cb67cec8951553fdb5969d947e49f2288f3847f.tar.gz
guess-market-1cb67cec8951553fdb5969d947e49f2288f3847f.tar.xz
guess-market-1cb67cec8951553fdb5969d947e49f2288f3847f.zip
server: add event and order endpoints
Expose the market to logged-in clients: - GET /api/events lists every event, GET /api/events/{name} returns one event's details, order books, trades and participants. - POST /api/events/{name}/open and /resolve (form field "option") open and settle an event. The engine's openEvent does not know who is asking, so the servlet checks the caller is the event's Market Maker and answers 403 otherwise, for both actions. - POST /api/orders places a buy or sell order as the logged-in user, never as a name the client sends. Events are addressed by their URL-encoded name, which is their identity in v3. Request input is checked before it reaches the engine. The engine treats any side other than SELL as a buy, takes any quantity, and Event.getOption throws on an unknown key, so all of these would have turned client mistakes into wrong trades or 500 errors. Above all, settling on an unknown winning option would close the event and pay nobody. The servlets reject these as 400s. Login is checked inside each servlet through Sessions.requireUser rather than in a second filter: the order of annotation-registered filters is unspecified, and an auth filter running before CorsFilter would send 401s without CORS headers, which browsers report as network errors.
Diffstat (limited to 'lib/tomcat/catalina-ha.jar')
0 files changed, 0 insertions, 0 deletions