No description available
pip install fastpluggy-auth-user
pip install fastpluggy-auth-user==0.0.4
The Auth User plugin provides comprehensive user authentication and management functionality for FastPluggy applications.
✅ PRODUCTION READY FEATURES:
- Complete admin interface for user management (CRUD operations)
- User authentication with secure password hashing
- Session management with configurable expiration
- User profile pages with authentication protection
- Automatic admin user creation on first install
- Menu integration for user functions
⚠️ PARTIALLY IMPLEMENTED:
- Login routes (exist but commented out - ready for activation)
📋 ROADMAP: See Implementation Roadmap for detailed development plan.
The main user model with the following fields:
- username: Unique username (String, 255 chars)
- hashed_password: Securely hashed password (String, 255 chars)
- is_admin: Boolean flag indicating admin privileges (default: False)
Session management model for user authentication:
- session_id: Unique session identifier (String, 255 chars)
- session_data: JSON data stored in the session
- session_lifetime: Session expiration timestamp
- session_time: Session creation timestamp
The plugin uses AuthUserConfig class with the following settings:
from fastpluggy.core.config import BaseDatabaseSettings
from typing import Optional
class AuthUserConfig(BaseDatabaseSettings):
# Set to None to enable UI-based setup on first install
# If None, admin user creation will be handled via setup UI
default_admin_username: Optional[str] = None
default_admin_password: Optional[str] = None
login_template: str = 'auth_user/login.html'
The plugin provides intelligent admin user setup with two approaches:
By default, default_admin_username and default_admin_password are set to None, which enables the setup UI:
/setup/ to create the first admin userIf you prefer automatic admin creation, configure default credentials:
# In your environment or config
default_admin_username = "your_admin_username"
default_admin_password = "your_secure_password"
When configured, the plugin will automatically create the admin user on first startup.
/setup//setup/ to create admin user with custom credentialsYou can check if setup is needed programmatically:
from fastpluggy_plugin.auth_user.src.repository import needs_initial_setup
from fastpluggy.core.database import get_db
if needs_initial_setup(get_db()):
print("Setup required - visit /setup/")
else:
print("Admin user exists")
GET /setup/ - Initial admin user setup page (only accessible when no users exist)POST /setup/ - Process admin user creation formGET /setup/check - API endpoint to check if setup is neededGET /logout - Logout user and clear sessionGET /profile/ - User profile page (requires authentication)The plugin automatically adds the following menu items:
- Profile (/profile/) - User profile page
- Logout (/logout) - Logout functionality
The plugin expects the following Jinja2 templates:
- auth_user/profile.html.j2 - User profile page template
- auth_user/login.html.j2 - Login page template (referenced in config)
initialize_admin_user() to create the default admin account/profile/BasicAuthManager.hash_password()is_admin boolean fieldSome authentication routes are currently commented out in the login router and may need to be implemented based on your specific requirements.
This plugin does not have a Changelog file or it could not be extracted from the package.
API documentation for this plugin is not available.
Last analysis performed: 2025-07-24 15:40:32
This plugin has a valid entry point:
auth_user
= fastpluggy_plugin.auth_user.plugin:AuthUserPlugin
Issues were found during analysis, but details are not available.
fastpluggy_plugin.auth_user.plugin:AuthUserPlugin