From 799a9fd261f7064337609c447ffbf27b4050a8a8 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Thu, 8 Jan 2026 17:46:06 -0600 Subject: [PATCH] Fix expected server address param name for VPP proxy auth (#38062) For #32461 to sync server and proxy APIs. --- server/mdm/apple/apple_apps/api.go | 2 +- server/mdm/apple/apple_apps/api_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/mdm/apple/apple_apps/api.go b/server/mdm/apple/apple_apps/api.go index 8cbe23e181..20b9293ce6 100644 --- a/server/mdm/apple/apple_apps/api.go +++ b/server/mdm/apple/apple_apps/api.go @@ -275,7 +275,7 @@ func GetAuthenticator(ctx context.Context, ds DataStore, licenseKey string) Auth } body, err := json.Marshal(struct { - ServerURL string `json:"serverUrl"` + ServerURL string `json:"fleetServerUrl"` }{appConfig.ServerSettings.ServerURL}) if err != nil { return "", ctxerr.Wrap(ctx, err, "encoding authentication request for VPP metadata service") diff --git a/server/mdm/apple/apple_apps/api_test.go b/server/mdm/apple/apple_apps/api_test.go index 276d0ba88a..d6114392b7 100644 --- a/server/mdm/apple/apple_apps/api_test.go +++ b/server/mdm/apple/apple_apps/api_test.go @@ -274,7 +274,7 @@ func TestAuthentication(t *testing.T) { // Verify the URL is set body, err := io.ReadAll(r.Body) require.NoError(t, err) - require.JSONEq(t, `{"serverUrl": "https://fleet.example.com"}`, string(body)) + require.JSONEq(t, `{"fleetServerUrl": "https://fleet.example.com"}`, string(body)) w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(`{"fleetServerSecret": "new-token-from-auth"}`)) @@ -317,6 +317,7 @@ func TestAuthentication(t *testing.T) { // Set up a mock auth server authServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { require.Equal(t, "Bearer my-license-key", r.Header.Get("Authorization")) + w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(`{"fleetServerSecret": "fresh-token"}`)) }))