Repository navigation
docs(cli): campus.audit auth structure — superadmin class, web key sign-in - #66
Merged
Merged
Conversation
…gn-in (#65) campus#916 (dev-only API-key sign-in for the audit web UI) and campus#929 (AUDIT_ADMINS redefined as the campus.audit superadmin class with can_view_traces/can_manage_keys) changed the service's auth structure; the CLI's docs and docstrings predated both and described the whole service as uniformly key-only. - README audit section: scope the key-only claim to /audit/v1, describe the web UI's separate gate (OAuth superadmins + dev-only key sign-in), add the scope-to-capability mapping, note the operator seed's actual scopes, and that a minted traces:read key also opens the dev browser trace viewer - audit/__init__.py, client.py, login.py docstrings: say "the audit API (/audit/v1)" where key-only is claimed; point the browser gate at campus#929/#916 - audit/keys.py docstring: the operator seed is the apikeys:* bootstrap class, not the only possible holder — minting does not validate scopes, and apikeys:write doubles as the web key- management capability - utils/output.py preamble comment: same /audit/v1 scoping No behavior change; suite 293 passed, ruff clean.
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 #65
Summary
Brings the CLI's campus.audit documentation and module docstrings in
line with the service's auth structure as of campus#916 (development-
only API-key sign-in for the web UI) and campus#929 (
AUDIT_ADMINSredefined as the campus.audit superadmin class with two named
capabilities). Several spots described the whole audit service as
uniformly key-only — true of
/audit/v1only — and none mentioned thecapability model.
Changes
campus auditcommand group — API-key auth, key management, trace queries #54)":versioned API (
/audit/v1, key-only Bearer — everything the CLItalks to) vs. the web UI's separate gate (campus-account
superadmins via
AUDIT_ADMINS, plus dev-only key sign-in)traces:read↔trace surfaces,
apikeys:write↔ key management, scope-by-scopeand not interchangeable;
apikeys:readalone admits no browsersession; superadmins hold both by being on the list
AUDIT_OPERATOR_API_KEYcarriesapikeys:read/apikeys:writeplus everytraces:*scopetraces:readkey also signs into thedev-environment browser trace viewer; revocation/re-scoping ends
the browser session on its next request; the path does not exist
outside development
campus_cli/audit/__init__.py,client.py,login.pydocstrings: "the audit API (/audit/v1)" where key-only is claimed,
with a pointer to the campus#929/#916 browser gate
campus_cli/audit/keys.pydocstring: the operator seed is theapikeys:* bootstrap class, but minting does not validate scopes, and
apikeys:writeis also the web key-management capability — hand oneout deliberately (verified against campus
weeklyapikeys.new())campus_cli/utils/output.pypreamble comment: same /audit/v1scoping
Facts cross-checked against campus
weeklyat a8465ed7 (includes bothPRs):
/audit/v1unaffected by the web gate;AUDIT_ADMINSunset orempty is fail-closed; the sign-in session stores key id + owner label
apikeys:read/write+traces:read/write/search.Testing
Docs and comments only — no behavior change. Suite: 293 passed,
ruff checkclean.Related
campus auditcommand group — API-key auth, key management, trace queries #54 — parentcampus auditcommand group; feat(cli): --journey flag forcampus audit traces search#63/feat(cli): --journey flag for campus audit traces search #64 —--journey