feat(gateway): 补齐桌面端高级媒体直连接口
ci / verify (pull_request) Successful in 15m34s
ci / verify (pull_request) Successful in 15m34s
新增图片矢量化、视频超分、每日用量、计价与任务隔离能力,并通过环境变量解析平台凭据。 已通过 Go 全量门禁、迁移检查、镜像构建以及 Vectorizer 五格式和 Topaz 3 秒视频真实 DEV 验收。
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGatewayTaskJSONOmitsPrivateRemoteTaskPayload(t *testing.T) {
|
||||
raw, err := json.Marshal(GatewayTask{
|
||||
ID: "task-private-state",
|
||||
RemoteTaskID: "safe-upstream-id",
|
||||
RemoteTaskPayload: map[string]any{"imageToken": "private-image-token", "receipt": "private-receipt"},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
serialized := strings.ToLower(string(raw))
|
||||
if strings.Contains(serialized, "private-image-token") || strings.Contains(serialized, "private-receipt") || strings.Contains(serialized, "remotetaskpayload") {
|
||||
t.Fatalf("private provider recovery state leaked into task JSON: %s", serialized)
|
||||
}
|
||||
if !strings.Contains(serialized, "safe-upstream-id") {
|
||||
t.Fatalf("public upstream task id should remain available: %s", serialized)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user