feat(platform): expose amap server readiness

This commit is contained in:
lingniu
2026-07-04 17:53:03 +08:00
parent aa384732ef
commit eb8f15ca18
10 changed files with 39 additions and 8 deletions

View File

@@ -62,6 +62,7 @@ func TestWithRequestTimeoutReturnsEnvelopeWithTraceID(t *testing.T) {
func TestAppConfigScriptIsRuntimeRendered(t *testing.T) {
handler := withAppConfig(http.NotFoundHandler(), config.Config{
AMapWebJSKey: "web-key",
AMapAPIKey: "server-api-key",
AMapSecurityCode: "security-code",
AMapServiceHost: "/_AMapService",
})
@@ -82,8 +83,8 @@ func TestAppConfigScriptIsRuntimeRendered(t *testing.T) {
t.Fatalf("app config script missing %q: %s", want, body)
}
}
if strings.Contains(body, "security-code") || strings.Contains(body, "amapSecurityJsCode") {
t.Fatalf("app config script should not expose AMap security code: %s", body)
if strings.Contains(body, "security-code") || strings.Contains(body, "server-api-key") || strings.Contains(body, "amapSecurityJsCode") || strings.Contains(body, "amapApiKey") {
t.Fatalf("app config script should not expose server-side AMap secrets: %s", body)
}
}