sync: 同步 v1.0.4 开源代码并脱敏

This commit is contained in:
MiFaZhan
2026-10-29 14:59:32 +08:00
parent 14f4bb64e1
commit 3e5a7453b8
74 changed files with 3297 additions and 248 deletions
@@ -140,7 +140,7 @@ func TestParseSharedOneLinkConfigBusinessURL(t *testing.T) {
t.Run("defaults to shared OneLink URL", func(t *testing.T) {
config, api, err := parseSharedOneLinkConfig(context.Background(), newConfig(
`{"token":{"provider":"yunze","baseUrl":"http://apiv3.example.com","path":"/route/open/sharedToken"}}`,
`{"token":{"provider":"yunze","baseUrl":"http://apiv3.example.com","path":"/openapi/v3/query/operator-token"}}`,
))
if err != nil {
t.Fatalf("parse config: %v", err)
@@ -156,7 +156,7 @@ func TestParseSharedOneLinkConfigBusinessURL(t *testing.T) {
t.Run("honours template api.baseUrl", func(t *testing.T) {
const custom = "https://custom.example/v5/"
config, api, err := parseSharedOneLinkConfig(context.Background(), newConfig(
`{"api":{"baseUrl":"`+custom+`"},"token":{"provider":"yunze","baseUrl":"http://apiv3.example.com","path":"/route/open/sharedToken"}}`,
`{"api":{"baseUrl":"`+custom+`"},"token":{"provider":"yunze","baseUrl":"http://apiv3.example.com","path":"/openapi/v3/query/operator-token"}}`,
))
if err != nil {
t.Fatalf("parse config: %v", err)
@@ -182,11 +182,11 @@ func TestYunzeTemplateRegistration(t *testing.T) {
Template: &entity.TSimChannelTemplate{
TempKey: sharedOneLinkYunzeTemplateKey,
TempModel: templateModelSharedToken,
TempConfig: `{"token":{"provider":"yunze","baseUrl":"http://apiv3.example.com","path":"/route/open/sharedToken"}}`,
TempConfig: `{"token":{"provider":"yunze","baseUrl":"http://apiv3.example.com","path":"/openapi/v3/query/operator-token"}}`,
},
Channel: &entity.TSimChannels{
ChanKey: "249",
AppKey: "TEST_APP_KEY_0001",
AppKey: "YZTKB3FT1SJR8652C4WP9VM",
ChanConfig: "{}",
},
}