Skip to content

[python sdk] Expose Permissions and the remaining user auth methods #3726

Description

@ethanlin01x

Description

Follow-up to #3682, as scoped there. The Python SDK can now create, update, and delete users, but every user is created without permissions: create_user in foreign/python/src/client.rs hardcodes None for the permissions argument, and there is no way to grant or inspect permissions afterwards. update_permissions, change_password, and logout_user from the Rust UserClient trait (core/common/src/traits/user_client.rs) are also still unexposed, and UserInfoDetails returned by get_user has no permissions getter.

This means Python still cannot provision non-root service accounts end to end. A deployment script can create a user but cannot give it access to anything.

Affected area / component

Python SDK

Proposed solution

Mirror the Rust domain types (core/common/src/types/permissions/permissions_global.rs) as PyO3 classes and complete the UserClient surface:

  • Expose Permissions, GlobalPermissions, StreamPermissions, and TopicPermissions as Python classes. All fields are booleans plus two nested dicts (streams: dict[int, StreamPermissions], topics: dict[int, TopicPermissions]), so the mapping is mechanical.
  • Add the optional permissions parameter to create_user, replacing the hardcoded None.
  • Add update_permissions(user_id, permissions), change_password(user_id, current_password, new_password), and logout_user() on IggyClient.
  • Add a permissions getter on UserInfoDetails so granted permissions round-trip through get_user.

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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions