Skip to content

[python sdk] Add functions related to user management #3682

Description

@ethanlin01x

Description

The Python SDK currently has no user management capability beyond login_user. Comparing the Rust SDK client traits (core/common/src/traits/user_client.rs) against the PyO3 bindings in foreign/python/src/client.rs, the entire rest of the UserClient surface is unexposed: there is no way to list, inspect, create, update, or delete users from Python.

This blocks any Python application that needs to provision users programmatically (e.g. setting up service accounts in deployment scripts) — today that requires dropping down to the CLI or another SDK.

Affected area / component

Python SDK

Proposed solution

Add the CRUD subset as async methods on IggyClient, wrapping the corresponding Rust SDK functions with PyO3, consistent with how the existing topic and consumer group methods are exposed:

  • get_user(user_id) / get_users()
  • create_user(username, password, status)
  • update_user(user_id, username=None, status=None)
  • delete_user(user_id)

This also means exposing UserInfo, UserInfoDetails, and the UserStatus enum as Python classes.

Scope cut: create_user takes permissions: Option<Permissions> on the Rust side. Permissions is a nested structure that deserves its own type mapping, so this issue always passes None and leaves the parameter unexposed. I'll handle Permissions (together with update_permissions, change_password, and logout_user) in a follow-up issue.

Deliverables: implementation, e2e tests in foreign/python/tests/test_user.py, regenerated apache_iggy.pyi stubs, all pre-commit hooks passing.

Alternatives considered

No response

Contribution

  • I'm willing to submit a pull request to implement this feature

Good first issue

  • I think this could be a good first issue for a new contributor

Metadata

Metadata

Assignees

Labels

pythonPull requests that update Python code

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions