feat(audit): unscoped key-introspection endpoint (whoami)

Open
#946 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start by tracing the campus API route and its authentication middleware, which already resolves the key record, then review the referenced campus-api-python AuditRoot and CLI login.py:203-276 entry points. The proposal spans three repositories; done means a scope-less whoami endpoint returns only the authenticated key’s record, and the Python client and CLI use it for online login verification and status.

Written by the indexing model from the issue text.

Description

enhancement

Summary

CLI login verification is best-effort via apikeys.list, so a viewer-role key (no apikeys:read) can never be verified online, and campus audit status is purely local. Proposed: a scope-less GET endpoint (e.g. /audit/v1/whoami) authenticated by key possession alone — no @require_scopes — returning the resolved key record the middleware already loads (id, owner label, scopes, expires_at, rate_limit, last_used).

Why scope-less is safe

The endpoint reveals nothing beyond what possessing the key already proves; it is the Bearer analogue of the web sign-in's in-process verify() (#916). It must NOT accept the operator-seed exemption or anything broader — one identity, its own record.

Three-repo chain

campus route → campus-api-python method (AuditRoot.whoami) → campus-cli: online verification in campus audit login for keys of any role, and an online campus audit status (local today, login.py:203-276).

Idea carried from the 2026-10-21 end-state gap review (bullet 6).

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.