fix!: delete_user takes id, not email - #12
Merged
Conversation
Mirrors authorizerdev/authorizer#753. Email is not an identifier every account has — a phone-only signup has none — so an email-keyed delete could not reach those accounts at all, and there was no second way in. Both integration call sites already had the id in scope (user_id and signup.user.id), so no extra lookup was needed to migrate them. BREAKING CHANGE: DeleteUserRequest.email is replaced by DeleteUserRequest.id. Requires server 2.4.0+ and authorizer-proto 0.2.0rc1+.
rc1 replaced DeleteUserRequest.email with .id and this SDK builds the id form, so the floor moves with the break. The previous >=0.2.0rc0 floated across it: an older SDK release would resolve rc1 and fail at the delete call.
Contributor
Author
|
Pushed This closes the version-skew hole I flagged in the PR description. The old Re-verified against the real published package, not the local checkoutFresh venv,
Ready to merge from my side. |
The live job pinned rc.13, which still has DeleteUserRequest.email. Since delete_user now sends id, that server rejects it with 'unknown field' — real version skew, not a test bug. rc.16 is the first RC with the id-only field.
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.
Mirrors the server-side breaking change in authorizerdev/authorizer#753.
_delete_userwas keyed on email. Email is not an identifier every account has — a phone-only signup has none — so an email-keyed delete could not reach those accounts at all, and there was no second identifier accepted. Those accounts were permanent.Change
Both sync and async
delete_userserialise viareq.to_dict(), so the dataclass is the whole surface — no client, dispatch, or query changes needed. The method docstrings never named email, so they stand.Both integration call sites already had the id in scope, so migrating them needed no extra lookup:
test_live.py:553—user_idwas already bound fromsignup.user.idfor the org-member assertionstest_live.py:694— usessignup.user.iddirectlyBREAKING
DeleteUserRequest(email=...)→DeleteUserRequest(id=...). Requires server 2.4.0+; the server removed the field rather than accepting both.authorizer-proto>=0.2.0rc0with no upper bound. The companion regeneration (authorizerdev/authorizer-proto-python#2, bumped to0.2.0rc1) is itself breaking, so the floating minimum means an older SDK release will also pull it and break at the call site. This PR fixes the call site here, but the spec does not prevent the skew. Suggest a bound.Verified
Run in a clean venv with
.[dev]:pytest— 117 passedmypy src— no issues in 12 source filesruff check src tests— all checks passedtests/integration/test_live.pyparse-checked (needs a live server to run)