Skip to content

fix(auth): send PATCH for client updates (issue #50) - #51

Merged
ngjunsiang merged 1 commit into
mainfrom
bugfix/clients-update-put-to-patch
Sep 30, 2026
Merged

ngjunsiang merged 1 commit into
mainfrom
bugfix/clients-update-put-to-patch

Conversation

@nycomp

@nycomp nycomp commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #50

Summary

Clients.update() sent PUT, but the campus auth server registers client update as PATCH-only (campus/auth/routes/clients.py:241) and has no PUT routes at all — every clients[client_id].update(...) call failed with 405 Method Not Allowed against current campus weekly.

This PR switches the verb to PATCH and pins the wire contract with unit tests:

  • update() sends PATCH /auth/v1/clients/{client_id}/ and never PUT;
  • the PATCH body carries only the fields being updated (partial-update semantics);
  • the response deserializes into campus.model.Client.

Verification

  • Full unit suite: 93 passed.

Impact

Unblocks campus client update (campus-cli) and the campus-admin clients-page edit action, and is a prerequisite for the redirect_uris registration work tracked by nyjc-computing/campus#651.

Clients.update() sent PUT, but the campus auth server registers client
update as PATCH-only and has no PUT routes, so every client update
failed with 405 Method Not Allowed. Switches to PATCH and pins the verb
and partial-body contract with unit tests.
@ngjunsiang
ngjunsiang merged commit 7e0b450 into main Sep 30, 2026
2 checks passed
@nycomp
nycomp deleted the bugfix/clients-update-put-to-patch branch October 1, 2026 00:34
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.

Clients.update() sends PUT but the campus auth server route is PATCH-only (405 on every client update)

2 participants