- Updated the OAuth guard to utilize a standardized response format for error handling, enhancing consistency across error responses.
- Integrated detailed error information for insufficient scope and permission denied scenarios, providing clearer insights into access issues.
- Modified the ACL enforcement logic to return structured error details, allowing for better handling of permission-related errors.
- Enhanced the ErrorResponse struct to include optional fields for reason, required scopes, and missing scopes, following OAuth 2.0 extensibility guidelines.
- Updated the OAuth guard to set authorized information in the context using the new authorized package.
- Refactored the GetAuthorizedInfo function to utilize the authorized.GetInfo method, improving clarity and maintainability.
- Enhanced the ACL implementation by adding scope resolution logic in the Enforce method, ensuring proper access control based on user roles and scopes.
- Improved error handling and logging during ACL operations, providing better insights into access decisions.
- Integrated ACL (Access Control List) functionality into the OAuth guard, enabling permission checks and rate limiting based on ACL configurations.
- Updated error responses for token validation and refresh token handling to use standardized error types.
- Enhanced error handling for ACL-related issues, providing detailed HTTP responses based on specific ACL error types.
- Improved overall security and user experience by ensuring proper authorization checks are enforced during API requests.
- Updated GinVerifyInvite function to replace session cookie sending with a new SendLoginCookies function, improving clarity in cookie management during user login processes.
- Enhanced handling of login responses to better accommodate different user statuses, streamlining the authentication flow.
- Updated the LoginThirdParty function to determine user status based on invitation requirements, setting it to "pending_invite" if an invite is required.
- Improved user data mapping to reflect the new status logic, enhancing the user experience during the registration process.
- Added Remember Me flag to LoginContext and AuthorizedInfo structures to support extended session management.
- Updated GetAuthorizedInfo function to retrieve Remember Me state from the context.
- Modified token issuance logic to accommodate Remember Me settings, adjusting token expiration durations accordingly.
- Preserved Remember Me state during login and team selection processes, improving user experience and session persistence.
- Introduced the invitation model in bindata.go, including the new invitation.mod.yao file.
- Updated system models to include the invitation model for better integration.
- Added invitation code related error handling in default.go, enhancing user experience during invitation processes.
- Implemented invitation code management methods in the user provider interface, allowing for creation, usage, and deletion of invitation codes.
- Enhanced entry configuration to support invitation code verification, improving the user registration flow.
- Added a new endpoint for verifying invitation codes in user routing, streamlining the invitation redemption process.
- Implemented GinLogout function to handle user logout, including revoking access and refresh tokens, clearing authentication cookies, and returning a success response.
- Added public method GetRefreshToken to retrieve the refresh token from the request, enhancing token management.
- Updated user routing to link the logout endpoint to the new GinLogout function, improving the user authentication flow.
- Implemented GinSendOTP function to handle resending OTP verification codes for user entry.
- Added EntrySendOTPResponse type to structure the response for OTP requests, including OTP ID and expiration time.
- Updated user routing to include a new endpoint for OTP requests, enhancing the user authentication flow.
- Updated modification times for various asset files in bindata.go to reflect recent changes.
- Enhanced user authentication by adding support for custom claims in the context during authorization, improving flexibility in handling user data.
- Refactored entry verification logic to generate and send OTPs for user registration, streamlining the registration process and improving user experience.
- Introduced new status handling for user accounts, ensuring proper feedback for pending, unverified, and disabled accounts during login attempts.
- Added a new function, createPublicEntryConfig, to create a deep copy of EntryConfig without sensitive data, ensuring that global configuration remains intact when returning public config.
- Updated entry verification logic to utilize EntryVerificationStatus for clearer status handling during user verification.
- Enhanced tests to verify that the global config is not modified after multiple requests for public entry configuration, addressing a critical bug related to captcha secret exposure.
- Updated captcha test cases to utilize the new CaptchaGet function for retrieving captcha answers, improving test reliability.
- Refactored CaptchaMake and CaptchaValidate functions to leverage a new utils package for better encapsulation and maintainability.
- Enhanced error handling and logging in captcha-related processes, contributing to a more robust user experience during authentication.
- Streamlined the captcha generation process by integrating with the utils.captcha package, ensuring consistency across the codebase.
- Renamed and updated functions and tests to replace 'login' terminology with 'entry', reflecting the unified handling of login and registration processes.
- Removed deprecated login configuration functions and structures, streamlining the codebase.
- Enhanced test coverage for entry configuration retrieval and validation, ensuring comprehensive testing of the new unified approach.
- Improved error handling and logging for entry configuration scenarios, contributing to a better user experience during authentication.
- Replaced separate register configurations with a unified entry configuration that combines login and registration settings.
- Updated related functions and structures to support the new entry configuration, enhancing the user authentication process.
- Removed deprecated register configuration handling and endpoints, streamlining the codebase.
- Improved error handling for missing entry configurations, ensuring better user experience during authentication.
- Added support for processing environment variables in both register and form configurations, improving flexibility and configurability.
- Introduced a new MessengerConfig structure for handling messenger-related settings in the register configuration.
- Updated the RegisterConfig structure to include ThirdParty and InviteRequired fields, enhancing user registration options.
- Refactored the registration endpoint to retrieve configuration details, ensuring a more robust registration process.
- Implemented logging for missing environment variables to aid in configuration troubleshooting.
- Modified the AcceptInvitation method to accept an optional user ID parameter, allowing for updates to the user ID when accepting invitations without an existing user ID.
- Adjusted related tests to include the new user ID parameter, ensuring comprehensive coverage of invitation acceptance scenarios.
- Updated the team invitation acceptance logic to utilize the new parameter, enhancing the invitation flow and user management capabilities.
- Updated the AcceptInvitation method to require both invitation ID and token, improving the invitation acceptance process.
- Modified related tests to accommodate the new invitation ID parameter, ensuring comprehensive coverage of acceptance scenarios.
- Enhanced the invitation acceptance endpoint to validate invitation ID, providing clearer error handling for invalid or expired invitations.
- Refactored tests to include detailed scenarios for accepting invitations, including success and failure cases, ensuring robust testing of the invitation flow.
- Enhanced the SignIDToken method to include the original Yao user ID in the token claims, improving user identification.
- Updated the MakeOIDCUserInfo function to extract and set the Yao user ID from the user map, ensuring consistency in user information.
- Modified the OIDCUserInfo structure to include a field for Yao user ID, facilitating better integration with Yao-specific features.
- Adjusted the team invitation response to include the inviter's user ID, enhancing the invitation context.
- Enhanced the OIDCUserInfo structure to include YaoTypeID and YaoType fields for better user type management.
- Updated SignIDToken method to incorporate YaoTypeID and YaoType claims, ensuring comprehensive user type information in ID tokens.
- Modified team creation logic to set default type_id based on team configuration, improving team management capabilities.
- Refactored token generation methods to support additional type information in access and refresh tokens, enhancing overall token customization.
- Introduced register configuration loading from the openapi/user/register directory, enhancing user management capabilities.
- Updated LoginThirdParty function to utilize locale-specific register configurations, improving localization support.
- Refactored RegisterConfig structure to include additional fields for better configuration management.
- Enhanced GetRegisterConfig function to provide fallback options for missing locale configurations, ensuring robustness in user registration processes.
- Added 'locale' field to user type structure for language localization.
- Updated API methods to include locale in pricing and published types retrieval.
- Enhanced tests to validate locale handling in user type operations, ensuring robust support for multiple languages.
- Updated user type structure to include new fields for pricing: price_daily, price_monthly, price_yearly, and credits_monthly.
- Added status field to manage publishing states (draft, published, archived) for user types.
- Enhanced the user type API to support pricing operations, including retrieval and updates for pricing information.
- Refactored tests to cover new pricing functionalities and ensure robust handling of user type statuses.
- Modified the UpdateUserLastLogin method to validate that loginCtx is not nil, returning an error if it is.
- Updated the corresponding test to reflect this change, ensuring that an error is asserted when loginCtx is nil, improving error handling and robustness of user login tracking.
- Enhanced the SignIDToken method to include additional Yao-specific fields such as tenant_id, team_id, is_owner, and team details in the token claims.
- Improved the structure of claims to support team information, ensuring comprehensive metadata is included in the generated tokens.
- Updated the UpdateUserLastLogin method to accept a LoginContext, allowing for tracking of last login IP, user agent, device, and platform.
- Modified the LoginThirdParty and LoginByUserID functions to utilize the new LoginContext, improving the accuracy of login tracking.
- Enhanced the user model to include fields for last login details, ensuring comprehensive user activity logging.
- Refactored tests to validate the new login context handling, ensuring robust coverage of the updated functionality.
- Updated methods related to refresh token generation and storage to accept optional extra claims, allowing for additional metadata such as team_id and tenant_id.
- Refactored tests to utilize the new method signatures, ensuring comprehensive coverage of the updated functionality.
- Introduced a new endpoint for team selection that issues tokens with team-specific claims, improving user experience in multi-team scenarios.
- Removed unnecessary blank lines in the TokenClaims, AuthorizedInfo, and JWTClaims structs to enhance code clarity and maintainability.
- Ensured consistent formatting across the claims structures for better organization.
- Updated storeAccessToken and related methods to accept an optional extraClaims parameter for additional flexibility.
- Modified MakeAccessToken and generateAccessTokenWithScope functions to incorporate extra claims, enhancing token customization.
- Adjusted tests to utilize the new extraClaims parameter, ensuring comprehensive coverage of the updated functionality.
- Added ScopeTeamSelection constant for temporary access token.
- Updated LoginByUserID function to include team selection logic based on user team count.
- Modified access token generation to use user subject for both MFA and team selection scenarios.
- Enhanced LoginResponse structure to include TokenType and Scope fields for clarity.
- Updated GetTeamsByMember method to include role information and owner status for each team member.
- Refactored GinTeamList to utilize the new getUserTeams function, simplifying team retrieval logic and removing pagination.
- Introduced getUserTeams and getUserTeamsCount functions to encapsulate team membership logic, improving code organization and clarity.
- Removed deprecated team retrieval logic from user/team.go, streamlining the codebase.
- Updated LoginResponse structure to replace MFAToken and MFATokenExpiresIn with AccessToken and ExpiresIn for improved clarity.
- Adjusted LoginByUserID and SendLoginCookies functions to utilize the new access token fields.
- Modified authback function to respond with the updated login response structure, enhancing the MFA flow.
- Removed the previous MFA check from the LoginThirdParty function and integrated MFA token generation within the LoginByUserID function.
- Enhanced the LoginResponse structure to include MFAToken and MFATokenExpiresIn fields for better MFA handling.
- Updated the SendLoginCookies function to manage MFA token cookies appropriately.
- Adjusted the authback function to respond with MFA status and token when MFA is required, improving the login flow for users with MFA enabled.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Introduced invitation_id handling for member management, allowing for unique identification of pending invitations.
- Added methods to create, update, and remove members by invitation_id, improving the invitation workflow.
- Updated member data structures and API responses to include invitation-related fields, enhancing clarity and usability.
- Implemented tests for invitation ID operations, ensuring robust validation and error handling.
- Refactored team access checks to streamline member management processes.
- Introduced IsTeamOwner and IsTeamMember methods to verify user ownership and membership status within a team.
- Added CheckTeamAccess method to assess a user's access level, returning ownership and membership status.
- Enhanced user types with new MemberResponse and MemberDetailResponse structures for improved member management.
- Updated routing for team member management to utilize new handler functions for clarity and consistency.
- Implemented RemoveAllTeamMembers method in DefaultUser to delete all members from a team during team deletion.
- Added TestTeamDeleteMemberCleanup to verify that all members are removed when a team is deleted.
- Refactored team creation and deletion logic to ensure proper member management and error handling during these operations.
- Introduced methods to set and retrieve authorized information from the context, enhancing the OAuth guard functionality.
- Added a new `AuthorizedInfo` type to encapsulate user-related data such as subject, client ID, user ID, and scope.
- Implemented session ID retrieval from various sources (cookies, headers, query strings) to improve session management.
- Updated test utilities to support the creation of test users and access tokens, ensuring comprehensive testing of OAuth functionalities.
- Updated the LoginResponse structure to include MFAEnabled status, reflecting the user's MFA configuration.
- Modified the authback function in oauth.go to return the MFAEnabled status in the response.
- Introduced a utility function to convert various types to boolean for determining MFA status from user data.