Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add user management methods to py-client integration page #563

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

harminius
Copy link
Contributor

@harminius harminius commented Feb 20, 2025

Resolves #553

Describe new possibilities of the python client:

User creation

  • create_user

Projects API

  • list_project_collaborators
  • add_project_collaborator
  • update_project_collaborator
  • remove_project_collaborator

Workspaces API

  • list_workspace_members
  • get_workspace_member
  • update_workspace_member
  • remove_workspace_member

@harminius harminius requested a review from alex-cit February 20, 2025 12:50
@harminius harminius self-assigned this Feb 25, 2025
@harminius harminius requested a review from varmar05 February 25, 2025 11:01
@@ -40,24 +40,24 @@ client.create_user(<email>, <password>, <workspace_id>, <workspace_role>, [usern
```
Arguments:
`email` (str): Must be a unique email
`passowrd` (str): Must meet security requirements.
`passoword` (str): Must meet security requirements.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still typo :-)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

@alex-cit alex-cit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I left some comments/suggestions.

```

#### User and roles management
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this relevant only to the Python module or also to the Python command line interface? If both, this should be a subsection (### User and role management) and moved below the Python CLI subsection,

The #### level of subsection is in my opinion the last subsection level that looks okay. ##### subsections (that are used here) do not look very good when the page is compiled, so I would avoid using them. If it's necessary to structure the page this way, I would considering making separate pages for Python integration and C++ integration (to remove one level of subsections).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. the new commands are available only in the Python module so far. It'll be added to the CLI soon but the syntax is different anyway.
As the content will grow, the dedicated pages make sense.

client.create_user(<email>, <password>, <workspace_id>, <workspace_role>, [username], [notify_user])
```
Arguments:
`email` (str): Must be a unique email
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we try some other description instead of "unique email"? Maybe something like: "an email that is not yet used on the server" or "email not yet associated with an account"

Also, I would considering writing the data types in full (i.e. string, integer, etc.) to be consistent with this for instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1, sure - unique email is confusing, indeed
2, shall we put the arguments in the table like in the link?

@PeterPetrik
Copy link
Contributor

Copy link
Contributor

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @harminius for preparing the skeleton! 💪🏻 We will take it from here with @alex-cit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a comment here for our CE users what they need to do to use this API

`workspace_id` (int): The workspace ID where the user will be added.
`workspace_role`(str): The user’s role in the workspace. [See the roles options](../manage/permissions.md)
`username` (str, optional): Custom username; autogenerated if not provided.
`notify_user` (bool, optional): Flag for email notifications (invitations, access requests etc.). Default is `False`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`notify_user` (bool, optional): Flag for email notifications (invitations, access requests etc.). Default is `False`
`notify_user` (bool, optional): Sends a confirmation email to the `email` address and enables email communication for the new account (invitation emails, access request emails and more). Default is `False`.

@tomasMizera tomasMizera assigned tomasMizera and alex-cit and unassigned harminius Mar 25, 2025
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.

Add section to python-api-client about the new user and roles management
5 participants