Commit graph

2918 commits

Author SHA1 Message Date
Max
fb4df03b02
Merge pull request #1237 from trheyi/main
Enhance member management with member_id and email checks
2025-10-26 11:09:35 +08:00
Max
f71ce2ac9a Implement existence checks for various entities in update functions
- Added functions to check the existence of invitation codes, members, OAuth accounts, roles, teams, and user types before performing updates, enhancing error handling and user feedback.
- Updated relevant update functions to utilize these existence checks, ensuring accurate error messages when no changes are made or when entities do not exist.
- Refactored tests to validate the new existence check logic, improving overall test coverage and reliability.
2025-10-26 11:09:07 +08:00
Max
5f6f8d7911 Enhance member management with member_id and email checks
- Introduced member_id as a unique identifier for members, improving data integrity and consistency across member operations.
- Updated member-related functions to utilize member_id instead of internal IDs, enhancing API usability and clarity.
- Implemented email existence checks for team members, allowing for better validation during member creation and updates.
- Refactored existing tests to accommodate changes in member identification and email validation, ensuring comprehensive coverage and reliability.
- Added new API endpoint for checking if an email exists within a team, improving user experience during member management.
2025-10-26 09:49:45 +08:00
Max
ec8650b59e
Merge pull request #1236 from trheyi/main
Implement robot member creation and validation
2025-10-26 09:04:46 +08:00
Max
fd10a058b1 Implement robot member creation and validation
- Introduced a new endpoint for creating robot members, enhancing the member model to include fields specific to robots such as email, system prompt, and autonomous mode.
- Refactored existing member creation logic to accommodate robot-specific requirements and ensure email uniqueness within teams.
- Updated request and response structures to support the new robot member functionality, improving API consistency.
- Added comprehensive test cases to validate the new robot member creation process, including scenarios for required fields, duplicate emails, and invalid inputs.
2025-10-26 09:04:22 +08:00
Max
56110d29cd
Merge pull request #1235 from trheyi/main
Update member model and robot member handling
2025-10-25 17:41:56 +08:00
Max
f89dbc2109 Update member model and robot member handling
- Enhanced the member model by adding 'avatar' and updating 'display_name' and 'bio' fields for improved identity representation.
- Refactored robot member creation and validation to utilize the new fields, ensuring consistency across user and robot profiles.
- Updated test cases to reflect changes in member data structure, improving coverage and accuracy in robot member operations.
- Adjusted database indices and constraints to accommodate new fields and ensure efficient querying.
2025-10-25 17:41:30 +08:00
Max
4829a2b761
Merge pull request #1234 from trheyi/main
Add Neo loading in test preparation
2025-10-25 16:43:48 +08:00
Max
b5812a7f2f Add Neo loading in test preparation
- Integrated Neo loading in the Prepare function of testutils.go to ensure the Neo environment is initialized before running tests.
- Updated error handling to log failures in loading Neo, enhancing test reliability and feedback.
- Adjusted variable assignment for Knowledge Base loading to maintain consistency in error handling.
2025-10-25 16:43:28 +08:00
Max
7230f62532
Merge pull request #1233 from trheyi/main
Refactor API handler functions for assistants in Neo package
2025-10-25 16:02:25 +08:00
Max
d8f267694d Refactor API handler functions for assistants in Neo package
- Updated the assistant-related API handler functions in neo/api.go to follow Go naming conventions by capitalizing the function names, making them exported for use in openapi/agent.
- This change enhances code readability and consistency across the API implementation.
- Added new LLM and MCP server management handlers in their respective packages, improving the overall structure and organization of the OpenAPI module.
- Removed the obsolete agent.go file, streamlining the codebase.
2025-10-25 16:02:01 +08:00
Max
963a580be7
Merge pull request #1232 from trheyi/main
Update user status in test cases from "enabled" to "active"
2025-10-25 15:00:23 +08:00
Max
0abb8c7d3b Update user status in test cases from "enabled" to "active"
- Modified the user creation functions in entry_test.go and invitation_test.go to use "active" as the status value instead of "enabled", aligning with the valid enum values for user status.
- This change ensures consistency across user-related tests and improves clarity regarding user status representation.
2025-10-25 14:59:57 +08:00
Max
c96fd2951e
Merge pull request #1231 from trheyi/main
Update Neo4j test URL in workflow configurations
2025-10-25 14:42:10 +08:00
Max
741847224d Update Neo4j test URL in workflow configurations
- Changed the NEO4J_TEST_URL from "neo4j://localhost:7686" to "neo4j://localhost:7687" in both pr-test.yml and unit-test.yml to reflect the updated Neo4j service endpoint.
- Cleaned up whitespace in the OpenAPI signin configurations for better readability.
2025-10-25 14:41:42 +08:00
Max
d0841e8aa7
Merge pull request #1230 from trheyi/main
Add SIGNIN_CLIENT_ID to workflow configurations
2025-10-25 13:40:19 +08:00
Max
6302cfc960 Add SIGNIN_CLIENT_ID to workflow configurations
- Introduced SIGNIN_CLIENT_ID environment variable in both pr-test.yml and unit-test.yml for OpenAPI signin configurations, ensuring consistent access across workflows.
- This addition enhances the setup for authentication processes in the testing environment.
2025-10-25 13:39:55 +08:00
Max
e26585d2d0
Merge pull request #1229 from trheyi/main
Refactor test utilities and enhance access token handling
2025-10-25 13:27:15 +08:00
Max
ddf8fd7a32 Refactor test utilities and enhance access token handling
- Introduced ObtainAccessTokenWithRootPermission function to streamline the creation of test users with root permissions, ensuring consistent access token generation for tests.
- Updated various test cases to utilize the new function, improving clarity and reducing redundancy in access token acquisition.
- Enhanced team configuration retrieval to expose public settings while hiding sensitive information, improving security in API responses.
2025-10-25 13:26:51 +08:00
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