Feat/authentication - #14
Merged
Merged
Conversation
- 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.
…erbose_name generation in AdminRegistry
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.