Commit Graph

144 Commits

Author SHA1 Message Date
Yeuoly bace3bfb58 feat(oauth): implement refresh credentials functionality (#408)
* feat(oauth): implement refresh credentials functionality

- Added RefreshCredentials endpoint to handle OAuth credential refresh requests.
- Introduced RequestOAuthRefreshCredentials structure for request validation.
- Updated access types and actions to include refresh credentials.
- Enhanced server routing and controller logic to support the new functionality.
- Updated OAuth entities to include expiration handling for refreshed credentials.

* feat(oauth): add metadata field to OAuthGetCredentialsResult

---------

Co-authored-by: Harry <xh001x@hotmail.com>
2025-07-23 13:11:36 +08:00
Yeuoly 56fcd686e1 feat: add active request tracking to health check and dispatch routes (#384)
- Implemented middleware to track active requests and active dispatch requests using atomic counters.
- Updated health check response to include counts of active requests and active dispatch requests.
- Integrated the new middleware into the HTTP server and plugin dispatch group for improved monitoring.
2025-07-04 19:56:42 +08:00
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
Byron.wang 18e91bbb37 fix s3 client path style not used (#344)
* bump cloud-kit version to fix #343

* change env name USE_AWS_S3 to S3_USE_AWS

* update s3_use_aws default value to true

* update readme about the upgrade notice
2025-06-13 15:10:21 +08:00
Byron.wang debb3744c0 add USE_AWS_S3 args avoid ambiguity. (#340) 2025-06-11 14:32:53 +08:00
Byron.wang 1c9e28bc75 Feat: Replace the internal/oss module with dify-cloud-kit (#317)
* replace internal oss with dify-cloud-kit

* remove validate

* fix tests

* fix tests
2025-05-30 16:44:59 +08:00
Yeuoly b6906f7eb5 feat: Generate HTTP server routes from template (#306)
* feat: Generate HTTP server routes from template

- Added a new file `http_server.gen.go` to automatically generate HTTP server routes based on defined dispatchers.
- Refactored existing route definitions in `http_server.go` to utilize the generated routes, improving maintainability.
- Introduced a code generation function in `generator.go` to create the HTTP server file, enhancing the plugin development workflow.
- Updated the template for HTTP server generation to streamline route creation for various controllers.

* fix: Update OAuth paths in PluginDispatchers for consistency

- Changed the path for authorization URL from `/oauth/authorization_url` to `/oauth/get_authorization_url`.
- Updated the path for credentials from `/oauth/credentials` to `/oauth/get_credentials` to align with naming conventions.
2025-05-23 15:27:43 +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 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
bravomark 7492a3d8cd feat: Support Alibaba Cloud OSS (#261)
* feat: support aliyun OSS

* feat: support aliyun OSS
2025-05-07 16:46:18 +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
Hironori Yamamoto 2406e0a09f feat: implement gcs storage (#237)
Co-authored-by: Hironori Yamamoto <hironori-yamamoto@m3.com>
2025-04-25 13:29:08 +08:00
Yeuoly 0a556dfd54 Merge pull request #172 from te-chan/feat/azure-blob-storage
feat(storage): add azure blob storage support
2025-04-08 14:41:48 +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
zxfishhack 9996714f2d Merge branch 'main' into cache-endpoint-and-plugin-install 2025-04-07 10:15:23 +08:00
te-chan 2f84673539 feat: Add Azure blob storage connectivity 2025-04-03 21:17:47 +09:00
Yeuoly d43de8b7b2 Merge pull request #157 from lengyhua/main
feat: simplify the process in db migrate & fix comment error
2025-03-29 00:00:16 +09:00
lengyhua 28f582a6a9 feat: add oss supported types 2025-03-28 01:56:37 -04:00
zxfishhack 3c71ddd4af remove debug log 2025-03-24 17:11:51 +08:00
zxfishhack 3aa0490294 use AutoTypeWithGetter 2025-03-24 16:56:40 +08:00
akisaya 038f152769 make pathStyle param configurable when using s3 compatible storage 2025-03-22 16:59:15 +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 ef41d22df4 Merge pull request #97 from quicksandznzn/main
feat: oss support tencent cos
2025-03-20 15:56:48 +08:00
yuhang2.zhang 261886167b update: Add Support for Custom S3 Endpoints to Enhance Compatibility with S3-Compatible Services. 2025-03-18 17:20:47 +08:00
mr-chenguang lcgash 897dad4e28 fix unit test 2025-03-12 05:47:23 +00:00
quicksandzn d3db63ea68 feat: oss support tencent cos 2025-03-12 11:25:38 +08:00
mr-chenguang lcgash 0cd7591aea change log health api by env switch 2025-03-11 07:58:16 +00:00
mr-chenguang lcgash 7bb0b42c88 fix: skip log health api 2025-03-11 05:43:09 +00: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 b19140ca23 refactor: optimize plugin declaration caching and encoding (#34) 2025-02-25 20:52:51 +08:00
Yeuoly 6a54d44142 refactor: rename aws_lambda to serverless 2025-02-10 15:04:24 +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 e39b35d7d9 refactor: docker build 2025-01-06 14:38:44 +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 3bb694e958 fix: incorrect endpoint path 2024-12-17 21:54:58 +08:00
Yeuoly a00e6ad26f fix: remove healthcheck from healthcheck 2024-12-17 21:46:22 +08:00
Yeuoly 9ef9f16e6e feat: support for sentry 2024-12-17 20:51:14 +08:00
Yeuoly 1974c683dc fix: avoid buffered data occurd in redirectPluginInvokeByIdentifier 2024-12-14 01:15:30 +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 31fd5590ea fix: add mutex and threadcreate traces 2024-12-06 01:28:55 +08:00
Yeuoly 5df0c68632 fix: add more traces for pprof 2024-12-06 01:28:09 +08:00
Yeuoly 407fb941ca feat: support for pprof 2024-12-04 14:15:16 +08:00
Yeuoly 0ab0fc15fc feat: support fetch installed tools 2024-11-25 23:19:38 +08:00
Yeuoly d341ff9918 fix: incorrect route of delete all installing tasks 2024-11-25 17:11:08 +08:00
Yeuoly dd5325b681 feat: support delete all install tasks 2024-11-25 17:01:25 +08:00