diff --git a/cmd/fleetctl/apply_test.go b/cmd/fleetctl/apply_test.go index 33c006f2ff..c1fd52e72c 100644 --- a/cmd/fleetctl/apply_test.go +++ b/cmd/fleetctl/apply_test.go @@ -1237,9 +1237,6 @@ func TestApplyMacosSetup(t *testing.T) { invalidWebURLMacosSetup := writeTmpJSON(t, map[string]any{ "configuration_web_url": "https://example.com", }) - invalidAwaitDeviceMacosSetup := writeTmpJSON(t, map[string]any{ - "await_device_configured": true, - }) invalidURLMacosSetup := writeTmpJSON(t, map[string]any{ "url": "https://example.com", }) @@ -1553,12 +1550,6 @@ spec: require.ErrorContains(t, err, "The automatic enrollment profile can’t include configuration_web_url.") assert.False(t, ds.SetOrUpdateMDMAppleSetupAssistantFuncInvoked) - // apply appconfig with invalid key #2 - name = writeTmpYml(t, fmt.Sprintf(appConfigSpec, "", invalidAwaitDeviceMacosSetup)) - _, err = runAppNoChecks([]string{"apply", "-f", name}) - require.ErrorContains(t, err, "The automatic enrollment profile can’t include await_device_configured.") - assert.False(t, ds.SetOrUpdateMDMAppleSetupAssistantFuncInvoked) - // apply appconfig with invalid key #3 name = writeTmpYml(t, fmt.Sprintf(appConfigSpec, "", invalidURLMacosSetup)) _, err = runAppNoChecks([]string{"apply", "-f", name}) @@ -1572,12 +1563,6 @@ spec: require.ErrorContains(t, err, "The automatic enrollment profile can’t include configuration_web_url.") assert.False(t, ds.SetOrUpdateMDMAppleSetupAssistantFuncInvoked) - // apply teams with invalid key #2 - name = writeTmpYml(t, fmt.Sprintf(team1And2Spec, "", invalidAwaitDeviceMacosSetup, "", invalidAwaitDeviceMacosSetup)) - _, err = runAppNoChecks([]string{"apply", "-f", name}) - require.ErrorContains(t, err, "The automatic enrollment profile can’t include await_device_configured.") - assert.False(t, ds.SetOrUpdateMDMAppleSetupAssistantFuncInvoked) - // apply teams with invalid key #3 name = writeTmpYml(t, fmt.Sprintf(team1And2Spec, "", invalidURLMacosSetup, "", invalidURLMacosSetup)) _, err = runAppNoChecks([]string{"apply", "-f", name}) diff --git a/ee/server/service/mdm.go b/ee/server/service/mdm.go index e65118031e..f3c96ec880 100644 --- a/ee/server/service/mdm.go +++ b/ee/server/service/mdm.go @@ -460,9 +460,8 @@ func (svc *Service) SetOrUpdateMDMAppleSetupAssistant(ctx context.Context, asst } deniedFields := map[string]string{ - "configuration_web_url": `Couldn’t edit macos_setup_assistant. The automatic enrollment profile can’t include configuration_web_url. To require end user authentication, use the macos_setup.end_user_authentication option.`, - "await_device_configured": `Couldn’t edit macos_setup_assistant. The automatic enrollment profile can’t include await_device_configured.`, - "url": `Couldn’t edit macos_setup_assistant. The automatic enrollment profile can’t include url.`, + "configuration_web_url": `Couldn’t edit macos_setup_assistant. The automatic enrollment profile can’t include configuration_web_url. To require end user authentication, use the macos_setup.end_user_authentication option.`, + "url": `Couldn’t edit macos_setup_assistant. The automatic enrollment profile can’t include url.`, } for k, msg := range deniedFields { if _, ok := m[k]; ok { diff --git a/server/service/integration_mdm_test.go b/server/service/integration_mdm_test.go index b7ea5b299b..25bf4204db 100644 --- a/server/service/integration_mdm_test.go +++ b/server/service/integration_mdm_test.go @@ -3687,18 +3687,6 @@ func (s *integrationMDMTestSuite) TestMacosSetupAssistant() { s.lastActivityMatches(fleet.ActivityTypeChangedMacosSetupAssistant{}.ActivityName(), fmt.Sprintf(`{"name": "team2", "team_id": %d, "team_name": %q}`, tm.ID, tm.Name), latestChangedActID) - // try to set the await_device_configured - tmProf = `{"await_device_configured": true}` - res = s.Do("POST", "/api/latest/fleet/mdm/apple/enrollment_profile", createMDMAppleSetupAssistantRequest{ - TeamID: &tm.ID, - Name: "team4", - EnrollmentProfile: json.RawMessage(tmProf), - }, http.StatusUnprocessableEntity) - errMsg = extractServerErrorText(res.Body) - require.Contains(t, errMsg, `The automatic enrollment profile can’t include await_device_configured.`) - s.lastActivityMatches(fleet.ActivityTypeChangedMacosSetupAssistant{}.ActivityName(), - fmt.Sprintf(`{"name": "team2", "team_id": %d, "team_name": %q}`, tm.ID, tm.Name), latestChangedActID) - // try to set the url tmProf = `{"url": "https://example.com"}` res = s.Do("POST", "/api/latest/fleet/mdm/apple/enrollment_profile", createMDMAppleSetupAssistantRequest{