Commit 1add4bf9 by skynono

feat: kling apiKey format to use `|` delimiter

parent 30193361
...@@ -69,8 +69,8 @@ func (a *TaskAdaptor) Init(info *relaycommon.TaskRelayInfo) { ...@@ -69,8 +69,8 @@ func (a *TaskAdaptor) Init(info *relaycommon.TaskRelayInfo) {
a.ChannelType = info.ChannelType a.ChannelType = info.ChannelType
a.baseURL = info.BaseUrl a.baseURL = info.BaseUrl
// apiKey format: "access_key,secret_key" // apiKey format: "access_key|secret_key"
keyParts := strings.Split(info.ApiKey, ",") keyParts := strings.Split(info.ApiKey, "|")
if len(keyParts) == 2 { if len(keyParts) == 2 {
a.accessKey = strings.TrimSpace(keyParts[0]) a.accessKey = strings.TrimSpace(keyParts[0])
a.secretKey = strings.TrimSpace(keyParts[1]) a.secretKey = strings.TrimSpace(keyParts[1])
...@@ -264,7 +264,7 @@ func (a *TaskAdaptor) createJWTToken() (string, error) { ...@@ -264,7 +264,7 @@ func (a *TaskAdaptor) createJWTToken() (string, error) {
} }
func (a *TaskAdaptor) createJWTTokenWithKey(apiKey string) (string, error) { func (a *TaskAdaptor) createJWTTokenWithKey(apiKey string) (string, error) {
parts := strings.Split(apiKey, ",") parts := strings.Split(apiKey, "|")
if len(parts) != 2 { if len(parts) != 2 {
return "", fmt.Errorf("invalid API key format, expected 'access_key,secret_key'") return "", fmt.Errorf("invalid API key format, expected 'access_key,secret_key'")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment