mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Add mdm_enabled field to response of PATCH /config (#12498)
This commit is contained in:
parent
a8ee03b457
commit
8b95155ae2
1
changes/bug-add-mdm-feature-flag-in-modify-appconfig
Normal file
1
changes/bug-add-mdm-feature-flag-in-modify-appconfig
Normal file
@ -0,0 +1 @@
|
||||
* Added the `mdm_enabled` feature flag information to the response payload of the `PATCH /config` endpoint.
|
@ -196,7 +196,7 @@ type modifyAppConfigRequest struct {
|
||||
|
||||
func modifyAppConfigEndpoint(ctx context.Context, request interface{}, svc fleet.Service) (errorer, error) {
|
||||
req := request.(*modifyAppConfigRequest)
|
||||
config, err := svc.ModifyAppConfig(ctx, req.RawMessage, fleet.ApplySpecOptions{
|
||||
appConfig, err := svc.ModifyAppConfig(ctx, req.RawMessage, fleet.ApplySpecOptions{
|
||||
Force: req.Force,
|
||||
DryRun: req.DryRun,
|
||||
})
|
||||
@ -212,10 +212,11 @@ func modifyAppConfigEndpoint(ctx context.Context, request interface{}, svc fleet
|
||||
return nil, err
|
||||
}
|
||||
response := appConfigResponse{
|
||||
AppConfig: *config,
|
||||
AppConfig: *appConfig,
|
||||
appConfigResponseFields: appConfigResponseFields{
|
||||
License: license,
|
||||
Logging: loggingConfig,
|
||||
License: license,
|
||||
Logging: loggingConfig,
|
||||
MDMEnabled: config.IsMDMFeatureFlagEnabled(),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -4692,6 +4692,7 @@ func (s *integrationTestSuite) TestAppConfig() {
|
||||
}`), http.StatusOK, &acResp)
|
||||
assert.Equal(t, "test", acResp.OrgInfo.OrgName)
|
||||
assert.True(t, acResp.MDM.AppleBMTermsExpired)
|
||||
assert.False(t, acResp.MDMEnabled)
|
||||
|
||||
// the global agent options were not modified by the last call, so the
|
||||
// corresponding activity should not have been created.
|
||||
|
@ -5066,10 +5066,12 @@ func (s *integrationMDMTestSuite) TestAppConfigMicrosoftMDM() {
|
||||
}
|
||||
|
||||
// enable Microsoft MDM
|
||||
acResp = appConfigResponse{}
|
||||
s.DoJSON("PATCH", "/api/latest/fleet/config", json.RawMessage(`{
|
||||
"mdm": { "windows_enabled_and_configured": true }
|
||||
}`), http.StatusOK, &acResp)
|
||||
assert.True(t, acResp.MDM.MicrosoftEnabledAndConfigured)
|
||||
assert.True(t, acResp.MDMEnabled)
|
||||
|
||||
// get the orbit config for each host, verify that only the expected ones
|
||||
// receive the "needs enrollment to Microsoft MDM" notification.
|
||||
|
Loading…
Reference in New Issue
Block a user