Repository navigation
Add management API for services (token auth, datasets, studies, progress, results) - #102
Open
maubreville wants to merge 3 commits into
Open
maubreville wants to merge 3 commits into
maubreville wants to merge 3 commits into
Conversation
Token authentication plus endpoints to upload datasets, create studies, list UIs and groups, follow per-reviewer progress and fetch results as JSON. Session login and existing endpoints are unchanged (Session stays the first authenticator so unauthenticated requests still answer 403). All new endpoints are staff-only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Opening a study in the web app shows the reviewers' swipe view, which only members of the study's group can open (everybody else gets "404: No Study matches the given query"). Staff had no way to see how a study is doing. - GET /v1/studies/all/ (staff): every study with its progress - progress now includes study details and the distribution of the answers - auth status tells whether the user is staff - frontend: /admin/studies (list) and /admin/studies/:id (reviewer progress, answers, CSV/JSON results), linked in the menu for staff only - regenerated openapi.yaml and the typed client Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #101
What
Backward-compatible management API so services (here: the muROMI dataset manager) can create and follow studies:
rest_framework.authtoken;SessionAuthenticationstays first so unauthenticated requests still return 403, not 401)POST /v1/datasets/(zip upload, rejects non-zip),GET/POST /v1/uis/,GET /v1/groups/,POST /v1/studies/(validatesend_date > pub_date)GET /v1/studies/{id}/progress/– per reviewer: classified / finishedGET /v1/export/{id}/results/– latest answer per reviewer and image, JSONGET /v1/studies/all/, richerprogress(study details, answer distribution),staffin the auth status, and pages/#/admin/studiesand/#/admin/studies/:id(menu entry for staff only). Regenerateddocs/openapi.yamlandapi.v1.ts(yarn api+ eslint, so the diff is only the additions)Deploy notes
python manage.py migrate(creates the authtoken table)python manage.py drf_create_token <staff-user>for the serviceclient_max_body_sizeso batch archives can be uploadedTesting
manage.py test app.tests: 16 tests pass (10 new intest_manage.py: token required, non-staff refused, non-zip rejected, study creation, date validation, progress incl. "latest answer wins" and group members not yet started, results, overview of all studies, staff flag). Frontend:vue-tsc,eslintandvite buildpass; the overview pages were checked in Chrome against a local backend (staff see the menu entry and the data, a reviewer gets neither and a 403 from the API). Also exercised end to end with the muROMI dataset manager against a local instance (230 real crops, three simulated reviewers, automatic import).🤖 Generated with Claude Code