Task Description: Implement a User Authentication System
You are required to develop a user authentication system that includes functionality for user registration, login, and logout. This system must manage user credentials securely and provide a way to validate users based on their credentials. The implementation should meet the following specific requirements to ensure that the provided test code passes:
User Registration:
Create a function register_user(username: str, password: str) -> bool that takes a username and password as input.
Ensure that the username is unique (not already registered).
Store user information securely using hashed passwords (e.g., use a library like bcrypt for hashing).
User Login:
Develop a function login_user(username: str, password: str) -> bool that checks if the provided username exists and whether the password matches the hashed password stored during registration.
If the credentials are valid, allow the user to log in (this could be tracked with a session or token).
User Logout:
Implement a function logout_user() -> None that allows the currently logged-in user to log out, clearing any session or token associated with their login.
Data Storage:
Utilize an in-memory dictionary to store user data during development. Each entry should map a username to its hashed password.
Ensure that user data persists in a way that may be easily extendable to a database in the future.
Error Handling:
The system should raise appropriate exceptions or return error messages for invalid actions, such as trying to register an already existing username or logging in with incorrect credentials.
Your implementation should be placed in the /app/ directory, organized in a way that clearly separates the user authentication logic from other application logic.