50 lines
1.9 KiB
YAML
50 lines
1.9 KiB
YAML
openapi: 3.2.0
|
|
info:
|
|
title: Lincodex Code Runner API
|
|
version: 0.1.0
|
|
description: |-
|
|
Internal API of the own code runner. Only the Go backend calls it; it is
|
|
never exposed to browsers or to the public network.
|
|
|
|
Transport and authentication: the runner listens on a private network
|
|
interface of its dedicated host and serves HTTPS (TLS 1.3). Every
|
|
operation except the health routes requires `Authorization: Bearer
|
|
<token>`; the token is a shared random secret of at least 32 characters
|
|
that comes from the deployment secret store, never from this repository.
|
|
A missing or wrong token answers 401 `unauthenticated`. Plain HTTP exists
|
|
only behind an explicit development switch of the local Compose file.
|
|
|
|
Data minimization: a run carries only the language, the source code, the
|
|
limits, and the test groups. It has no candidate, account, attempt, or
|
|
task identifiers, names, or contacts. The run ID is a random UUID chosen
|
|
by the backend for idempotency; the runner keeps it only in memory.
|
|
|
|
Runs are asynchronous. SubmitRun accepts a run when a sandbox slot is free
|
|
and answers immediately; the caller polls GetRun until `state` is
|
|
`finished`. The runner does not queue runs: when every slot is busy it
|
|
answers 503 `runner_busy`, and the backend keeps the queue.
|
|
servers:
|
|
- url: /
|
|
security:
|
|
- bearerAuth: []
|
|
paths:
|
|
/healthz:
|
|
$ref: ./routes/healthz.yml
|
|
/readyz:
|
|
$ref: ./routes/readyz.yml
|
|
/v1/runs/{run_id}:
|
|
$ref: ./routes/runs.yml
|
|
components:
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
description: >-
|
|
Shared random service token sent as `Authorization: Bearer <token>`
|
|
over TLS. The runner compares it in constant time and never logs it.
|
|
Rotation replaces the secret on both sides; there are no per-user
|
|
tokens.
|
|
responses:
|
|
Problem:
|
|
$ref: ./components/responses.yml#/Problem
|