Skip to content

feat(auth): Grants resource for the access-grant store - #107

Merged
ngjunsiang merged 1 commit into
mainfrom
feat/grants-resource
Oct 10, 2026
Merged

ngjunsiang merged 1 commit into
mainfrom
feat/grants-resource

Conversation

@ngjunsiang

Copy link
Copy Markdown
Contributor

Adds campus.auth.grants — the SDK pass-through for the /auth/v1/grants/ administration surface that epic nyjc-computing/campus#883 shipped (routes in campus/auth/routes/grants.py):

  • list(grantee_type=, grantee_id=, resource_type=, resource_id=) → {"grants": [...]} — the "who can administer what" matrix query; unfiltered lists require the operator
  • check(...) -> bool — GET /grants/check
  • grant(...) -> row — POST /grants/ (vault rows carry bits + resource_id; management rows carry level; never downgrades — revoke first)
  • revoke(...) -> row | None — POST /grants/revoke
  • delete(grant_id) — DELETE /grants/{id}

Rows are plain dicts (the server's AccessGrant resource; no campus.model class exists for it). First consumer: campus-cli#50's campus grant commands.

Tests: 8 contract tests in tests/unit/test_auth_grants.py (paths, query params, exact bodies, delete-verb path without trailing slash). Full suite: 298 passed.

Wraps the /auth/v1/grants/ administration surface (#883/#886): list
(the who-can-administer-what matrix, with filters as query params),
check, grant, revoke, and delete-by-id. Rows are plain dicts (the
server's AccessGrant resource; no campus model exists for it).
campus-cli#50's grant commands build on this.
@ngjunsiang
ngjunsiang merged commit 89df17e into main Oct 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant