Sync shared snapshot from e4c1826
Docker / Docker Build & Push (push) Successful in 4m6s

This commit is contained in:
Gabriel20xx committed 2026-09-16 19:53:47 +02:00
1 parent 6e70b7e8c1
commit c097383d3a
3 files changed
+43 -5

No files matched your search

+15 -2
View File
@@ -32,6 +32,19 @@ func TestStoreSetComfyUIURL(t *testing.T) {
}
}
func TestStoreSetCarrierNodeSecret(t *testing.T) {
store := NewStore(Info{})
store.Set(Info{CarrierNodeSecret: " carrier-secret "})
if got := store.CarrierNodeSecret(); got != "carrier-secret" {
t.Fatalf("CarrierNodeSecret = %q, want trimmed pushed secret", got)
}
store.Set(Info{})
if got := store.CarrierNodeSecret(); got != "carrier-secret" {
t.Fatalf("blank push cleared CarrierNodeSecret to %q", got)
}
}
func TestStoreOnUpdateFiresWithNewInfo(t *testing.T) {
store := NewStore(Info{})
var got Info
@@ -114,7 +127,7 @@ func equalStrings(got, want []string) bool {
func TestHandlerAppliesPushedInfo(t *testing.T) {
store := NewStore(Info{})
handler := Handler("s3cret", store)
body, _ := json.Marshal(Info{AuthGuardURL: "http://auth.example.com", CarrierNodeURL: "http://carrier.example.com"})
body, _ := json.Marshal(Info{AuthGuardURL: "http://auth.example.com", CarrierNodeURL: "http://carrier.example.com", CarrierNodeSecret: "carrier-secret"})
req := httptest.NewRequest(http.MethodPut, "/api/core-services/internal", bytes.NewReader(body))
req.Header.Set("X-Internal-Auth", "s3cret")
@@ -125,7 +138,7 @@ func TestHandlerAppliesPushedInfo(t *testing.T) {
t.Fatalf("status = %d, want 200: %s", rec.Code, rec.Body.String())
}
got := store.Get()
if got.AuthGuardURL != "http://auth.example.com" || got.CarrierNodeURL != "http://carrier.example.com" {
if got.AuthGuardURL != "http://auth.example.com" || got.CarrierNodeURL != "http://carrier.example.com" || got.CarrierNodeSecret != "carrier-secret" {
t.Fatalf("store = %+v, want pushed values applied", got)
}
}