Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
docker run -d --name authorizer \
-p 8080:8080 -p 9091:9091 \
quay.io/authorizer/authorizer:2.4.0-rc.13 \
quay.io/authorizer/authorizer:2.4.0-rc.16 \
--database-type=sqlite --database-url=test.db \
--jwt-type=HS256 --jwt-secret=test \
--admin-secret=admin --client-id=ci-client --client-secret=secret \
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ classifiers = [
# grpc-gateway responses with protojson (int64-as-string + single-field wrappers)
# using those message types. grpcio is only needed for the optional ``grpc``
# protocol (pulled via authorizer-proto[grpc]).
dependencies = ["httpx>=0.24,<1", "protobuf>=4", "authorizer-proto>=0.2.0rc0"]
#
# authorizer-proto is pinned at >=0.2.0rc1: rc1 replaced DeleteUserRequest.email
# with .id, and this SDK's delete_user builds the id form. An older SDK paired
# with rc1 (or this SDK with rc0) breaks at that call, so the floor moves with
# the break rather than floating across it.
dependencies = ["httpx>=0.24,<1", "protobuf>=4", "authorizer-proto>=0.2.0rc1"]

[project.optional-dependencies]
grpc = ["authorizer-proto[grpc]>=0.2.0rc0", "grpcio>=1.60", "protobuf>=4"]
grpc = ["authorizer-proto[grpc]>=0.2.0rc1", "grpcio>=1.60", "protobuf>=4"]
dev = [
"pytest>=7",
"pytest-asyncio>=0.23",
Expand Down
5 changes: 4 additions & 1 deletion src/authorizer/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ class UpdateUserRequest(_Request):

@dataclass
class DeleteUserRequest(_Request):
email: str
# BREAKING (server 2.4.0): this took `email` and now takes `id`. 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.
id: str


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def test_admin_org_member_lifecycle(
).message
finally:
admin.delete_organization(t.OrganizationRequest(id=org.id))
admin.delete_user(t.DeleteUserRequest(email=email))
admin.delete_user(t.DeleteUserRequest(id=user_id))


def test_admin_org_domain_lifecycle(admin: AuthorizerAdminClient, protocol: str) -> None:
Expand Down Expand Up @@ -691,4 +691,4 @@ def test_webauthn_options_and_credentials(
assert isinstance(creds, list)
assert creds == [] # nothing registered yet
finally:
admin.delete_user(t.DeleteUserRequest(email=email))
admin.delete_user(t.DeleteUserRequest(id=signup.user.id))
2 changes: 1 addition & 1 deletion tests/test_admin_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_delete_user_destructive_message() -> None:
return_value=Response(200, json={"data": {"_delete_user": {"message": "deleted"}}})
)
with _admin() as c:
assert c.delete_user(t.DeleteUserRequest(email="a@b.com")).message == "deleted"
assert c.delete_user(t.DeleteUserRequest(id="usr_123")).message == "deleted"


@respx.mock
Expand Down
Loading