Repository navigation
feat(auth): OAuth token revocation — POST /auth/v1/oauth/revoke (RFC 7009) - #80
Merged
Merged
Conversation
auth.oauth.revoke(token, client_id, token_type_hint=None) POSTs
/auth/v1/oauth/revoke, the endpoint campus-cli still raw-calls.
The server returns 200 {} regardless of token state (RFC 7009 §2.2);
errors (missing token, invalid client) surface as APIError subclasses
via raise_for_status.
Fixes #73
nycomp
force-pushed
the
feat/oauth-revoke
branch
from
October 4, 2026 01:47
f4e8835 to
f1455c5
Compare
This was referenced Oct 4, 2026
ngjunsiang
added this pull request to stack #86
October 4, 2026 03:05
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.
Summary
auth.oauth.revoke(token, client_id, token_type_hint=None)to the existingOAuthresource (paths under/auth/v1/oauth/...since the PR fix: bug sweep — timetable envelopes, session cleanup, oauth device flow #70 fix sweep).weekly(campus/auth/routes/oauth.py): leaf path/oauth/revoke, body{token, client_id}plus optionaltoken_type_hint(only sent when given).{}whether or not the token was active — errors (missing token → 400 invalid_request, unknown client_id → 400 invalid_client) surface asAPIErrorsubclasses throughraise_for_status(). The docstring warns callers not to read token validity from the response.Unblocks campus-cli, which currently raw-calls this endpoint (
campus_cli/auth/common.py).Tests
tests/unit/test_oauth_revoke.py— 2 contract tests pinning the POST path and the body with/without the hint. Full suite: 148 passed.Fixes #73