Expand description
Contains helper functions that are passed to headless-lms-models where it needs to make requests to exercise services.
StructsΒ§
- 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
- Legacy
Give πPeer Review Claim - Legacy
Grading πUpdate Claim - Legacy
Upload πClaim - Playground
Grading Callback Claim - Spec
Request - Accepted by the public-spec and model-solution endpoints of exercise services.
- Upload
Claim
ConstantsΒ§
- 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 - legacy_
timestamp_ πto_ claim_ number - make_
grading_ request_ sender - 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_
grading_ πupdate_ claim_ with_ legacy_ fallback - Validates grading update claim using modern JWT fields, with temporary fallback to legacy claims.
- validate_
hs256_ πclaim - Decodes and verifies an HS256 token into the requested claim type.
- validate_
hs256_ πlegacy_ claim - Decodes claims in compatibility mode and validates legacy
expiration_timemanually. - validate_
peer_ πreview_ claim_ with_ legacy_ fallback - Validates peer review claim using modern JWT fields, with temporary fallback to legacy claims.
- validate_
upload_ πclaim_ with_ legacy_ fallback - Validates upload claim using modern JWT fields, with temporary fallback to legacy claims.
Type AliasesΒ§
- Spec
Cache π - A type for caching the spec fetching (only for the seed)