Repository navigation
feat(auth): Users.User.update() sends the rename-only PATCH - #105
Merged
Merged
Conversation
The campus server implements PATCH /users/{id} as rename-only
(nyjc-computing/campus-cli#42): a user's id IS its email, so identity
fields stay fixed and only {"name": ...} is accepted. Mirror it in
the SDK so campus-cli's user commands can call update() directly.
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.
Adds
Users.User.update(*, name: str) -> Userto the auth users resource, mirroring the server's PATCH /users/{id} contract implemented in nyjc-computing/campus#873 (campus-cli#42):/auth/v1/users/{id}/with exactly{"name": ...}— the server accepts name only (a user's id IS its email; identity fields stay fixed; activation runs through /activate)campus.model.Userfrom the response resourceTests:
tests/unit/test_auth_users.pyasserts the PATCH verb, exact body, path, and round-tripped model — same mock convention astest_auth_clients.py.Full suite:
poetry run pytest→ 276 passed.Part of the campus-cli#42 phase-2 client work (next: campus-cli
campus usersub-app).