Commit Graph

46 Commits

Author SHA1 Message Date
Cursor Agent
a414d7d528 feat: implement IAM OTP dispatch abstractions
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 11:43:30 +00:00
Ho Ngoc Hai
86c9e7303c docs: Add new services, update existing service documentation, and enhance IAM and Storage service features. 2026-01-18 23:44:03 +07:00
Ho Ngoc Hai
85bd4d6f58 feat: Thêm các controller và query quản trị cho Storage Service, cải tiến quản lý cấp độ thành viên với các bài kiểm tra mới, và cập nhật các controller cùng chính sách ủy quyền 2026-01-15 19:23:31 +07:00
Ho Ngoc Hai
0358ca255a feat: Thêm các tính năng quản lý admin cho Membership và Storage services, cùng với chức năng trao đổi tiền tệ và cập nhật cấu trúc ví trong Wallet service. 2026-01-15 19:12:32 +07:00
Ho Ngoc Hai
2fef02d04a feat: Thêm các unit test cho iam-service-net, cập nhật Dockerfile của merchant-service-net để tăng cường bảo mật và cải thiện quy trình build, đồng thời sửa đổi các unit test hiện có trong storage-service-net. 2026-01-15 18:58:04 +07:00
Ho Ngoc Hai
056d93d338 feat: Bổ sung unit test cho các mô hình miền AccessRequest và AccessRequestStatus trong IAM, đồng thời loại bỏ tệp docker-compose.yml của dịch vụ merchant. 2026-01-15 18:52:44 +07:00
Ho Ngoc Hai
8783588ec4 Thêm các bài kiểm tra chức năng và đơn vị cho quản lý vai trò trong dịch vụ IAM, đồng thời cập nhật cấu hình Docker, Traefik và các bài kiểm tra dịch vụ thành viên. 2026-01-15 18:50:50 +07:00
Ho Ngoc Hai
753e2b9d95 feat: Bổ sung các bài kiểm tra đơn vị và chức năng mới cho Storage, IAM, Membership services, đồng thời thêm cấu hình thực thể cho MerchantService. 2026-01-15 18:30:47 +07:00
Ho Ngoc Hai
3cbf56ec36 feat: Triển khai các API quản lý cửa hàng và người bán trong MerchantService, đồng thời bổ sung các bài kiểm thử đơn vị và chức năng toàn diện cho các dịch vụ Storage, Membership và IAM. 2026-01-15 18:23:40 +07:00
Ho Ngoc Hai
580e074145 feat: Thêm dịch vụ MerchantService mới và cập nhật các tệp điều khiển thành viên trong MembershipService. 2026-01-15 18:14:13 +07:00
Ho Ngoc Hai
79bc566b73 docs: Expand architecture documentation for IAM Service with new aggregates and event types
- Added detailed sections for Organization, Group, Access Request, Access Review, and Audit & Compliance aggregates in both English and Vietnamese.
- Included class diagrams and enumerations to enhance understanding of the new structures and their relationships.
- Updated the AuditEventType table to reflect 18 event types, improving clarity on event handling within the IAM Service.
2026-01-14 19:31:41 +07:00
Ho Ngoc Hai
8e87ddd4ea docs: Expand IAM Service documentation to include new API endpoints for Organizations, Groups, Access Requests, Access Reviews, Privileged Access, Audit, and Compliance
- Added detailed sections for new API endpoints in both English and Vietnamese, covering functionalities for managing organizations, groups, access requests, access reviews, privileged access, audit logs, and compliance reports.
- Enhanced documentation clarity and accessibility, reflecting the latest features introduced in the IAM Service.
2026-01-14 19:29:27 +07:00
Ho Ngoc Hai
f19a995b0d feat: Introduce new Access Management and Governance APIs in IAM Service
- Added Access Requests, Access Reviews, Privileged Access Management, Audit Log, and Compliance APIs to enhance access management and governance capabilities.
- Updated the DbContext to include new entities for AuditLog and ComplianceReport, improving data handling for compliance and auditing.
- Enhanced Dependency Injection to support new repositories for the added functionalities, streamlining service operations.
2026-01-14 19:26:26 +07:00
Ho Ngoc Hai
8b7db56b79 feat: Add Access Review and Privileged Access functionality to IAM Service
- Introduced new AccessReview and PrivilegedAccess entities in the DbContext to enhance access management capabilities.
- Updated Dependency Injection to include AccessReviewRepository and PrivilegedAccessRepository, improving service functionality for access reviews and privileged access management.
2026-01-14 16:02:34 +07:00
Ho Ngoc Hai
c041f3f7b2 feat: Add Access Request functionality to IAM Service
- Introduced new Access Request and Access Request Approver entities in the DbContext to support access management features.
- Updated Dependency Injection to include the AccessRequestRepository, enhancing the service's capabilities for handling access requests.
- Added example curl command for token retrieval using the test account, improving developer experience for testing authentication flows.
2026-01-14 15:51:16 +07:00
Ho Ngoc Hai
dfaf6b059b docs: Update IAM Service documentation to include new Organization, Group, User Profile, and Identity Verification APIs
- Added new sections for Organization & Group APIs, User Profile APIs, and Identity Verification APIs in both English and Vietnamese documentation, reflecting the features introduced in Phase 2.
- Revised the implementation roadmap to indicate the completion of Identity Management features, enhancing clarity on the current capabilities of the IAM Service.
- Updated the Dependency Injection and DbContext to include new repositories and database tables for the added functionalities.
2026-01-14 15:19:06 +07:00
Ho Ngoc Hai
5363d9ca5e feat(identity): Configure fixed issuer URI for IdentityServer
- Added a fixed issuer URI for inter-service communication in the docker-compose.yml and appsettings.json.
- Updated DependencyInjection to utilize the new issuer URI, ensuring consistency across hosts and containers.
2026-01-13 20:05:50 +07:00
Ho Ngoc Hai
374f6904fe chore(docker): Update IAM and Storage Service Dockerfiles
- Added curl installation in the IAM service Dockerfile for improved functionality.
- Removed the deprecated docker-compose.yml for the Storage Service, consolidating service definitions.
- Ensured consistency in the build and publish commands for the Storage Service Dockerfile.
2026-01-13 19:57:51 +07:00
Ho Ngoc Hai
6fa2bdbded fix(users): Handle null values for email and status in UserDto
- Updated the UsersController to ensure that the Email field defaults to an empty string if null, and the Status field defaults to "Unknown" if not set. This improves the robustness of the user data returned in API responses.
2026-01-13 19:46:24 +07:00
Ho Ngoc Hai
7550929f50 refactor(authentication): Update authorization schemes to use "Bearer" for consistency
- Changed authorization schemes in AuthController, RolesController, and UsersController from JwtBearerDefaults.AuthenticationScheme to "Bearer" for uniformity across the application.
- Added new endpoints in UsersController to retrieve user roles and permissions by user ID, enhancing user management capabilities.
2026-01-13 19:43:16 +07:00
Ho Ngoc Hai
884520a766 chore(configuration): Add IdentityServer authority to appsettings.json
- Introduced IdentityServer configuration with Authority set to "http://localhost:5001" for local development.
2026-01-13 19:36:15 +07:00
Ho Ngoc Hai
312bf360ea chore(docker): Migrate IAM service configuration to main docker-compose file
- Added IAM service configuration to the local docker-compose.yml for streamlined deployment.
- Removed the separate docker-compose.yml file from the IAM service directory to consolidate service definitions.
2026-01-13 19:26:56 +07:00
Ho Ngoc Hai
aafa1ae839 feat(docs): Update README with new registration and email confirmation details
- Added phone number field to the registration example in the API documentation.
- Included detailed response structure for registration and email verification endpoints.
- Updated email confirmation example to use email instead of userId for clarity.
- Enhanced two-factor authentication response to include manual entry key and recovery codes.
2026-01-13 19:07:39 +07:00
Ho Ngoc Hai
7d4958ec92 feat(two-factor): Enhance recovery code generation in TotpTwoFactorService
- Updated recovery code generation to use 12 bytes for base64 conversion, ensuring sufficient characters.
- Implemented fallback padding to guarantee a minimum length of 8 characters for generated codes.
- Adjusted formatting to maintain readability with XXXX-XXXX structure.
2026-01-13 19:01:15 +07:00
Ho Ngoc Hai
a25c9f4ad5 chore(configuration): Update email settings in appsettings.json for IAM service
- Changed SMTP configuration to use specific credentials and sender details for the GoodGo IAM service.
- Updated sender email and name to reflect the new service branding.
2026-01-13 18:57:54 +07:00
Ho Ngoc Hai
38aaf72be2 chore(configuration): Update appsettings for development and production environments
- Modified logging levels in `appsettings.Development.json` to enhance log visibility.
- Added Serilog configuration for structured logging and console output.
- Updated Redis connection settings for improved security and performance.
- Introduced email configuration settings for SMTP integration.
- Added two-factor authentication settings and social login configurations for Google and Facebook.
- Updated the default connection string in `appsettings.json` to match the new database setup.
2026-01-13 18:56:59 +07:00
Ho Ngoc Hai
c23c35844e refactor(authentication): Remove legacy login functionality and related models
- Deleted the `Login` method and associated `LoginRequest` and `LoginResponse` models from `AuthController.cs` to streamline authentication processes.
- This change simplifies the codebase by removing unused components related to the Resource Owner Password Grant flow.
2026-01-13 18:44:31 +07:00
Ho Ngoc Hai
afb756681e feat(authentication): Integrate JWT Bearer authentication and Swagger enhancements
- Added JWT Bearer authentication configuration in `Program.cs` for IAM service integration.
- Updated Swagger setup to include JWT Bearer security definition and requirements.
- Introduced a new Swagger UI client for testing with resource owner password grant type in `Config.cs`.
- Included necessary package reference for `Microsoft.AspNetCore.Authentication.JwtBearer` in the project file.
2026-01-13 12:24:41 +07:00
Ho Ngoc Hai
71a5d8d4ed feat(deployments): Update local environment configuration for IAM service and Redis integration
- Modified local `.env` and `.env.local` files to include external Redis configuration and IAM service database connection details.
- Updated `docker-compose.yml` to disable local Redis service in favor of an external Redis instance.
- Added JWT configuration parameters for the IAM service, enhancing security and token management.
- Revised example environment file to reflect new configuration options for external services.
- Enhanced documentation to clarify setup instructions for local development with external dependencies.
2026-01-13 01:03:33 +07:00
Ho Ngoc Hai
928a22fe3e feat(authentication): Implement email verification, two-factor authentication, and social login features
- Added endpoints for sending and confirming email verification, enhancing user account security.
- Integrated two-factor authentication (2FA) with TOTP support, including enabling, verifying, and disabling 2FA.
- Implemented social login functionality for Google and Facebook, allowing users to authenticate using their existing accounts.
- Updated dependency injection to include services for email, 2FA, and social login.
- Enhanced documentation to reflect new features and usage examples for email verification and 2FA.
2026-01-12 23:07:53 +07:00
Ho Ngoc Hai
83b007c8ef docs: Update architecture and README documentation to reflect migration from OpenIddict to Duende IdentityServer
- Revised architecture documentation to replace OpenIddict references with Duende IdentityServer, including updates to diagrams and flow descriptions.
- Updated README files in both English and Vietnamese to reflect the change in the OAuth2/OIDC server from OpenIddict to Duende IdentityServer.
- Enhanced token management and authentication flow descriptions to align with the new identity server implementation.
2026-01-12 20:54:12 +07:00
Ho Ngoc Hai
12cbcd5d8e fix(authentication): Update JWT handling for ASP.NET Core 8 compatibility
- Replaced JwtSecurityToken with JsonWebToken in DependencyInjection.cs to align with ASP.NET Core 8+ requirements.
- Enhanced CustomWebApplicationFactory to configure minimal JWT validation and custom authentication handling for functional tests.
- Removed outdated tests that relied on InMemory Database limitations, ensuring a cleaner test suite.
- Updated RegisterUserCommandHandlerTests to throw DuplicateResourceException for better error handling.
2026-01-12 20:49:53 +07:00
Ho Ngoc Hai
93165f4549 feat(authentication): Migrate from OpenIddict to Duende IdentityServer for OAuth2 support
- Replaced OpenIddict references with Duende IdentityServer in the project, including updates to the API project and infrastructure.
- Refactored authentication and authorization logic in AuthController, LogoutCommandHandler, and related services to align with Duende IdentityServer's structure.
- Updated dependency injection configuration to register Duende IdentityServer components and JWT Bearer authentication.
- Enhanced functional tests to accommodate changes in authentication flow and ensure compatibility with the new identity server.
- Removed obsolete OpenIddict components and related code to streamline the project.
2026-01-12 20:29:15 +07:00
Ho Ngoc Hai
eb5cb28d9f feat(exceptions): Introduce custom exceptions for better error handling and validation
- Added custom exceptions: DuplicateResourceException, EntityNotFoundException, AuthenticationFailedException, and BusinessRuleException to improve error handling in the application.
- Updated Program.cs to map these exceptions to appropriate HTTP status codes and problem details for better client feedback.
- Refactored RegisterUserCommandHandler to throw DuplicateResourceException when a user with the same email already exists.
- Enhanced testing setup in CustomWebApplicationFactory to ensure proper handling of these exceptions during functional tests.
2026-01-12 20:04:38 +07:00
Ho Ngoc Hai
74f423992b feat(dependency-injection): Refactor DbContext registration and enhance testing setup
- Updated DependencyInjection.cs to conditionally register DbContext based on the environment, skipping registration in the Testing environment.
- Improved CustomWebApplicationFactory to remove existing DbContext and Redis registrations, ensuring a clean setup for tests.
- Added methods to streamline the removal of DbContext and Redis service registrations.
- Updated functional tests to include better logging and error handling for unexpected responses.
- Bumped Microsoft.EntityFrameworkCore.InMemory package version to 10.0.1 for compatibility.
- Removed obsolete SamplesControllerTests file to clean up the test suite.
2026-01-12 19:18:19 +07:00
Ho Ngoc Hai
616bd9ede9 feat(api): Refactor Program.cs for improved service configuration and logging
- Reorganized the Program.cs file to streamline service configuration, including Serilog setup, API versioning, and health checks.
- Added logging configuration to set a minimum logging level for tests, reducing output noise.
- Enhanced Swagger integration with detailed API documentation and OAuth2 security definitions.
- Implemented ProblemDetails middleware for better error handling and added support for health check endpoints.
2026-01-12 19:12:07 +07:00
Ho Ngoc Hai
fdcc24bdf4 feat(infrastructure): Enhance dependency injection for Redis caching and add InMemory cache service for testing
- Updated AddInfrastructure method to accept an environment name parameter for conditional Redis caching configuration.
- Implemented logic to skip Redis caching setup in the Testing environment.
- Added InMemoryCacheService for testing purposes, providing a mock implementation of ICacheService.
- Enhanced TransactionBehavior to skip transactions for InMemory databases.
- Updated functional tests to remove Redis-related services and ensure proper database setup for testing.
2026-01-12 19:04:49 +07:00
Ho Ngoc Hai
ba928022cb feat(docs): Update architecture and caching documentation
- Added detailed sections on distributed caching architecture, including caching overview, ICacheService interface, and caching strategies for tokens and sessions.
- Enhanced documentation with mermaid diagrams to illustrate caching flows and key patterns.
- Updated Redis configuration instructions in the README, including environment variable setup and usage examples for caching operations.
- Removed outdated notes from the NOTE.MD file to streamline content and focus on relevant tasks and proposals.
2026-01-12 18:48:50 +07:00
Ho Ngoc Hai
bb4cf4884c feat(redis): Implement Redis caching and update configuration
- Added Redis caching support to the IAM service, including configuration settings in `appsettings.json` and environment variables.
- Introduced `ICacheService` interface for caching operations and implemented `RedisCacheService`.
- Updated documentation to include Redis setup instructions and usage examples for caching user data and token management.
- Enhanced user account management by adding an `Activate` method to the `ApplicationUser` class.
- Fixed assertions in unit tests to reflect the updated user status after activation.
2026-01-12 18:45:31 +07:00
Ho Ngoc Hai
079b24f683 feat(api): Enhance OAuth2 token endpoint and debugging capabilities
- Added debug middleware for /connect/* endpoints to log request and response details for better troubleshooting.
- Updated OAuth2 configuration to include "offline_access" scope and disabled access token encryption for development.
- Improved DbContext registration in tests by removing all related registrations and ensuring in-memory database setup for testing purposes.
- Addressed issues with the /connect/token endpoint not responding, outlining next steps for debugging and fixing the OpenIddict configuration.
2026-01-12 18:22:47 +07:00
Ho Ngoc Hai
435e5c2dfa feat(docs): Add database migration instructions and Neon setup details
- Introduced comprehensive sections on database migrations in the README files for English and Vietnamese documentation, including prerequisites, migration creation, and application steps.
- Added instructions for setting up the Neon database, including connection string configuration in `appsettings.Development.json`.
- Updated the `appsettings.Development.json` file with a default connection string for the Neon database and added Redis configuration.
- Included additional EF Core commands for managing migrations in the Vietnamese documentation.
2026-01-12 17:52:35 +07:00
Ho Ngoc Hai
4ae24a7bc8 feat(docs): Revamp IAM service documentation and authentication flow
- Updated README and architecture documentation to reflect the new authentication flow, including user registration, login, token management, and logout processes.
- Enhanced API documentation with detailed examples for each step of the authentication process, including curl commands and expected responses.
- Improved clarity in the architecture diagrams, outlining the interaction between clients, API, application, and infrastructure layers.
- Added sections on OAuth2 grant types and user management functionalities to provide comprehensive guidance for developers.
- Streamlined Vietnamese documentation to ensure consistency with English updates and improve accessibility for users.
2026-01-12 16:37:31 +07:00
Ho Ngoc Hai
c621afbb74 feat(api): Enhance authentication and user management endpoints
- Updated API documentation to include new user management features such as password change and logout functionalities.
- Added detailed descriptions and examples for OAuth2 token endpoint, supporting password, refresh token, and client credentials grants.
- Introduced new endpoints for user management, including retrieving, updating, and deleting users.
- Enhanced Swagger annotations for better clarity and usability of the API documentation.
- Implemented response models for password change and logout operations to standardize API responses.
2026-01-12 16:25:54 +07:00
Ho Ngoc Hai
07cb482edc fix(config): Update application URL in launchSettings.json for development environment
- Changed the application URL from http://localhost:5000 to http://localhost:5001 to align with updated service configurations.
- This adjustment ensures proper routing during local development.
2026-01-12 14:04:36 +07:00
Ho Ngoc Hai
b9065fe858 feat(docs): Enhance API documentation and Swagger integration
- Enabled XML documentation generation for improved API documentation.
- Updated API descriptions and added detailed endpoint information for better clarity.
- Introduced Swagger annotations for authentication and user management endpoints.
- Enhanced response types and added pagination information in user-related responses.
- Included contact and license information in the API metadata for better transparency.
2026-01-12 13:52:12 +07:00
Ho Ngoc Hai
07f96a8eb2 feat(docs): Enhance Vietnamese documentation with new sections and updates
- Added new sections on API Design, Caching Patterns, and Testing Patterns to the Vietnamese documentation.
- Updated sidebar configurations for improved navigation and accessibility.
- Removed outdated onboarding guides to streamline content and focus on relevant resources.
2026-01-12 13:36:53 +07:00