flowserv.service.user.base module

Interface for API methods that interact with the user manager.

class flowserv.service.user.base.UserService

Bases: object

Specification of methods that handle user login and logout as well as registration and activation of new users.

abstract activate_user(user_id: str) Dict

Activate a new user with the given identifier.

Parameters

user_id (string) – Unique user name

Return type

dict

abstract list_users(query: Optional[str] = None) Dict

Get a listing of registered users. The optional query string is used to filter users whose name starts with the given string.

Parameters

query (string, default=None) – Prefix string to filter users based on their name.

Return type

dict

abstract login_user(username: str, password: str) Dict

Get handle for user with given credentials. Raises error if the user is unknown or if invalid credentials are provided.

Parameters
  • username (string) – Unique name of registered user

  • password (string) – User password (in plain text)

Return type

dict

abstract logout_user(api_key: str) Dict

Logout given user.

Parameters

api_key (string) – API key for user that is being logged out.

Return type

dict

abstract register_user(username: str, password: str, verify: Optional[bool] = False) Dict

Create a new user for the given username and password. Raises an error if a user with that name already exists or if the user name is ivalid (e.g., empty or too long).

Returns success object if user was registered successfully.

Parameters
  • username (string) – User email address that is used as the username

  • password (string) – Password used to authenticate the user

  • verify (bool, default=False) – Determines whether the created user is active or inactive

Return type

dict

abstract request_password_reset(username: str) Dict

Request to reset the password for the user with the given name. The result contains a unique request identifier for the user to send along with their new password.

Parameters

username (string) – Unique user login name

Return type

dict

abstract reset_password(request_id: str, password: str) Dict

Reset the password for the user that made the given password reset request. Raises an error if no such request exists or if the request has timed out.

Returns the serialization of the user handle.

Parameters
  • request_id (string) – Unique password reset request identifier

  • password (string) – New user password

Return type

dict

abstract whoami_user(api_key: str) Dict

Get serialization of the given user.

Parameters

api_key (string) – API key for a logged-in user.

Return type

dict