Commit Graph

31 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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