Fix expected server address param name for VPP proxy auth (#38062)

For #32461 to sync server and proxy APIs.
This commit is contained in:
Ian Littman
2026-01-08 17:46:06 -06:00
committed by GitHub
parent 05d3420536
commit 799a9fd261
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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")
+2 -1
View File
@@ -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"}`))
}))