mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-23 18:25:36 -04:00
bace3bfb58
* 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>
50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
// Code generated by controller generator. DO NOT EDIT.
|
|
|
|
package plugin_daemon
|
|
|
|
import (
|
|
"github.com/langgenius/dify-plugin-daemon/internal/core/session_manager"
|
|
"github.com/langgenius/dify-plugin-daemon/internal/utils/stream"
|
|
"github.com/langgenius/dify-plugin-daemon/pkg/entities/oauth_entities"
|
|
"github.com/langgenius/dify-plugin-daemon/pkg/entities/requests"
|
|
)
|
|
|
|
func GetAuthorizationURL(
|
|
session *session_manager.Session,
|
|
request *requests.RequestOAuthGetAuthorizationURL,
|
|
) (
|
|
*stream.Stream[oauth_entities.OAuthGetAuthorizationURLResult], error,
|
|
) {
|
|
return GenericInvokePlugin[requests.RequestOAuthGetAuthorizationURL, oauth_entities.OAuthGetAuthorizationURLResult](
|
|
session,
|
|
request,
|
|
1,
|
|
)
|
|
}
|
|
|
|
func GetCredentials(
|
|
session *session_manager.Session,
|
|
request *requests.RequestOAuthGetCredentials,
|
|
) (
|
|
*stream.Stream[oauth_entities.OAuthGetCredentialsResult], error,
|
|
) {
|
|
return GenericInvokePlugin[requests.RequestOAuthGetCredentials, oauth_entities.OAuthGetCredentialsResult](
|
|
session,
|
|
request,
|
|
1,
|
|
)
|
|
}
|
|
|
|
func RefreshCredentials(
|
|
session *session_manager.Session,
|
|
request *requests.RequestOAuthRefreshCredentials,
|
|
) (
|
|
*stream.Stream[oauth_entities.OAuthRefreshCredentialsResult], error,
|
|
) {
|
|
return GenericInvokePlugin[requests.RequestOAuthRefreshCredentials, oauth_entities.OAuthRefreshCredentialsResult](
|
|
session,
|
|
request,
|
|
1,
|
|
)
|
|
}
|