From e04348041812459e21d66d5497470c49c2e5b236 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Mon, 20 Apr 2026 12:31:16 +0800 Subject: [PATCH] fix(ci): update rpc contract validation and remove internal service token --- internal/acp/provider_catalog.go | 11 ++++------- scripts/github-actions/verify-public-rpc-contract.sh | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/acp/provider_catalog.go b/internal/acp/provider_catalog.go index 38d4ef7..0819c83 100644 --- a/internal/acp/provider_catalog.go +++ b/internal/acp/provider_catalog.go @@ -32,7 +32,7 @@ type BridgeConfig struct { func loadBridgeConfig() *BridgeConfig { config := &BridgeConfig{} - configPath := shared.EnvOrDefault("BRIDGE_CONFIG_PATH", "config.yaml") + configPath := shared.EnvOrDefault("BRIDGE_CONFIG_PATH", "/app/config.yaml") if _, err := os.Stat(configPath); err == nil { data, err := os.ReadFile(configPath) @@ -43,7 +43,7 @@ func loadBridgeConfig() *BridgeConfig { return config } -func resolveURL(yamlVal string, envKeys ...string) string { +func resolveURL(yamlVal string, defaultVal string, envKeys ...string) string { val := strings.TrimSpace(yamlVal) if val != "" { return val @@ -53,7 +53,7 @@ func resolveURL(yamlVal string, envKeys ...string) string { return v } } - return "" + return defaultVal } func bridgeUpstreamAuthorizationHeader() string { @@ -105,10 +105,7 @@ func newProductionProviderCatalog() (map[string]syncedProvider, []string) { var order []string for _, p := range providers { - endpoint := resolveURL(p.yaml, p.envKeys...) - if endpoint == "" { - endpoint = p.defaultURL - } + endpoint := resolveURL(p.yaml, p.defaultURL, p.envKeys...) catalog[p.id] = syncedProvider{ ProviderID: p.id, Label: p.label, diff --git a/scripts/github-actions/verify-public-rpc-contract.sh b/scripts/github-actions/verify-public-rpc-contract.sh index ee6d9ca..7bf26b8 100755 --- a/scripts/github-actions/verify-public-rpc-contract.sh +++ b/scripts/github-actions/verify-public-rpc-contract.sh @@ -2,12 +2,12 @@ set -euo pipefail BASE_URL="${BRIDGE_SERVER_URL:-https://xworkmate-bridge.svc.plus}" -AUTH_TOKEN="${BRIDGE_AUTH_TOKEN:-${INTERNAL_SERVICE_TOKEN:-}}" +AUTH_TOKEN="${BRIDGE_AUTH_TOKEN:-}" HTTP_TIMEOUT_SECONDS="${HTTP_TIMEOUT_SECONDS:-30}" RPC_TIMEOUT_SECONDS="${RPC_TIMEOUT_SECONDS:-90}" if [[ -z "${AUTH_TOKEN}" ]]; then - echo "BRIDGE_AUTH_TOKEN or INTERNAL_SERVICE_TOKEN is required" >&2 + echo "BRIDGE_AUTH_TOKEN is required" >&2 exit 1 fi