fix(ci): update rpc contract validation and remove internal service token

This commit is contained in:
Haitao Pan 2026-04-20 12:31:16 +08:00
parent 104ab26356
commit e043480418
2 changed files with 6 additions and 9 deletions

View File

@ -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,

View File

@ -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