Skip to content

feat: admin API client and protocol selection (graphql/rest/grpc)#1

Merged
lakhansamani merged 2 commits into
mainfrom
feat/admin-apis
Jun 16, 2026
Merged

feat: admin API client and protocol selection (graphql/rest/grpc)#1
lakhansamani merged 2 commits into
mainfrom
feat/admin-apis

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

What

  • Admin API client (AuthorizerAdminClient + AsyncAuthorizerAdminClient) covering the full AuthorizerAdminService surface: admin auth/session/meta, users, access, webhooks, email templates, audit logs, and FGA admin. Auth via x-authorizer-admin-secret.
  • Protocol selection on the user and admin clients (sync + async): graphql (default), rest, grpc.

Why

Server 2.3.0-rc.9 (#635) serves all auth ops over gRPC/REST with a flat response envelope identical to GraphQL, enabling real protocol choice and a typed admin surface.

Notes

  • gRPC uses a separate endpoint (default :9091, grpc_endpoint=); deps are optional via pip install 'authorizer-py[grpc]'. Bearer/admin-secret sent as metadata.
  • REST decodes proto JSON (int64-as-string) via protobuf json_format.
  • Flat rc.9 envelope: graphql/rest/grpc return identical dataclasses.
  • Generated gRPC stubs vendored under authorizer/_grpc (self-contained; excluded from ruff/mypy).
  • respx unit tests stay green; adds a live integration suite sweeping all protocols (sync + async) and a CI live job (docker-run with CLI flags); adds examples/manual_test.py.

Add AuthorizerAdminClient / AsyncAuthorizerAdminClient over the
AuthorizerAdminService surface (users, access, webhooks, email templates,
audit, FGA admin) plus a `protocol` kwarg (graphql default, rest, grpc)
on the user and admin clients, sync and async.

- gRPC uses a separate endpoint (default :9091, `grpc_endpoint=`); deps
  optional via the `grpc` extra. Auth/admin-secret flow as metadata.
- REST decodes proto JSON (int64-as-string) via protobuf json_format.
- Flat rc.9 response envelope (PR #635), identical across transports.
- Vendor generated gRPC stubs under authorizer/_grpc (self-contained).
- respx unit tests + a live integration suite sweeping all protocols
  (sync + async); CI runs a live job; examples/manual_test.py.
@lakhansamani lakhansamani merged commit 6e390dc into main Jun 16, 2026
1 of 6 checks passed
@lakhansamani lakhansamani deleted the feat/admin-apis branch June 16, 2026 13:44
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.

1 participant