Repository navigation
feat(cli): campus user * management commands (#42) - #46
Merged
Merged
Conversation
Adds the user sub-app: list/get/new/activate/edit/delete, backed by api.auth_users (campus_python.auth.v1.users). Each command's help names the users:* scope it requires — list/get: users:read, activate: users:mod, new/edit: users:write, delete: users:admin — and delete goes through the destructive-command confirmation (TTY-safe, --confirm or CAMPUS_ASSUME_YES). All commands support --dry-run like client/vault. Requires the server-side users:* vocabulary (nyjc-computing/campus#873) and Users.User.update() (nyjc-computing/campus-api-python#105) for edit. README documents the users scope tiers, the per-vocabulary designation env vars (invariant A8), and dry-run/confirmation coverage.
3 tasks
This was referenced Oct 9, 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.
Implements the CLI leg of #42: the
usersub-app with list / get / new / activate / edit / delete, completing the two-phase rollout.Commands and scope mapping
campus user list/getusers:readcampus user activate --user-idusers:modcampus user new --email --nameusers:writecampus user edit --user-id --nameusers:writecampus user delete --user-idusers:adminEvery command's help text names its scope, so a 403
Token lacks 'users:...'maps directly tocampus auth login --scope users:.... Delete routes through the shared destructive-action confirmation (TTY-safe;--confirm/-yorCAMPUS_ASSUME_YES=1). All commands support--dry-runlike client/vault.Dependencies (merge order)
Users.User.update()) —campus user editneeds this; the pyproject pinsbranch = "main", so relock after that merge.Tests
tests/unit/test_user.py: output-formatting matrix (datetime/ISO-string/None timestamps, identity fields), mirroringtest_client.py.campus --help), dry-runs render the equivalent campus-api-python snippets.Closes #42 (with #873 + #105).