Repository navigation
Add read API and API key authorizer - #9
Merged
Merged
Conversation
Implements api.md section 7: cohort, class, module and concept summaries plus grouped progress over a period. Metrics for groups under five students are suppressed, no student identifiers are returned, and routes are throttled to 5 requests per second.
|
👋 Quick PR hygiene check (nothing is blocked):
Small PRs with short, clear descriptions are what judges and recruiters read. See |
This was referenced Nov 15, 2026
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.
What changed
Implements api.md section 7 (
read-api) andauthorizer-apikey:GET /read/cohorts,/cohorts/{id}/summary,/classes/{id}/summary,/modules/{id}/gain,/concepts/gain,/progress?groupBy=cohort|class|module|org&from=&to=.suppressed: truewith null metrics. A test checks that responses never contain student names or IDs.authorizer-apikey: key formatcic_<keyId>_<secret>, constant-time hash compare, scope and revocation checks, fails closed, 60 second cache, recordslastUsedAt.ReadApiconstruct with read-only table access, API key authorizer, and per-route throttling (5 rps, burst 10). Writing a test for the throttle found thatCfnStage.routeSettingsneeds PascalCase keys, which would have failed at deploy time.Why
CIC's org dashboard needs cohort stats without a login.
How to test
cd backend && npm test && npm run test:pyFor the admin API-key endpoint (section 2)
Key items must be
KEY#<keyId>/METAwithsecretHash(sha256 hex),scopes,label,createdBy,createdAt. The contract is in api.md section 7 and architecture.md section 6. Admin should also seedORG#<id>andCOH#<id>items withname.Stacked on #8. Merge in order: #5, #6, #7, #8, this.