Skip to content

bug: auth.clients[...].update() uses PUT but the auth API only implements PATCH (always 5xx) #49

Description

@nycomp

Description

campus_python.auth.v1.clients.Client.update() sends its request with PUT, but the Campus auth service only implements PATCH on /clients/{client_id}/. Every call to update() therefore fails with a server error, even when the identical request succeeds as a PATCH.

Discovered while registering redirect_uris on a client to prepare for campus#651 (redirect_uri enforcement).

Steps to Reproduce

api.auth_clients["uid-client-xxxx"].update(redirect_uris=["http://localhost:5000/finalize_login"])

against the development deployment (campusauth-development.up.railway.app), verified 2026-09-30:

  • Wrapper call fails consistently (2/2 attempts) with campus_python.errors.ServerError: An unexpected error occurred (5xx from the server).
  • Raw PATCH /auth/v1/clients/uid-client-xxxx with the identical JSON body {"redirect_uris": [...]} returns 200 and the change persists.

Expected Behavior

update() should succeed; the campus auth clients routes (campus/campus/auth/routes/clients.py) register GET/POST/PATCH/DELETE for /clients/{client_id}/ and have no PUT route.

Actual Behavior

campus_python/auth/v1/clients.py Client.update() (~line 118) calls:

resp = self.client.put(self.make_path(), json=json_data)

which 5xx-s on the current development deployment.

Suggested Fix

Change self.client.put(...) to self.client.patch(...) in Client.update().

Environment

  • campus-api-python 0.3.0 (installed from main)
  • Python 3.11.9, Windows 11

Activity

  1. nycomp commented on Oct 1, 2026

    @nycomp
    ContributorAuthor

    Fixed by PR #51 (c1d4a78) and verified 2026-10-01: the same auth_clients[id].update(redirect_uris=[...]) call that 500'd twice yesterday now returns 200 via campus-cli's client update --redirect-uri; readback confirms the URIs persisted on the development deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions