Expand description
Contains helper functions that are passed to headless-lms-models where it needs to make requests to exercise services.
Structs§
- Download
Claim - Authorizes the bearer to read one specific host-stored file for a while.
- Exercise
Service CsvExport Column - Column definition for exercise service CSV export; callers must use scalar-only cell values.
- Exercise
Service CsvExport Request - Exercise
Service CsvExport Response - Full CSV export response; columns define headers, results align by index. All cell values must be scalar.
- Exercise
Service CsvExport Result - One batch of CSV rows; each row’s values must be scalar (null, bool, number, string). Objects/arrays are rejected by the controller.
- Give
Peer Review Claim - Grading
Update Claim - JwtKey
- Playground
Grading Callback Claim - Spec
Request - Accepted by the public-spec and model-solution endpoints of exercise services.
- Upload
Claim
Constants§
- DOWNLOAD_
CLAIM_ PARAM - Query parameter carrying a
DownloadClaim; the claimed-file route repeats it in a rename. - EXERCISE_
SERVICE_ 🔒GRADING_ UPDATE_ CLAIM_ HEADER - EXERCISE_
SERVICE_ 🔒UPLOAD_ CLAIM_ HEADER - PLAYGROUND_
GRADING_ CALLBACK_ CLAIM_ PARAM
Functions§
- fetch_
service_ info - fetch_
service_ info_ fast - fetch_
service_ 🔒info_ with_ timeout - grading_
request_ 🔒files - The grading request’s file list for a submission’s answer: its files in answer order, empty for an answer that has none.
- make_
grading_ request_ sender - Sends a submission to an exercise service for grading, with the claims the service needs to report back and to read a file-typed answer’s files.
- make_
seed_ spec_ fetcher_ with_ cache - A caching spec fetcher ONLY FOR THE SEED that returns a cached spec if the same (url, exercise_service_slug, private_spec) is requested. Since this is only used during seeding, there is no cache eviction.
- make_
spec_ fetcher - Fetches a public/model spec based on the private spec from the given url. The slug and jwt key are used for an upload claim that allows the service to upload files as part of the spec.
- parse_
response_ 🔒json - Safely parses a response body as JSON, capturing the actual response body in error cases
- post_
exercise_ service_ csv_ export_ request - sign_
hs256_ 🔒claim - Signs any serializable claim payload as HS256 using the shared JWT secret.
- validate_
claim 🔒 - Decodes a claim, reporting a bad token as a request error rather than a JWT one.
- validate_
hs256_ 🔒claim - Decodes and verifies an HS256 token into the requested claim type.
Type Aliases§
- Spec
Cache 🔒 - A type for caching the spec fetching (only for the seed)