From 4895b250e10864d9e75854e6b1cbcb9b60e0afe3 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Wed, 21 Oct 2026 14:01:14 +0200 Subject: [PATCH] fix(19.8-03): TestServeLifecycle gives serve an app key and http body limits - serve loads app.key at boot and requires http.body_limits; the fixture had neither, so serve returned before listening - a fixed test-only SUMMER_APP__KEY and a config/http.yaml; the test also checks the key never reaches the logs --- modules/surf/serve_lifecycle_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/surf/serve_lifecycle_test.go b/modules/surf/serve_lifecycle_test.go index 4ffa56f6..3bfa44bf 100644 --- a/modules/surf/serve_lifecycle_test.go +++ b/modules/surf/serve_lifecycle_test.go @@ -3,6 +3,7 @@ package surf import ( "bytes" "context" + "encoding/base64" "fmt" "net" "net/http" @@ -92,6 +93,7 @@ func TestServeLifecycle(t *testing.T) { files := map[string]string{ "app.yaml": "name: probe\n", "database.yaml": fmt.Sprintf("dsn: %q\n", dsn), + "http.yaml": "body_limits:\n default_bytes: 1048576\n upload_bytes: 1048576\n", "storage.yaml": fmt.Sprintf("uploads:\n bucket_url: %q\n", "file://"+t.TempDir()), } for name, body := range files { @@ -99,7 +101,9 @@ func TestServeLifecycle(t *testing.T) { t.Fatal(err) } } - cfg, err := compass.Open(compass.Options{Dir: dir, Env: "development", Environ: []string{"SUMMER_ENV=development"}}) + // serve loads app.key at boot (Encrypted columns); a fixed test-only key. + appKey := base64.StdEncoding.EncodeToString(bytes.Repeat([]byte("k"), 32)) + cfg, err := compass.Open(compass.Options{Dir: dir, Env: "development", Environ: []string{"SUMMER_ENV=development", "SUMMER_APP__KEY=" + appKey}}) if err != nil { t.Fatal(err) } @@ -192,6 +196,9 @@ func TestServeLifecycle(t *testing.T) { if strings.Contains(got, "secret-777") { t.Fatalf("the request path reached the logs:\n%s", got) } + if strings.Contains(got, appKey) { + t.Fatalf("the app key reached the logs:\n%s", got) + } if strings.Contains(got, "surf-pass") { t.Fatalf("the DSN password reached the logs:\n%s", got) }