Skip to main content

Module api

Expand description

The moocfi endpoints, one stage boundary at a time.

Order per request, as Suotarโ€™s middleware runs it: the JSON body parse (size, then syntax), the credential, the envelope and item validation, the item-keyed load, the auth/requestGate/ parse faults, resolve request-level then per item, then afterWrite and respond. The write-back commits before the response โ€” or its deliberate absence โ€” leaves the process, which is what makes a timeout that landed distinguishable from one that did not.

Macrosยง

endpoint_handlers ๐Ÿ”’
Actix binds one handler per route, so the endpoint each route serves is all these differ by.

Structsยง

Answer ๐Ÿ”’
What a request is answered with, and what its call-log entry records about the answer.
FaultRunner ๐Ÿ”’

Enumsยง

Body ๐Ÿ”’
Delivery ๐Ÿ”’
ParsedBody ๐Ÿ”’
What Expressโ€™s JSON parser made of the body before any route ran.
ParsedRequest ๐Ÿ”’
Import resolves as a batch; every other endpoint answers item by item.
PerItemRequest ๐Ÿ”’

Constantsยง

IMPORT_STRING_FIELDS ๐Ÿ”’
MAX_BODY_BYTES ๐Ÿ”’
Expressโ€™s 5mb.
RAW_BODY_LIMIT ๐Ÿ”’

Functionsยง

answer ๐Ÿ”’
Resolves one request against the working set, which the caller then commits along with call.
authorized ๐Ÿ”’
completion_key ๐Ÿ”’
Suotarโ€™s intra-batch duplicate key. The enrolment and the language are deliberately not in it.
credential_accepted ๐Ÿ”’
Exactly Bearer <token>: case-sensitive, one space, no other scheme.
deliver ๐Ÿ”’
endpoint ๐Ÿ”’
enrich_verify_addresses ๐Ÿ”’
fall_through
Anything under the prefix that no route serves, including a wrong method. A valid key falls through to Suotarโ€™s internal routes, whose refusal is a bare string rather than the envelope.
import_attainments
is_strict_date ๐Ÿ”’
Momentโ€™s strict YYYY-MM-DD: that exact shape, and a day the calendar has.
item_effect_response ๐Ÿ”’
item_problem ๐Ÿ”’
The endpointโ€™s own item check, worded and ordered as Suotarโ€™s.
leave_unconfirmed ๐Ÿ”’
A send that never answered: the submission exists but Sisuโ€™s acceptance was never recorded.
list_by_course
load ๐Ÿ”’
non_empty_string ๐Ÿ”’
parse_body ๐Ÿ”’
parse_envelope ๐Ÿ”’
Suotarโ€™s envelope checks in its order; Ok(None) is the empty batch, answered with [].
pre_route_rejection ๐Ÿ”’
The body parser runs before the credential check, so its failures win over a missing key.
read_body ๐Ÿ”’
Stops reading past the limit, so an oversized body costs no more than the limit.
resolve_enrolments
resolve_import_batch ๐Ÿ”’
Resolves an import batch and writes what survived its checks, returning each itemโ€™s answer and the submission it wrote. Err is the request-level answer that replaces the whole batch.
resolve_persons
resolve_world ๐Ÿ”’
run ๐Ÿ”’
terminal ๐Ÿ”’
None for an item-shaped effect, which shapes one item rather than the whole answer.
truncate ๐Ÿ”’
typed ๐Ÿ”’
Cannot fail on an item that passed item_problem; the message is for the day the two drift.
unique_field ๐Ÿ”’
Collects the distinct values of one field across a requestโ€™s items, in first-seen order.
validate_course_codes
verify_attainments