campus.auth: introspection (~150-240ms POST /auth/v1/root/) on every campus.api call — cache to cut submit-path latency

Open
#1,248 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

The issue concerns token introspection via POST /auth/v1/root/, called from campus.auth on every campus.api child span. Start by finding where campus.auth performs that introspection and how campus.api invokes it, then measure per-request call counts on the submit path. The issue offers two options, a short-TTL cache keyed by token hash or local verification of self-issued tokens, so the work needs a design decision first. Done means a chosen approach with a measured drop in introspection calls per journey.

Written by the indexing model from the issue text.

Description

Found by the 2026-11-24 prod classroom journey investigation.

Every campus.api child span pays a POST /auth/v1/root/ token-introspection round trip (~140–240 ms each, nested inside assignment/submission reads). Systematic product impact observed on prod:

  • POST /api/v1/submissions/{id}/submit: 1.8–4.4 s across 9 students (8–11 spans, each introspecting)
  • Assignment views with two broker calls: 2.5–3.6 s (max observed 25.8 s)

Proposal: short-TTL cache of introspection results (token-hash keyed) in campus.auth, or local verification of self-issued tokens, so a multi-span journey introspects once per token per N seconds rather than per call. Pairs with the classroom-side fix (single broker call per assignment view, filed on campus-classroom).

Dominant language
Python
Stars
0
Forks
2
Avg merge
39m
Merged PRs (30d)
235

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nyjc-computing/campus

All issues in nyjc-computing/campus

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.