harbor run -t openthoughts/tasktrove-exp-rpt-e2egit-v2-e2egit-0108harbor download openthoughts/tasktrove-exp-rpt-e2egit-v2-e2egit-0108Task Description: Implement a User Authentication System
You need to implement a user authentication system in the /app/ directory that includes functionalities for user registration, login, and logout. The system should manage user credentials securely and provide an interface for users to interact with their sessions.
User Registration:
register_user(username: str, password: str) -> bool that:
username is unique (not already taken by another user).password using a secure hashing algorithm (e.g., bcrypt) before storing it.True if registration is successful and False if the username is already taken.User Login:
login_user(username: str, password: str) -> bool that:
username exists in the system.True if login is successful and False otherwise.User Logout:
logout_user(username: str) -> bool that:
True if logout is successful and False if the user is not logged in.Session Management:
Test Cases:
Make sure to document your code and indicate the expected format for inputs and outputs clearly. The authentication system should be modular, and all functionalities should be easily testable.