Skip to content

Development#11

Merged
fiqrikm18 merged 46 commits into
masterfrom
development
Jun 22, 2026
Merged

Development#11
fiqrikm18 merged 46 commits into
masterfrom
development

Conversation

@fiqrikm18

Copy link
Copy Markdown
Collaborator

No description provided.

fiqrikm18 and others added 30 commits June 20, 2026 10:42
…itecture + CQRS

- Move authorization from core to dedicated module with full layer separation
- Create application layer with CQRS pattern (commands, queries, handlers)
- Rename 'presenter' to 'presentation' for consistency
- Organize domain services and infrastructure repositories properly
- Fix directory structure to match standard DDD boundaries
- Update imports and dependencies accordingly
…review-dfff8

Update from task 9d6c2646-8dbc-409e-bccc-824f40edfff8
- New SQLAlchemy models for authorization including CasbinRuleModel, PermissionModel, AuthorizationResourceModel, RoleModel, RolePermissionModel, and UserHasRoleModel with proper relationships and constraints
- Implementation of SQLAlchemyCasbinPolicyRepository with full CRUD operations for roles, permissions, and policies including cursor-based pagination
- CasbinAuthorizationService integrating with the repository layer and providing dynamic enforcer building for access control decisions
- Infrastructure setup for authorization module with proper domain entities, services, and repository patterns following the application architecture

This commit establishes a comprehensive authorization system backend with database persistence, supporting role-based access control through Casbin policies and efficient data management through SQLAlchemy ORM.
Update from task 90279199-752f-4c5d-8ba2-2d3b805e8caa
Key features implemented:
- Updated import paths in CasbinAuthorizationService to reflect new core infrastructure location
- Updated import paths in GetRoleQueryHandler to reflect new core infrastructure location
- Updated import paths in dependency injection module to reflect new core infrastructure location
- Updated import paths in permission router to reflect new core infrastructure location
- Updated import paths in role router to reflect new core infrastructure location
- Removed old authorization infrastructure modules and models from src/modules/authorization/infrastructure/
- Streamlined .gitignore file with consolidated ignore patterns

The changes consolidate the authorization infrastructure under the core module and update all relevant imports across the application, removing redundant legacy infrastructure files.
Update from task 2f7c629a-0783-47de-832a-d79f0b036efe
… Handlers

Key features implemented:
- New docs/NORMALIZED_USER_DOMAIN.md detailing normalized schema design rationale and structure
- New src/modules/user/infrastructure/models/__init__.py aggregating all user domain models
- New src/modules/user/infrastructure/models/user_*_model.py files for normalized user entities (address, contact, profile, security, settings, verification)
- Updated src/modules/authorization/infrastructure/models/*_model.py with indexing optimizations
- Updated src/modules/user/application/auth/login_user/handler.py to reference password_hash correctly
- Updated src/modules/user/application/auth/register_user/handler.py to use password_hash in User.create
- Updated src/modules/user/application/detail_user/handler.py to fetch user with relations via get_by_id_with_relations
- Updated src/modules/user/domain/entities/user.py with normalized entity structure including profile, settings, security
- Updated src/modules/user/domain/repositories/user_repository.py interface for relation handling
- Updated src/modules/user/infrastructure/models/user_model.py to reflect normalized structure and relationships
- Updated src/modules/user/infrastructure/repositories/user_repository.py implementation for normalized data access

The changes implement a fully normalized user domain following DDD principles, separating concerns into distinct bounded contexts while updating application handlers to utilize the new structure. The repository layer now supports fetching related user data efficiently.
…re-0d379

Update from task d9094924-b67f-44f0-bb30-c9ebeaa0d379
…itignore

- Updated .gitignore with standard Python project exclusions and removed redundant entries
- Modified PermissionModel to remove direct imports and use string references for relationships
- Modified AuthorizationResourceModel to remove direct imports and use string references for relationships
- Modified RolePermissionModel to remove direct imports and use string references for relationships
- Modified UserHasRoleModel to remove direct imports and use string references for relationships

This change eliminates circular import dependencies between authorization models while maintaining all existing functionality and relationships. The gitignore file now follows standard conventions for Python projects.
Update from task 6bbbcb92-32e0-4063-9356-01fd62bb6fdb
fiqrikm18 and others added 16 commits June 22, 2026 12:41
Key features implemented:
- Added comprehensive ORM relationship and foreign key metadata regression tests in test_database_relationships.py
- Restored missing foreign key constraints in authorization models (permission, role_permission, user_has_role) and todo model
- Converted normalized user identifier columns across 7 user models to UUID type with proper foreign key references
- Updated Alembic environment to load complete user model package for accurate metadata reflection
- Created corrective Alembic migration to convert string user IDs to UUID and create all missing foreign key constraints
- Added contract tests for the corrective migration covering both upgrade and downgrade operations

The implementation restores all 13 intended foreign keys while ensuring normalized user identifiers use UUID consistently, enabling successful database seeding without SQLAlchemy mapper errors.
…e7a15

Update from task 4c631340-f28c-44ee-a658-3d32babe7a15
- Added TwoFactorAuthService supporting TOTP (Google Authenticator) and email-based 2FA with backup codes
- Implemented 2FA setup, verification, disabling, and regeneration commands with corresponding handlers
- Created new API router and request/response schemas for 2FA endpoints
- Updated LoginUserCommandHandler to integrate 2FA verification and temporary token generation
- Enhanced account lockout mechanism to prevent brute force login attempts
- Added dependency injection for new 2FA handlers and integrated with existing auth flow
Update from task c473550d-b98f-4134-bd8b-46abf61bc71e
@fiqrikm18 fiqrikm18 merged commit 567858c into master Jun 22, 2026
2 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.

2 participants