Commit graph

2899 commits

Author SHA1 Message Date
Max
e2fa04f876
Merge pull request #1228 from trheyi/main
Update member model to include profile fields and enhance invitation …
2025-10-23 19:42:16 +08:00
Max
f31b3f5882 Update member model to include profile fields and enhance invitation handling
- Added display_name, bio, and email fields to the member model for improved team-specific identity.
- Updated team invitation creation and acceptance logic to handle new profile fields, ensuring proper data management and user experience.
- Implemented logic to copy user profile fields when creating or updating members, enhancing data consistency.
2025-10-23 19:40:29 +08:00
Max
932a8d2c0e
Merge pull request #1227 from trheyi/main
Add current team retrieval endpoint and refactor team access checks
2025-10-23 18:15:09 +08:00
Max
b9e71823ca Add current team retrieval endpoint and refactor team access checks 2025-10-23 17:50:32 +08:00
Max
93b48f474c
Merge pull request #1226 from trheyi/main
Update team invitation handling and user invitation acceptance logic
2025-10-23 11:24:03 +08:00
Max
5d6f346601 Update team invitation handling and user invitation acceptance logic
- Refactored the team invitation creation function to utilize the new authorized package for improved user authentication checks.
- Enhanced the invitation acceptance logic to include the user ID of the person who updated the invitation, improving tracking and accountability.
- Adjusted the invitation data preparation to incorporate user-specific scopes, ensuring proper permissions are applied during invitation processing.
2025-10-23 11:22:10 +08:00
Max
827bcb7757
Merge pull request #1225 from trheyi/main
Refactor test case structure for path matching in ACL tests
2025-10-23 10:55:15 +08:00
Max
976eb2769d Refactor test case structure for path matching in ACL tests
- Adjusted the formatting of the test case struct in scope_test.go for improved readability.
- No functional changes were made; this commit focuses on code style consistency.
2025-10-23 10:54:48 +08:00
Max
cf009f46e5
Merge pull request #1224 from trheyi/main
Normalize request paths in ACL checks and add path normalization utility
2025-10-23 10:49:42 +08:00
Max
cd9c52fe33 Normalize request paths in ACL checks and add path normalization utility
- Implemented path normalization in the ACL enforcement logic to ensure consistent matching by removing trailing slashes from request paths.
- Introduced a new utility function, normalizePath, to handle path normalization across various components.
- Updated endpoint matching and public endpoint checks to utilize the normalized paths, improving access decision accuracy.
- Enhanced team and member creation logic to include a new field, __yao_team_id, for better data management.
2025-10-23 10:48:53 +08:00
Max
7b61be9379
Merge pull request #1223 from trheyi/main
Enhance ACL configuration and enforcement with path prefix support
2025-10-22 19:20:06 +08:00
Max
cc181a52f6 Enhance ACL configuration and enforcement with path prefix support
- Updated ACL configuration to include a PathPrefix field, allowing for dynamic path stripping from request URLs.
- Enhanced ACL enforcement logic to log the configured path prefix and adjust request paths accordingly during access checks.
- Improved logging throughout the enforcement process to provide clearer insights into access decisions and scope matching.
- Registered built-in scopes for temporary access tokens, enhancing flexibility in access control for specific endpoints.
- Updated scope management to support constraints for matched scopes, improving granularity in access control configurations.
2025-10-22 19:19:30 +08:00
Max
e132c355d1
Merge pull request #1222 from trheyi/main
Enhance ACL enforcement and logging for improved error handling
2025-10-22 09:51:48 +08:00
Max
7aff66e3b4 Enhance ACL enforcement and logging for improved error handling
- Added detailed logging for ACL enforcement failures in the OAuth guard, providing clearer insights into permission issues.
- Updated error messages in the ACL enforcement logic to include contextual information such as client and user IDs, enhancing debugging capabilities.
- Introduced new constraints (CreatorOnly, EditorOnly) in the data access model, allowing for more granular control over data visibility based on user roles.
- Enhanced scope definitions to support additional constraints, improving flexibility in access control configurations.
- Updated documentation to reflect changes in data constraints and their usage in API handlers.
2025-10-22 09:51:06 +08:00
Max
a321ed7405
Merge pull request #1221 from trheyi/main
Implement detailed ACL enforcement logic and data access constraints
2025-10-21 17:04:49 +08:00
Max
e96896eb40 Implement detailed ACL enforcement logic and data access constraints
- Refactored the ACL enforcement process to include a comprehensive chain of permission checks for clients, users, teams, and members.
- Introduced data access constraints (OwnerOnly, TeamOnly) to enhance access control based on endpoint requirements.
- Updated the Error struct to include the stage of permission checks where failures occur, improving error reporting.
- Enhanced scope management with wildcard matching capabilities and added checks for restricted scopes.
- Implemented tests to validate the enforcement logic and ensure correct handling of data access constraints.
2025-10-21 17:04:20 +08:00
Max
508df434c8
Merge pull request #1220 from trheyi/main
Enhance ACL configuration and role management integration
2025-10-21 10:51:50 +08:00
Max
8e31f43039 Enhance ACL configuration and role management integration
- Updated ACL configuration to include Cache and Provider fields for improved role management.
- Initialized Role Manager within the ACL setup, ensuring proper role handling and cache management.
- Enhanced tests to verify access denial and error handling for unmatched endpoints, improving overall test coverage and clarity in error responses.
2025-10-21 10:51:26 +08:00
Max
6b38a235af
Merge pull request #1219 from trheyi/main
Update team model and creation logic to support role management
2025-10-20 17:02:00 +08:00
Max
b1db5505ea Update team model and creation logic to support role management
- Added role_id field to the team model for specifying team owner roles.
- Enhanced team creation logic to set default role_id based on team configuration if not provided.
- Updated tests to reflect changes in team type and role handling, ensuring accurate assertions.
- Improved documentation for team configuration to clarify default role settings for team creators.
2025-10-20 17:00:33 +08:00
Max
0bd6bdcda3 Refactor OAuth guard and ACL error handling for improved response structure
- 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.
2025-10-20 16:23:12 +08:00
Max
52b4c37fe1
Merge pull request #1218 from trheyi/main
Refactor seed import logic to exclude auto-generated fields and impro…
2025-10-20 11:33:51 +08:00
Max
0f22d2d8c8 Refactor seed import logic to exclude auto-generated fields and improve error handling
- Updated import functions to filter out auto-generated fields (e.g., timestamps) when processing records.
- Enhanced error handling during batch inserts to provide clearer logging of failures.
- Removed detailed logging from TestSeedImportYao to streamline test output while maintaining essential assertions.
2025-10-20 11:33:19 +08:00
Max
a2fedc8ae2
Merge pull request #1217 from trheyi/main
Enhance seed import functionality with detailed logging and column fi…
2025-10-20 11:14:08 +08:00
Max
9c82f12eca Enhance seed import functionality with detailed logging and column filtering
- Added detailed logging for import results in TestSeedImportYao to aid debugging.
- Updated import functions to filter columns based on model definitions, ensuring only valid columns are processed.
- Introduced a sorting mechanism for column names to maintain consistent ordering during imports.
2025-10-20 11:13:44 +08:00
Max
ac5794cd43
Merge pull request #1216 from trheyi/main
Implement JSON field parsing for CSV and XLSX imports in seed module
2025-10-20 10:52:34 +08:00
Max
2e2abf1d5f Implement JSON field parsing for CSV and XLSX imports in seed module
- Added tests to verify correct parsing of JSON fields from both CSV and XLSX files during data import.
- Enhanced import functions to build a column type map for detecting JSON fields and parse them appropriately.
- Introduced helper functions for building column type maps and parsing JSON fields, improving data integrity during imports.
- Updated existing tests to ensure successful imports and correct handling of JSON data structures.
2025-10-20 10:52:04 +08:00
Max
5265b7e459
Merge pull request #1215 from trheyi/main
Add seed file system support and deprecate legacy registrations
2025-10-20 10:35:41 +08:00
Max
8b9cd9f951 Add seed file system support and deprecate legacy registrations
- Introduced a new read-only file system for seed data, enhancing initial data seeding capabilities.
- Updated the file system registration to include the seed root and clarified comments regarding the use of app, data, system, DSL, and script registrations, marking them for future deprecation.
- Improved code clarity and maintainability by restructuring file system registrations.
2025-10-20 10:34:52 +08:00
Max
815671a6c9
Merge pull request #1214 from trheyi/main
Enhance OAuth guard with authorized info handling and ACL integration
2025-10-20 08:51:03 +08:00
Max
0e260ffb6a Enhance OAuth guard with authorized info handling and ACL integration
- 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.
2025-10-20 08:50:20 +08:00
Max
a33b13d6b7
Merge pull request #1213 from trheyi/main
Add ACL support to OAuth guard and error handling
2025-10-18 09:23:00 +08:00
Max
667d40b5a1 Add ACL support to OAuth guard and error handling
- 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.
2025-10-18 09:22:35 +08:00
Max
9f4341882e
Merge pull request #1212 from trheyi/main
Refactor session cookie handling in user entry logic
2025-10-17 13:34:26 +08:00
Max
140368a69b Refactor session cookie handling in user entry logic
- 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.
2025-10-17 13:33:47 +08:00
Max
f91f1cb32e
Merge pull request #1211 from trheyi/main
Enhance user registration status handling during third-party login
2025-10-17 09:42:23 +08:00
Max
5437ceec7d Enhance user registration status handling during third-party login
- 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.
2025-10-17 09:41:41 +08:00
Max
08744728c6
Merge pull request #1210 from trheyi/main
Enhance user authentication with Remember Me functionality
2025-10-17 09:31:59 +08:00
Max
5d1b665457 Enhance user authentication with Remember Me functionality
- 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.
2025-10-17 09:31:30 +08:00
Max
36909d9f54
Merge pull request #1209 from trheyi/main
Add invitation model and related functionality
2025-10-16 19:09:24 +08:00
Max
9a2a636314 Add invitation model and related functionality
- 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.
2025-10-16 19:08:54 +08:00
Max
6f97ad906b
Merge pull request #1208 from trheyi/main
Add logout functionality and expose refresh token retrieval
2025-10-16 14:54:39 +08:00
Max
c58bc8c4fe Add logout functionality and expose refresh token retrieval
- 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.
2025-10-16 14:53:49 +08:00
Max
63ff2943f5
Merge pull request #1207 from trheyi/main
Add OTP resend functionality for user verification
2025-10-16 14:39:22 +08:00
Max
a8159a0e90 Add OTP resend functionality for user verification
- 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.
2025-10-16 14:35:48 +08:00
Max
a3e418e326
Merge pull request #1206 from trheyi/main
Update asset modification times and enhance user authentication flow
2025-10-16 10:29:01 +08:00
Max
48f531cf82 Update asset modification times and enhance 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.
2025-10-16 10:28:00 +08:00
Max
2f72b19227
Merge pull request #1205 from trheyi/main
Implement deep copy for entry configuration to prevent global config …
2025-10-15 19:33:09 +08:00
Max
481323104a Implement deep copy for entry configuration to prevent global config corruption
- 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.
2025-10-15 19:32:40 +08:00
Max
c0317354d6
Merge pull request #1204 from trheyi/main
Refactor OTP tests and cleanup code
2025-10-15 17:22:15 +08:00