mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-25 05:25:41 -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>
22 lines
1.0 KiB
Go
22 lines
1.0 KiB
Go
package requests
|
|
|
|
type RequestOAuthGetAuthorizationURL struct {
|
|
Provider string `json:"provider" validate:"required"`
|
|
RedirectURI string `json:"redirect_uri" validate:"required"`
|
|
SystemCredentials map[string]any `json:"system_credentials" validate:"omitempty"`
|
|
}
|
|
|
|
type RequestOAuthGetCredentials struct {
|
|
Provider string `json:"provider" validate:"required"`
|
|
RedirectURI string `json:"redirect_uri" validate:"required"`
|
|
SystemCredentials map[string]any `json:"system_credentials" validate:"omitempty"`
|
|
RawHttpRequest string `json:"raw_http_request" validate:"required"` // hex encoded raw http request from the oauth provider
|
|
}
|
|
|
|
type RequestOAuthRefreshCredentials struct {
|
|
Provider string `json:"provider" validate:"required"`
|
|
RedirectURI string `json:"redirect_uri" validate:"required"`
|
|
SystemCredentials map[string]any `json:"system_credentials" validate:"omitempty"`
|
|
Credentials map[string]any `json:"credentials" validate:"required"`
|
|
}
|