Skip to content

Feat/authentication - #14

Merged
borhanst merged 19 commits into
mainfrom
feat/authentication
Jul 13, 2026
Merged

Feat/authentication#14
borhanst merged 19 commits into
mainfrom
feat/authentication

Conversation

@borhanst

Copy link
Copy Markdown
Owner

No description provided.

borhanst added 19 commits July 9, 2026 18:08
- Rename AdminUser -> User, AdminRole -> Role, AdminPermission -> Permission,
  AdminUserPermission -> UserPermission, AdminRefreshToken -> RefreshToken,
  AdminUserTOTP -> UserTOTP, AdminLoginAttempt -> LoginAttempt
- Keep database table names unchanged (admin_users, admin_roles, etc.)
- Add hash_password() classmethod and verify_password() instance method to User
- Migrate all internal pwd_context calls to User methods
- Delete dead AdminRefreshTokenAdmin duplicate from models.py
- Update all imports and references across 36 files
- All 559 tests pass
- Add PasswordHasher ABC and BcryptHasher default implementation
- Add password_hasher option to AuthConfig
- User model uses configurable hasher via set_hasher()
- Hasher wired automatically during admin setup
- Create custom hasher by subclassing PasswordHasher:

    from fastapi_admin_kit.auth.hasher import PasswordHasher

    class Argon2Hasher(PasswordHasher):
        @staticmethod
        def hash(password: str) -> str:
            ...
        @staticmethod
        def verify(password: str, hashed: str) -> bool:
            ...

    admin = Admin(
        config=AdminConfig(
            auth=AuthConfig(password_hasher=Argon2Hasher)
        )
    )

All 559 tests pass.
- Show 5 most recently active models from audit log in Quick Actions
- Fallback to first 5 admin-tagged models when no activity exists
- Redesign quick actions layout from 2-col grid to single column list
- Add text truncation to prevent awkward wrapping
- Update action labels from 'Add X' to 'Manage X' for navigation clarity
- Expand color mappings for more admin model types
- Simplified code formatting in various test files by removing unnecessary line breaks and aligning function calls.
- Consolidated import statements and organized them for better clarity.
- Enhanced the structure of test cases to follow a more uniform style across different test modules.
- Updated assertions and mock setups to streamline test execution and improve maintainability.
- Improved code readability by restructuring conditional statements and breaking long lines in class_views.py.
- Optimized many-to-many key handling in _apply_m2m_from_data and related methods.
- Enhanced search capabilities by integrating apply_search_filter utility across various views.
- Updated dashboard view to fetch recent audit logs specific to the current user.
- Refined role management views to ensure proper handling of permissions and user-role associations.
- Added comprehensive tests for role creation, editing, and search functionalities, ensuring correct persistence of many-to-many relationships.
- Introduced new models and search capabilities for articles and tags, enhancing the admin interface.
@borhanst
borhanst merged commit a5e0f07 into main Jul 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant