Commit graph

2449 commits

Author SHA1 Message Date
Max
8dedbb1c2b
Merge pull request #1013 from trheyi/main
Refactor dynamic client registration tests in OAuth service
2025-07-18 15:13:42 +08:00
Max
b959768016 Refactor dynamic client registration tests in OAuth service
- Updated test cases to improve coverage for dynamic client registration scenarios.
- Enhanced error handling tests for various client registration edge cases, ensuring robustness in validation processes.
- Streamlined test setup for consistency across different testing environments.
2025-07-18 15:13:08 +08:00
Max
7590daad90
Merge pull request #1012 from trheyi/main
Add tests for dynamic client registration validation in OAuth service
2025-07-18 15:00:03 +08:00
Max
9fd0d4713a Add tests for dynamic client registration validation in OAuth service
- Implemented tests to verify error handling for disallowed redirect URI hosts and schemes during dynamic client registration.
- Updated test clients to use localhost for redirect URIs, ensuring consistency in testing environment.
2025-07-18 14:58:29 +08:00
Max
6cf7070370
Merge pull request #1011 from trheyi/main
Enhance client creation and dynamic registration in OAuth service
2025-07-18 14:52:03 +08:00
Max
944c3e1b8e Enhance client creation and dynamic registration in OAuth service
- Added default values for grant types, response types, application type, and token endpoint auth method during dynamic client registration.
- Implemented nil checks for client information in the CreateClient and UpdateClient methods to ensure robust error handling and validation.
2025-07-18 14:51:34 +08:00
Max
7ec0978ce0
Merge pull request #1010 from trheyi/main
Refactor OAuth service to improve client registration and user manage…
2025-07-18 14:32:13 +08:00
Max
d3874b28ad Refactor OAuth service to improve client registration and user management
- Enhanced dynamic client registration by refining client ID and secret generation methods.
- Improved validation processes for client registration requests and authorization flows.
- Streamlined user management integration with the updated user model, ensuring compatibility and efficiency.
- Updated token management features to support new client and user interactions, enhancing overall service functionality.
2025-07-18 14:28:44 +08:00
Max
16c9783b98
Merge pull request #1009 from trheyi/main
Implement dynamic client registration and enhance OAuth service funct…
2025-07-18 12:11:51 +08:00
Max
58eb00f8f2 Implement dynamic client registration and enhance OAuth service functionality
- Added dynamic client registration support in the OAuth service, implementing RFC 7591 for automatic client registration.
- Introduced methods for generating client IDs and secrets, validating registration requests, and creating client information.
- Enhanced authorization flow by validating client requests, redirect URIs, and response types.
- Implemented token management features, including token introspection, token exchange, and refresh token handling.
- Improved security with state parameter generation and validation, as well as code challenge methods for PKCE.
- Updated endpoint discovery and server metadata retrieval to include new features and capabilities.
2025-07-18 12:11:21 +08:00
Max
ad0bbb0a27
Merge pull request #1008 from trheyi/main
Add user model integration and enhance OAuth user provider
2025-07-18 11:32:12 +08:00
Max
fb20eb54c5 Add user model integration and enhance OAuth user provider
- Introduced a new user model `yao/models/user.mod.yao` to support user management functionalities.
- Updated the OAuth service to utilize the new `DefaultUser` provider, enhancing user authentication and management capabilities.
- Refactored user retrieval methods to align with the new user model structure, ensuring compatibility and improved functionality.
- Added token management methods to the user provider interface, streamlining token handling processes.
- Enhanced test utilities to include the new user model for comprehensive testing coverage.
2025-07-18 11:31:39 +08:00
Max
7636455d08
Merge pull request #1007 from trheyi/main
Remove deprecated OAuth interfaces and types
2025-07-17 17:23:30 +08:00
Max
e19aa4b8df Remove deprecated OAuth interfaces and types
- Deleted the OAuth interface and related types that were previously defined in the `interfaces.go` and `types.go` files, streamlining the codebase.
- Updated the `oauth.go` file to integrate user and client providers directly, enhancing the service's functionality and reducing complexity.
- Refactored the user information retrieval method to utilize the new user provider structure, ensuring compatibility with the updated architecture.
2025-07-17 17:19:22 +08:00
Max
93823b87d9
Merge pull request #1006 from trheyi/main
Add OAuth service implementation with configuration and validation
2025-07-17 12:05:13 +08:00
Max
54607bc3ee Add OAuth service implementation with configuration and validation
- Introduced the OAuth service structure, including configuration management and user provider integration.
- Implemented default settings and validation for various configuration parameters, ensuring robust service initialization.
- Added methods for retrieving service configuration and user information based on access tokens.
- Defined error handling for configuration issues, enhancing reliability of the OAuth service.
2025-07-17 12:04:42 +08:00
Max
f0489a3838
Merge pull request #1005 from trheyi/main
Set default prefix in Prepare function for test environment
2025-07-16 17:05:36 +08:00
Max
57d61c1ba3 Set default prefix in Prepare function for test environment
- Added logic to set a default prefix of "yao_" for the application if none is provided, ensuring consistent naming conventions in the test setup.
2025-07-16 17:05:05 +08:00
Max
a798c44279
Merge pull request #1004 from trheyi/main
Add system model loading functionality for testing
2025-07-16 16:44:20 +08:00
Max
d5dd0f56c7 Add system model loading functionality for testing
- Introduced a new function `loadSystemModels` to load predefined system models for testing purposes, enhancing the test environment setup.
- Implemented error handling for model loading and migration, ensuring robust integration of system models.
- Updated the `Prepare` function to call `loadSystemModels`, streamlining the test preparation process.
2025-07-16 16:43:45 +08:00
Max
6ebba746fb
Merge pull request #1003 from trheyi/main
Enhance DSL error handling and metadata management
2025-07-16 16:16:07 +08:00
Max
206a6505d1 Enhance DSL error handling and metadata management
- Improved error messages in the Inspect, Update, and Delete methods to provide clearer context by including the DSL type.
- Added default store type handling in the Create method and ensured validation for store types.
- Enhanced the Inspect method in the FS and DB implementations to extract and populate metadata fields from source data, including label, description, tags, and sort order.
- Updated the Info struct to ensure correct store type assignment based on the source of the data, improving consistency across data retrieval methods.
2025-07-16 16:15:16 +08:00
Max
1dda938f74
Merge pull request #1002 from trheyi/main
Update go.mod and go.sum to include new indirect dependencies
2025-07-16 15:17:02 +08:00
Max
1a231ac9b2 Update go.mod and go.sum to include new indirect dependencies
- Added github.com/mark3labs/mcp-go v0.32.0 and github.com/yosida95/uritemplate/v3 v3.0.2 as indirect dependencies in go.mod.
- Updated go.sum to reflect the new dependencies and their respective checksums.
2025-07-16 15:16:19 +08:00
Max
8b3d617ffa
Merge pull request #1001 from trheyi/main
Implement enhanced loading, unloading, and validation for YaoConnector
2025-07-16 12:34:32 +08:00
Max
520e73627b Implement enhanced loading, unloading, and validation for YaoConnector
- Added comprehensive loading logic in the Load method to support various data sources, including direct source input, file system, and database.
- Improved error handling by validating options in Load, Unload, and Reload methods, ensuring required parameters are provided.
- Enhanced the Loaded method to return detailed metadata for all connectors, improving visibility into available DSLs.
- Updated the Validate method to return a successful validation response with an empty lint message array.
- Refined the Execute method to indicate unimplemented functionality, enhancing clarity for future development.
2025-07-16 12:33:48 +08:00
Max
dcc83f23d2
Merge pull request #1000 from trheyi/main
Refactor 'readable' field to 'readonly' in model and database handling
2025-07-16 11:39:57 +08:00
Max
1f1f44fab5 Refactor 'readable' field to 'readonly' in model and database handling
- Updated the Info struct to replace the 'readable' field with 'readonly' for better clarity in metadata representation.
- Modified Create and Update methods in db.go to utilize the new 'readonly' field.
- Enhanced test cases to assert the correctness of 'readonly' and 'builtin' fields, ensuring comprehensive validation of model attributes.
- Adjusted model loading logic to correctly populate 'readonly' and 'builtin' fields from metadata.
2025-07-16 11:39:36 +08:00
Max
2c8b871c57
Merge pull request #999 from trheyi/main
Enhance model loading and error handling in YaoModel
2025-07-15 20:22:26 +08:00
Max
25c5688727 Enhance model loading and error handling in YaoModel
- Refactored the Load, Unload, and Reload methods to support multiple data source options, including loading from a provided source, file system, or database.
- Improved error handling by implementing panic recovery in the Unload method to manage model retrieval failures gracefully.
- Removed the Source field from UnloadOptions struct to streamline the options interface.
2025-07-15 20:21:45 +08:00
Max
852815ca67
Merge pull request #998 from trheyi/main
Enhance time value handling and improve test assertions
2025-07-15 18:55:10 +08:00
Max
5f9eee97ea Enhance time value handling and improve test assertions
- Added a new toTime function to convert various time formats to RFC3339 strings, ensuring consistent time representation in the data.
- Updated the fmtRow function to utilize the new toTime function for 'mtime' and 'ctime' fields, enhancing data formatting.
- Modified the TestDBList function to include a check for non-empty lists before asserting the ID, improving test robustness.
2025-07-15 18:54:41 +08:00
Max
e21d56aff8
Merge pull request #997 from trheyi/main
Refactor boolean value handling in fmtRow function
2025-07-15 18:38:01 +08:00
Max
cb9606681e Refactor boolean value handling in fmtRow function
- Simplified the conversion of 'readable' and 'built_in' fields to boolean values by utilizing a new toBool function, enhancing code readability and maintainability.
- Removed debug SQL print statements from the Update method to clean up the output and improve performance.
2025-07-15 18:37:42 +08:00
Max
8b0cf09a28
Merge pull request #996 from trheyi/main
Enhance DSL data handling and model structure
2025-07-15 18:28:37 +08:00
Max
bd95ac0604 Enhance DSL data handling and model structure
- Introduced a new fmtRow function to format row data for DSL info, improving data consistency and readability.
- Updated the Inspect and List methods to utilize the fmtRow function for better data representation.
- Added new fields for 'readonly' and 'built_in' in the DSL model, allowing for more detailed metadata management.
- Enhanced the Create and Update methods to handle the new fields, ensuring proper data storage and retrieval.
- Updated the ListOptions struct to include a Pattern field for file name matching, improving search capabilities.
2025-07-15 18:28:01 +08:00
Max
5019c33f35
Merge pull request #995 from trheyi/main
Refactor DSL list retrieval to support conditional data source selection
2025-07-15 16:59:10 +08:00
Max
bdd7c0865e Refactor DSL list retrieval to support conditional data source selection
- Enhanced the List method in the DSL struct to conditionally retrieve data from either the database or file system based on the StoreType specified in ListOptions.
- Updated the Info struct to include a new Source field for optional source content retrieval.
- Modified the List methods in both DB and FS to include source information when requested, improving data accessibility and flexibility.
2025-07-15 16:58:41 +08:00
Max
f00d5c0b8a
Merge pull request #994 from trheyi/main
Enhance model definitions and loading process for system models
2025-07-15 16:33:40 +08:00
Max
c74916296a Enhance model definitions and loading process for system models
- Added new system models for assistant, attachment, audit, chat, config, dsl, history, and kb with metadata including tags, built-in status, read-only attributes, and sort order.
- Refactored the model loading process to include a dedicated function for loading system models, improving organization and maintainability.
- Updated the application loading logic to set a default prefix for system tables, ensuring consistent naming conventions.
- Improved error handling during model loading and migration processes for better reliability.
2025-07-15 16:33:14 +08:00
Max
c60a25ddea
Merge pull request #993 from trheyi/main
Refactor DSL management by introducing IO interfaces for database and…
2025-07-15 13:02:22 +08:00
Max
62e20a90ea Refactor DSL management by introducing IO interfaces for database and file system operations
- Removed the db.go and fs.go files, consolidating database and file system interactions into a unified IO interface.
- Updated DSL struct to include db and fs fields for improved separation of concerns.
- Refactored existing methods across various DSL managers (API, Connector, MCP, Model) to utilize the new IO interfaces for operations like Inspect, Create, Update, Delete, and List.
- Enhanced error handling and validation in Create, Update, and Delete methods to ensure robust functionality.
- Updated types to include new options for Load, Unload, and Reload operations, improving flexibility and usability.
2025-07-15 12:25:56 +08:00
Max
74cdcef637
Merge pull request #992 from trheyi/main
Add DSL Manager
2025-07-14 21:05:27 +08:00
Max
06f5134083 Update dependencies in go.mod and go.sum to latest versions for improved stability and performance 2025-07-14 21:03:57 +08:00
Max
0b5d7fcc41 Remove unused indexes from multiple model files and delete the mcp model file to streamline the database schema. 2025-07-14 11:26:58 +08:00
Max
db4231b5da
Merge pull request #991 from trheyi/main
Update dependencies in go.mod and go.sum to latest versions for impro…
2025-07-13 09:16:29 +08:00
Max
a13fe36aa6 Update dependencies in go.mod and go.sum to latest versions for improved stability and performance 2025-07-13 09:15:54 +08:00
Max
37a75aac75
Merge pull request #990 from trheyi/main
Update dependencies in go.mod and go.sum to latest versions for impro…
2025-07-10 18:52:23 +08:00
Max
d6b44730e6 Update dependencies in go.mod and go.sum to latest versions for improved compatibility and performance
- Upgraded golang.org/x/text to v0.27.0, golang.org/x/image to v0.29.0, golang.org/x/sync to v0.16.0, and golang.org/x/tools to v0.34.0.
- Adjusted go.sum to reflect the changes in dependency versions, ensuring the project uses the most recent and stable library versions.
2025-07-10 18:49:55 +08:00
Max
b94185d6e7
Merge pull request #989 from trheyi/main
Update dependencies
2025-07-07 10:29:57 +08:00