Commit graph

2807 commits

Author SHA1 Message Date
Max
8d146bb355
Merge pull request #1183 from trheyi/main
Add MFA required error handling and update login response structure
2025-10-10 11:58:44 +08:00
Max
5e5b633fba Add team retrieval and counting methods for user membership
- Introduced GetTeamsByMember and CountTeamsByMember methods in the DefaultUser struct to retrieve teams associated with a specific member and count the total number of teams, respectively.
- Updated the UserProvider interface to include these new methods.
- Enhanced the login response structure to include a status indicating whether team selection is required based on the user's team membership.
- Added error handling for team retrieval in the authentication process.
2025-10-10 11:57:47 +08:00
Max
4a94460377 Add MFA required error handling and update login response structure 2025-10-10 11:14:52 +08:00
Max
7bdcf2acce
Merge pull request #1182 from trheyi/main
Remove invitation management handlers and related business logic
2025-10-10 08:43:03 +08:00
Max
2569634ca2 Remove invitation management handlers and related business logic
- Deleted the invitation.go file, which contained handlers for team invitation management, including listing, creating, resending, and deleting invitations.
- Updated the user/member.go and user/team.go files to ensure consistent response handling by replacing direct JSON responses with a unified response method.
- Introduced a new PublicInvitationResponse type in user/types.go to facilitate public access to invitation details while excluding sensitive information.
- Refactored user/user.go to register new invitation-related process handlers for improved organization and clarity.
2025-10-10 08:42:05 +08:00
Max
f116f8acdb
Merge pull request #1181 from trheyi/main
Update template tests to align with actual template variables and imp…
2025-10-09 15:44:23 +08:00
Max
ffbe10f862 Update template tests to align with actual template variables and improve consistency
- Modified test data in template tests to include 'invitation_link' and 'expires_at' fields, ensuring alignment with the actual template structure.
- Changed message type verification from "mail" to "email" for clarity and accuracy.
- Enhanced comments for better understanding of test data relevance.
2025-10-09 15:43:57 +08:00
Max
625abf5499
Merge pull request #1180 from trheyi/main
Enhance messenger service with optional message type support for temp…
2025-10-09 12:12:20 +08:00
Max
03ecf96b51 Enhance messenger service with optional message type support for template sending
- Updated SendT, SendTWithProvider, SendTBatch, and SendTBatchMixed methods to accept an optional message type parameter, allowing for more flexible template usage.
- Refactored provider implementations for Mailgun, Twilio, and Mailer to accommodate the new message type parameter in their SendT and SendTBatch methods.
- Improved error handling for template retrieval and provider configuration, ensuring clearer feedback in case of issues.
- Added tests to validate the new functionality and ensure compatibility across different message types.
2025-10-09 12:11:54 +08:00
Max
6a4e2a627f
Merge pull request #1179 from trheyi/main
Enhance invitation handling and team configuration tests
2025-10-08 17:57:23 +08:00
Max
cf42d255d3 Enhance invitation handling and team configuration tests
- Updated the invitation creation response to return complete invitation details, including the invitation token.
- Improved error handling when retrieving created invitations, ensuring fallback to ID return on failure.
- Modified team configuration tests to require authentication, reflecting recent API changes.
- Added access token retrieval for authenticated requests in team configuration tests, enhancing security and compliance.
2025-10-08 17:56:56 +08:00
Max
110abd5161
Merge pull request #1178 from trheyi/main
Refactor settings handling in user invitation, member, and team APIs
2025-10-08 16:46:56 +08:00
Max
c6329ebb0c Refactor settings handling in user invitation, member, and team APIs
- Updated the structure of settings in invitation, member, and team responses to use specific types instead of generic maps for better type safety and clarity.
- Implemented backward compatibility for existing settings formats to ensure seamless integration with previous data structures.
- Enhanced the logic for handling settings in invitation creation and response mapping, improving maintainability and readability of the codebase.
2025-10-08 16:46:31 +08:00
Max
bea4501295
Merge pull request #1177 from trheyi/main
Refactor invitation handling and improve test coverage
2025-10-08 16:17:17 +08:00
Max
ca2344edb8 Refactor invitation handling and improve test coverage
- Updated invitation creation logic to support email invitations and customizable expiry durations.
- Enhanced tests for invitation creation, including scenarios for registered and unregistered users, and handling of missing email requirements.
- Refactored API endpoints to use consistent parameter naming for team IDs.
- Improved error handling and logging for invitation-related operations, ensuring clarity in failure cases.
- Added support for sending invitation emails through the messenger service, with appropriate templates and settings.
2025-10-08 16:16:49 +08:00
Max
c1a7d7b23b
Merge pull request #1176 from trheyi/main
Enhance messenger service with template support for message sending
2025-10-08 09:22:51 +08:00
Max
bd463b0ec5 Refactor template tests to improve readability and consistency
- Cleaned up whitespace in debug, load, and walk test files for better formatting.
- Enhanced logging statements for clarity during template loading and walking tests.
- Standardized test structure to improve maintainability and readability across template-related tests.
2025-10-08 09:22:28 +08:00
Max
ec8b6c336b Enhance messenger service with template support for message sending
- Introduced template loading functionality during messenger initialization, allowing for dynamic message templates.
- Added SendT, SendTWithProvider, SendTBatch, and SendTBatchMixed methods to the Service for sending messages using templates.
- Updated provider implementations for Mailgun, Twilio, and Mailer to support template-based message sending.
- Enhanced the Provider interface to include optional template methods, improving flexibility and usability across providers.
2025-10-08 09:21:57 +08:00
Max
19942f085a
Merge pull request #1175 from trheyi/main
Refactor test files to improve readability and consistency
2025-10-07 10:32:57 +08:00
Max
d113adaa8a Refactor test files to improve readability and consistency
- Cleaned up whitespace in user configuration validation and environment variable extraction tests.
- Enhanced logging statements for better clarity during test execution.
- Standardized formatting across test cases to improve maintainability.
2025-10-07 10:32:35 +08:00
Max
a4d0c0c9ba
Merge pull request #1174 from trheyi/main
Enhance user login and team configuration management
2025-10-07 10:27:39 +08:00
Max
9044d4c30a Enhance user login and team configuration management
- Updated login configuration tests to clarify endpoint descriptions.
- Introduced team configuration loading and retrieval functionality, including new endpoints for public access to team configurations.
- Refactored team management routes to standardize parameter usage and improve clarity.
- Added error handling for missing environment variables in client configuration.
- Implemented team configuration types and related structures for better organization and usability.
2025-10-07 10:23:43 +08:00
Max
03fc64b314
Merge pull request #1173 from trheyi/main
Update Makefile to exclude 'twilio' from test folder and clean up whi…
2025-09-28 16:14:19 +08:00
Max
f0d56b91ad Update Makefile to exclude 'twilio' from test folder and clean up whitespace in mailer and mailgun provider files 2025-09-28 16:13:29 +08:00
Max
05ecd1798c
Merge pull request #1172 from trheyi/main
Add GetAllProviders method and related tests for provider information…
2025-09-28 16:01:33 +08:00
Max
436d101cf3 Add GetAllProviders method and related tests for provider information retrieval
- Implemented GetAllProviders method in the Service to return all registered providers.
- Added TestGetAllProviders to validate the functionality, ensuring providers have required attributes and are unique.
- Enhanced GetPublicInfo method in provider implementations to return structured public information.
- Updated OpenAPI handlers to include endpoints for retrieving provider information, improving API usability.
2025-09-28 16:00:35 +08:00
Max
f5b8d4f005
Merge pull request #1171 from trheyi/main
Refactor messenger service to enhance webhook processing and remove d…
2025-09-28 15:28:02 +08:00
Max
0505adf003 Refactor messenger service to enhance webhook processing and remove deprecated methods
- Implemented TriggerWebhook method to handle incoming webhook requests for various providers, utilizing gin.Context for improved integration.
- Removed the deprecated Receive method from the mailer provider and related functions, streamlining the codebase.
- Updated tests to reflect changes in webhook handling and provider interactions, ensuring compatibility with new implementations.
- Enhanced error handling and logging for webhook processing, improving overall reliability and clarity.
2025-09-28 15:27:20 +08:00
Max
77c32fa860
Merge pull request #1170 from trheyi/main
Refactor error handling in various components to improve logging and …
2025-09-28 10:24:40 +08:00
Max
c425b74383 Refactor error handling in various components to improve logging and message formatting
- Updated error messages to use fmt.Errorf with %s for better clarity and consistency.
- Enhanced logging statements to utilize formatted strings for improved readability.
- Refactored multiple Load functions across different modules to standardize error handling practices.
2025-09-28 10:24:17 +08:00
Max
9142335746
Merge pull request #1169 from trheyi/main
Enhance messenger service with message handler registration and webho…
2025-09-28 10:01:04 +08:00
Max
ffc666c4de Enhance messenger service with message handler registration and webhook processing
- Introduced OnReceive method to register multiple message handlers for processing received messages.
- Added RemoveReceiveHandler method to unregister specific message handlers.
- Implemented TriggerWebhook method to process incoming webhook data and trigger registered handlers.
- Updated existing tests to reflect changes in provider types from 'smtp' to 'mailer' for consistency.
2025-09-28 10:00:38 +08:00
Max
6d749cd6c0
Merge pull request #1168 from trheyi/main
Update dependencies and enhance mailer functionality
2025-09-28 09:34:12 +08:00
Max
1843a64ff5 Update dependencies and enhance mailer functionality
- Bump Go version to 1.24.0 and update toolchain to 1.24.3 for improved performance and compatibility.
- Add new dependencies for IMAP and SASL support, enhancing email handling capabilities.
- Refactor messenger service to integrate a new mailer provider, replacing the deprecated SMTP provider.
- Implement automatic mail receiver startup for mailer providers, improving message handling efficiency.
- Update GitHub Actions workflows to include IMAP server configurations for testing email reception.
2025-09-28 09:33:36 +08:00
Max
d490bb5b2d
Merge pull request #1167 from trheyi/main
Enhance Twilio provider tests and configurations for improved SMS fun…
2025-09-27 08:42:18 +08:00
Max
09ec6edac3 Enhance Twilio provider tests and configurations for improved SMS functionality
- Added TWILIO_TEST_PHONE environment variable to GitHub Actions workflows for better test configuration.
- Updated Twilio SMS test cases to utilize the new test phone number, improving test reliability.
- Implemented separate test cases for SMS sending using both Auth Token and API Key authentication methods.
- Enhanced existing tests to skip execution if required credentials are not configured, ensuring clearer test outcomes.
- Refactored benchmark tests for SMS sending to support both authentication methods, optimizing performance evaluation.
2025-09-27 08:41:42 +08:00
Max
be8c226800
Merge pull request #1166 from trheyi/main
Refactor Twilio provider methods to include context support
2025-09-26 19:38:51 +08:00
Max
d0964c942d Refactor Twilio provider methods to include context support
- Updated method signatures for sendSMS, sendWhatsApp, and their respective recipient functions to accept context.Context as a parameter.
- Modified request handling in sendTwilioRequest to utilize context, improving request management and error handling.
- Enhanced overall functionality and maintainability of the Twilio provider by integrating context support.
2025-09-26 19:01:05 +08:00
Max
ccac2e0196
Merge pull request #1165 from trheyi/main
Refactor SMTP provider implementation for improved clarity and functionality
2025-09-26 18:44:40 +08:00
Max
fecbc87ba8 Update Mailgun test to validate delivery time format with timezone offset
- Modified the test for scheduled email delivery to assert that the delivery time includes a timezone offset in the RFC1123Z format.
- Replaced the previous check for "GMT" with a regex assertion to ensure compliance with the expected format.
2025-09-26 18:44:11 +08:00
Max
ae8efd247a Refactor SMTP provider implementation for improved clarity and functionality
- Renamed SMTPProvider to Provider for consistency across messenger providers.
- Updated method signatures to reflect the new Provider type.
- Added extractEmailAddress function to handle email address extraction from formatted strings.
- Enhanced sendEmail and sendWithTLS methods to support context and improve error handling.
- Refactored message building and sending logic for better maintainability.
2025-09-26 18:37:37 +08:00
Max
395ec805d6
Merge pull request #1164 from trheyi/main
Refactor messaging service configurations for improved CI integration
2025-09-26 18:17:30 +08:00
Max
9438c6831a Refactor messaging service configurations for improved CI integration
- Enhanced GitHub Actions workflows by refining Mailgun, SMTP, and Twilio configurations for better unit and PR testing.
- Streamlined environment variable management for email and SMS services, ensuring consistent and secure credential handling.
- Updated related tests to validate the new configuration setup, improving overall reliability in communication functionalities.
2025-09-26 18:16:56 +08:00
Max
af0edf2228
Merge pull request #1163 from trheyi/main
Enhance messenger functionality with context support and environment variable resolution
2025-09-26 17:44:11 +08:00
Max
551af8cf0a Add messaging service configurations to CI workflows
- Integrated Mailgun, SMTP, and Twilio environment variables into the GitHub Actions workflows for unit testing and PR testing.
- Configured necessary credentials and settings for Mailgun and Gmail SMTP servers, enhancing email functionality.
- Added Twilio configuration for SMS and email services, improving communication capabilities in tests.
2025-09-26 17:43:03 +08:00
Max
c9917f8193 Enhance messenger functionality with context support and environment variable resolution
- Added context support to Send and SendBatch methods across all messenger providers (Twilio, Mailgun, SMTP).
- Implemented environment variable resolution in provider configurations to enhance flexibility.
- Updated Load function in the engine to include messenger loading, ensuring all components are initialized properly.
- Refactored related tests to validate new context handling and configuration parsing, improving overall robustness.
2025-09-26 17:39:10 +08:00
Max
9bf5b0941a
Merge pull request #1162 from trheyi/main
Add API Key authentication support in Twilio provider
2025-09-26 16:35:07 +08:00
Max
d12ce099c3 Add API Key authentication support in Twilio provider
- Introduced optional API Key and API SID fields for enhanced authentication.
- Updated validation logic to require either an auth token or both API SID and API Key.
- Modified request handling to prioritize API Key authentication over auth token, improving security and flexibility.
2025-09-26 16:34:23 +08:00
Max
9ce1bb60cf
Merge pull request #1161 from trheyi/main
Implement team member invitation expiration handling
2025-09-25 10:34:10 +08:00
Max
9e0afa3f42 Implement team member invitation expiration handling
- Added functionality to manage expiration of member invitations, ensuring that outdated invitations are automatically invalidated.
- Updated invitation-related data structures to include expiration timestamps for better tracking.
- Enhanced the invitation workflow by implementing checks for expired invitations during member management operations.
- Refactored related tests to cover new expiration logic, ensuring robust validation of invitation handling.
2025-09-25 10:33:35 +08:00