aistore.sdk.authn.user_manager
aistore.sdk.authn.user_manager
Module Contents
Classes
Data
API
UserManager provides methods to manage users in the AuthN service.
Parameters:
The RequestClient used to make HTTP requests.
Returns the RequestClient instance used by this UserManager.
Helper function to convert a list of role names into a RolesList.
Parameters:
List of role names to convert.
Returns: RolesList
The corresponding RolesList object.
Raises:
ValueError: If any role name is not found.
Create a new user in the AuthN Server.
Parameters:
The name or ID of the user to create.
The password for the user.
The list of names of roles to assign to the user.
Returns: UserInfo
The created user’s information.
Raises:
AISError: If the user creation request fails.
Delete an existing user from the AuthN Server.
Parameters:
The username of the user to delete.
Ignore error if user does not exist. Defaults to False.
Raises:
ErrUserNotFound: If the user does not exist and missing_ok is False.AISError: If the user deletion request fails.
Retrieve user information from the AuthN Server.
Parameters:
The username to retrieve.
Returns: UserInfo
The user’s information.
Raises:
AISError: If the user retrieval request fails.
Get all users in the AuthN Server.
Returns: UserMap
A map of user IDs to their info in the AuthN Server.
Raises:
AISError: If the user list request fails.
Update an existing user’s information in the AuthN Server.
Parameters:
The ID of the user to update.
The new password for the user.
The list of names of roles to assign to the user.
Returns: UserInfo
The updated user’s information.
Raises:
ValueError: If neither password nor roles are provided.AISError: If the user update request fails.