Repository navigation
feat(cli): campus grant commands + grant-model docs alignment (#50) - #51
Merged
Merged
Conversation
The authorization model moved under campus#883: management authority is a DB-backed grant row (administered via /auth/v1/grants/) AND the token scope, with an env-nominated super-admin root as the sole A8 exception. The env-var designations the CLI docs still teach are retired. - new `campus grant` group: list (the who-can-administer-what matrix), check, grant, revoke (confirmed), delete — backed by campus.auth.grants (requires campus-api-python#107; relock follows) - `campus auth status` shows the caller's grant rows when readable, degrading to an explanatory note otherwise (operators, the root and grants admins only), with --offline skipping the fetch - user/client command help and the README Token scopes section now state the row-AND-scope model, the root carve-out, and the clients-write cap instead of the retired env-var designations Note: unfiltered `campus grant list` currently 500s for the root (server-side assert-as-flow-control, campus#906); use --resource-type until that fix lands.
ngjunsiang
force-pushed
the
feat/50-grant-commands
branch
from
October 10, 2026 15:41
9087968 to
8173cce
Compare
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.
Addresses #50 for the campus#883 grant-store model (three parts, one PR):
1.
campus grantcommand grouplist(filters:--grantee-type/--grantee-id/--resource-type/--resource-id),check,grant,revoke(destructive-confirmed),delete— all with--dry-run/--json, backed bycampus.auth.grants(requires campus-api-python#107; lockfile relock PR follows merges). Client-side validation mirrors the server: exactly one of--level/--bits, vault rows must name a label.2.
campus auth statusgrant rowsWhen online and authenticated, status fetches the caller's rows (GET /grants/ filtered by grantee) and renders
Grant rows: users:write, clients:write— degrading to a dim note for the 403 case (rows are visible to the operator, the root, and grants admins only).--offlinenotes "not fetched". JSON addsgrants/grants_note.3. Docs alignment
README "Token scopes" section and
campus user/campus clientcommand help now state the actual model: grant row AND scope (either leg alone confers nothing), the root carve-out, the clients-write cap, and point atcampus grant list— replacing the retiredAUTH_ADMIN_USER_IDS/AUTH_USERS_ADMIN_USER_IDSnarrative.Known issue
Unfiltered
campus grant list500s for the super-admin root (server-side:list_grantsassertsresource_type is not Noneafter a gate #900 taught the root to pass) — bug being filed on campus; use--resource-typeuntil fixed.Tests: +14 (grants formatting/validation, status grant rows incl. offline/degradation), suite 211 passed, ruff clean. Smoke:
campus grant list --resource-type userslive as root returned the matrix;campus grant --helprenders.Closes #50.