T12: Marast provider + API exploration #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "t12-marast"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
T12: Marast provider (
fit.marast.assignments,fit.marast.courses) + API explorationStacked on #10 (
t11-grades) → … → #1. Merge those first.Exploring the API (the "+ explore API" part of T12)
GET /api/v1itself returns 404, which made the SPEC base URL look wrong. Probing with a bogus Bearer token andAccept: application/jsonshowed real routes answering401 Unauthenticated(/courses,/quizzes,/users/me,/notifications).https://marast.fit.cvut.cz/api/v1/swagger_doc. Snapshot:docs/marast-swagger.json. It lists every endpoint: quizzes, courses, lectures, problems, topics, notifications, roles, users/me, notes and comments. It has no response schemas.Api-Key/Api-User/Api-Passheader auth. The FIT scopeurn:ctu:oauth:marast:personalsuggests Bearer works too; to verify on the first real login.gitlab.fit.cvut.cz/marast/marast) is private, so field names are unknown. Everything is recorded indocs/apis.md.What
fit.marast.assignments({ upcoming = true, courseId? }): quizzes fromGET /quizzes. Withupcoming, it mergesonly_openandonly_future, de-duplicates and sorts by deadline. Otherwise it returns all of them. Output:id,name,courseId,opensAt,closesAt(ISO),status(upcoming/open/closed/unknown, computed againstctx.now()) andextra. Paginated at 100 per page, up to 5 pages.fit.marast.courses():GET /courses, fetched once since it declares no pagination. Gives thecourseIds for filtering.name|title|designation,starts_at|opens_at|…,ends_at|deadline|closes_at|…), and records without anidare skipped.extrais a strict allowlist of descriptive fields (description,max_points,attempts,time_limit, …), with strings truncated to 300 characters. Nothing else from upstream reaches clients.courseIdis validated as numeric.Verified
bun run lint && bun run typecheck && bun run test: 161 tests, 9 of them for Marast. They cover the merge, de-dup, sort and status, upcoming=false with a course filter, wrapped lists and pagination, the page cap, the allowlist (credential-like keys and a 100,000-character key never pass), courses fetched once, 401 →reauth_required, shape drift,courseIdinjection, and Czech and English search.bun run dev+curl /api/functionslists 9 functions.Astra review (gpt-6-astra)
Fixed (all three):
authorizationorprivate_key→ switched to a strict allowlist./courseswas requested five times and duplicated → fetched once. Test added.🤖 Generated with Claude Code