Fix expected server address param name for VPP proxy auth (#38062)
For #32461 to sync server and proxy APIs.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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"}`))
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user