mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
automatically update the remote DEP profile when the server URL changes (#11423)
#11414
This commit is contained in:
parent
bd372346ed
commit
5029ed5daf
2 changed files with 12 additions and 1 deletions
|
|
@ -403,7 +403,10 @@ func (svc *Service) ModifyAppConfig(ctx context.Context, p []byte, applyOpts fle
|
|||
}
|
||||
}
|
||||
|
||||
if oldAppConfig.MDM.EndUserAuthentication.SSOProviderSettings != appConfig.MDM.EndUserAuthentication.SSOProviderSettings {
|
||||
mdmSSOSettingsChanged := oldAppConfig.MDM.EndUserAuthentication.SSOProviderSettings !=
|
||||
appConfig.MDM.EndUserAuthentication.SSOProviderSettings
|
||||
serverURLChanged := oldAppConfig.ServerSettings.ServerURL != appConfig.ServerSettings.ServerURL
|
||||
if (mdmSSOSettingsChanged || serverURLChanged) && license.Tier == "premium" {
|
||||
if err := svc.EnterpriseOverrides.MDMAppleSyncDEPPRofile(ctx); err != nil {
|
||||
return nil, ctxerr.Wrap(ctx, err, "sync DEP profile")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3791,4 +3791,12 @@ func (s *integrationMDMTestSuite) TestSSO() {
|
|||
}
|
||||
require.NoError(t, plist.Unmarshal(body, &profile))
|
||||
require.Equal(t, apple_mdm.FleetPayloadIdentifier, profile.PayloadIdentifier)
|
||||
|
||||
// changing the server URL also updates the remote DEP profile
|
||||
acResp = appConfigResponse{}
|
||||
s.DoJSON("PATCH", "/api/latest/fleet/config", json.RawMessage(`{
|
||||
"server_settings": {"server_url": "https://example.com"}
|
||||
}`), http.StatusOK, &acResp)
|
||||
require.Contains(t, lastSubmittedProfile.URL, "https://example.com/api/mdm/apple/enroll?token=")
|
||||
require.Equal(t, "https://example.com/mdm/sso", lastSubmittedProfile.ConfigurationWebURL)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue