Commit Graph

167 Commits

Author SHA1 Message Date
Yeuoly a70d808dd0 feat(dynamic_select): implement dynamic parameter fetching functionality (#358)
* feat(dynamic_select): implement dynamic parameter fetching functionality

- Added FetchDynamicParameterOptions function to handle dynamic parameter selection.
- Introduced new access type and action for dynamic select in access_types.
- Updated HTTP server routes to include the new endpoint for fetching dynamic parameters.
- Created necessary service and controller files for dynamic select operations.

* refactor(access_types): rename dynamic select access type to dynamic parameter

- Updated access type constants to reflect the change from PLUGIN_ACCESS_TYPE_DYNAMIC_SELECT to PLUGIN_ACCESS_TYPE_DYNAMIC_PARAMETER.
- Adjusted related references in the PluginDispatchers and FetchDynamicParameterOptions function to maintain consistency.
2025-06-27 19:24:59 +08:00
Yeuoly a6c8fae9c7 feat: add decode plugin from identifier endpoint (#349)
* feat: add decode plugin from identifier endpoint

- Introduced a new endpoint to decode a plugin from a unique identifier.
- Implemented the DecodePluginFromIdentifier function to handle decoding and verification of plugin signatures.
- Updated the HTTP server routes to include the new decode endpoint.

* refactor: update decode plugin endpoint path

- Moved the decode plugin from identifier endpoint to a new path for better organization.
- Updated the HTTP server routes accordingly to reflect the new endpoint structure.
2025-06-18 16:01:15 +08:00
Novice cfd399b602 feat: agent plugin add meta version 2025-06-05 09:35:04 +08:00
Good Wood 2cd64adf3b feat: change listPlugin struct & add total (#302) 2025-05-27 12:53:37 +08:00
Yeuoly 478c98da5c fix: signature dose not work as expected, if upload new pkg to old dify (#311)
- Updated the  method in the  interface to remove the  parameter, simplifying its usage.
- Introduced a new  function to provide a default verification structure.
- Added a  file to store verification data, improving the plugin signing process.
- Enhanced tests in  to validate the verification process, ensuring proper handling of success and failure scenarios.
- Refactored related code to accommodate the new verification structure and improve overall maintainability.
2025-05-26 13:10:34 +08:00
Yeuoly 3d28e0ceed feat: Add code generation for plugin controllers and services (#301)
* feat: Add code generation for plugin controllers and services

- Introduced a code generation mechanism for plugin controllers and services, allowing for automatic generation based on defined dispatchers.
- Created new files for generated controllers, services, and templates to streamline the plugin invocation process.
- Removed outdated functions related to tool validation and runtime parameters, consolidating functionality into generated files.
- Updated dependencies in go.mod and go.sum to include necessary packages for the new code generation features.

* fix
2025-05-23 14:57:56 +08:00
Yeuoly 9a1da25d59 feat: Enhance plugin signing with authorized category verification (#293)
* feat: Enhance plugin signing with authorized category verification

- Added support for an `authorized_category` flag in the signature command to validate the category before signing.
- Updated the `Sign` function to accept a verification parameter, allowing for category-based signing.
- Enhanced error handling for invalid categories during the signing process.
- Updated tests to cover new verification scenarios and ensure proper functionality with the authorized category.

* fix

* fix

* test

* test: Add unit test for plugin verification without verification field

- Introduced a new test case to verify the behavior of plugins that lack a verification field.
- Updated the signature_test.go file to include the test, ensuring proper functionality of the signing process.
- Removed the outdated verifier_test.go file and associated test data to streamline the codebase.
2025-05-21 20:05:45 +08:00
Yeuoly d884cab8ae feat: add plugin reinstallation functionality and admin API support (#285)
* feat: add plugin reinstallation functionality and admin API support

- Implemented ReinstallToAWSFromPkg method to allow reinstallation of plugins on AWS Lambda, updating function URL and name.
- Added clearServerlessRuntimeCache method to manage serverless runtime cache.
- Enhanced LaunchPlugin to support an ignoreIdempotent flag for forced reinstallation.
- Introduced admin API endpoints for plugin reinstallation, secured with an API key validation middleware.
- Updated configuration to include AdminApiEnabled and AdminApiKey settings.

* refactor: update plugin reinstallation endpoint and improve unauthorized response

- Changed the plugin reinstallation endpoint from "/plugins/reinstall" to "/plugin/serverless/reinstall" for better clarity.
- Modified the unauthorized response in the AdminAPIKey middleware to return a more descriptive JSON message.
2025-05-15 15:22:25 +08:00
Yeuoly d80630acd5 feat: implement OAuth functionality (#245)
* feat: implement OAuth functionality in plugin daemon

- Added OAuth service methods for getting authorization URLs and credentials.
- Updated access types to include OAuth-related actions.
- Created new controller for handling OAuth requests.
- Introduced entities for OAuth results and requests.
- Enhanced plugin entities to support OAuth schema in tool declarations.

* feat: add OAuth endpoints for authorization and credentials retrieval

- Introduced new POST endpoints for obtaining authorization URLs and credentials in the OAuth controller.
- Enhanced the plugin dispatch group to include these new OAuth routes, improving integration with OAuth services.
2025-04-27 13:59:57 +08:00
Yeuoly 00730b67c3 refactor: replace baseSSEService with baseSSEWithSession in multiple service files (#244)
- Introduced baseSSEWithSession to streamline session management across various service functions.
- Updated InvokeAgentStrategy, InvokeLLM, InvokeTextEmbedding, InvokeRerank, InvokeTTS, InvokeSpeech2Text, InvokeModeration, ValidateProviderCredentials, ValidateModelCredentials, GetTTSModelVoices, GetTextEmbeddingNumTokens, GetAIModelSchema, and GetLLMNumTokens to utilize the new session handling approach, improving code readability and maintainability.
2025-04-25 18:34:46 +08:00
非法操作 25e013618a fix self.session.delete alway success (#12)
* fix self.session.delete alway success

* fix save data always failed

* redis delete response deleted item num

* add deleted num to invocate response
2025-04-11 13:32:52 +08:00
Yeuoly 36e7a10169 fix: cobr unmarshal map[string]any to map[any]any, feat: add tests for redirecting traffic with path style and refactor redirect request logic 2025-04-08 13:51:26 +09:00
Yeuoly eed91f2359 feat: add X-Original-Host header handling in endpoint requests and improve request redirection URL construction 2025-04-07 13:28:53 +09:00
Yeuoly 398762558e Merge pull request #128 from zxfishhack/cache-endpoint-and-plugin-install
add cache for endpoint by hook_id and pluginInstallation by plugin_id&tenant_id
2025-04-07 12:22:47 +09:00
kurokobo 6f75bcca43 feat: verify plugin with public keys specified in environment variable in addition to official one 2025-04-02 13:48:04 +00:00
zxfishhack 4aa61bc9bc remove debug log 2025-03-31 09:46:42 +08:00
zxfishhack 3aa0490294 use AutoTypeWithGetter 2025-03-24 16:56:40 +08:00
zxfishhack 1e5e03eaf0 add cache for endpoint by hook_id and plugin by plugin_id&tenant_id 2025-03-20 17:20:07 +08:00
Yeuoly 24315ec568 refactor: Extract request copying logic into separate function with test 2025-03-12 13:35:14 +08:00
Yeuoly 8ab1e2a91e feat: Add max execution time parameter to endpoint handling (#88)
Modify endpoint-related functions to support configurable maximum execution time:
- Update EndpointHandler signature to include maxExecutionTime
- Pass max execution timeout from config to endpoint service
- Modify timeout mechanism to use configurable duration instead of hardcoded 240 seconds
2025-03-10 18:23:13 +08:00
Yeuoly cfd93cd048 feat: improve plugin upgrade with declaration retrieval 2025-02-25 22:01:56 +08:00
Yeuoly b19140ca23 refactor: optimize plugin declaration caching and encoding (#34) 2025-02-25 20:52:51 +08:00
Yeuoly b1674d960f feat: support Dify-Hook-Url 2025-02-12 19:19:03 +08:00
Yeuoly 87463a23c7 refactor: using lowercase to hook id 2025-02-11 22:02:21 +08:00
Yeuoly 6a54d44142 refactor: rename aws_lambda to serverless 2025-02-10 15:04:24 +08:00
Yeuoly 01f9886192 fix: add current identifier to check dependencies 2025-02-08 16:04:19 +08:00
Yeuoly 975f9d5c31 fix: move packager to pkg 2025-02-06 18:16:49 +08:00
非法操作 0f19a092ef fix disable endpoint not work (#17)
* fix disable endpoint not work

* fix disable endpoint

* refactor the disable endpoint

* fix comment
2025-01-26 22:43:59 +08:00
Yeuoly 6444214942 Revert "Revert: refactor: serverless connector This reverts commit b413e6c96546cc50b1dbc94731d24f5c51e7a455."
This reverts commit d08d78e8b2.
2025-01-14 16:31:13 +08:00
Yeuoly ecb0664059 fix: https://github.com/langgenius/dify-plugin-sdks/issues/12 2025-01-13 20:33:11 +08:00
Yeuoly d08d78e8b2 Revert: refactor: serverless connector This reverts commit b413e6c965. 2025-01-09 14:24:10 +08:00
Yeuoly b413e6c965 refactor: serverless connector 2025-01-08 16:57:21 +08:00
Yeuoly c26f5f9359 fix: use double pointer to implement setDefaultValue 2025-01-08 01:35:12 +08:00
Yeuoly 15060ee312 refactor: move entities to pkg 2025-01-06 14:52:02 +08:00
Yeuoly 8796edad8c refactor: confused code structure 2025-01-06 14:16:29 +08:00
Yeuoly f6aa10a9bc fix: multiple plugin installation 2024-12-31 19:04:58 +08:00
Yeuoly 0d51a59e9d fix: connection closed unexpectedly 2024-12-27 21:45:04 +08:00
Yeuoly cad33b0241 feat: support hook id to endpoint request 2024-12-19 23:07:07 +08:00
Yeuoly d784e1acfa fix: strict the pakcage size of uncompressed files 2024-12-16 17:12:57 +08:00
Yeuoly 53bd8018fd fix: remove sensitive informations from original endpoint request 2024-12-15 18:07:45 +08:00
Yeuoly f385089d7f fix: byte misalignment in endpoint service 2024-12-14 00:03:10 +08:00
Yeuoly 548adf4c0c refactor: rename agent to agent strategy 2024-12-12 18:26:55 +08:00
Yeuoly 1aecaf9a7c feat: support agent management 2024-12-09 22:25:41 +08:00
Yeuoly 7bb4705a48 feat: agent pluign 2024-12-09 22:01:01 +08:00
Yeuoly 407fb941ca feat: support for pprof 2024-12-04 14:15:16 +08:00
Yeuoly f9fc134982 fix: optimize error messages 2024-12-03 14:05:58 +08:00
Yeuoly 40ceab504e feat: disable author name to be a uuid 2024-12-02 21:35:40 +08:00
Yeuoly ae970a6c91 fix: install tasks 2024-12-02 14:39:24 +08:00
Yeuoly 45e8a3ee7c fix: missing returns 2024-11-29 16:52:56 +08:00
Yeuoly 9f8a0dccae fix: add delay for delete plugin tasks when success 2024-11-29 16:50:59 +08:00