From 9d63e96f87c0efae49b1637f69b430401c579236 Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Tue, 2 Apr 2024 16:29:41 -0400 Subject: [PATCH] Add skeleton function to handle macos updates settings changes --- ee/server/service/mdm.go | 9 +++++++++ ee/server/service/service.go | 1 + server/fleet/service.go | 1 + 3 files changed, 11 insertions(+) diff --git a/ee/server/service/mdm.go b/ee/server/service/mdm.go index 8f523a4d4a..0ef0da203b 100644 --- a/ee/server/service/mdm.go +++ b/ee/server/service/mdm.go @@ -1055,6 +1055,15 @@ func (svc *Service) GetMDMDiskEncryptionSummary(ctx context.Context, teamID *uin }, nil } +func (svc *Service) mdmAppleEditedMacOSUpdates(ctx context.Context, teamID *uint, updates fleet.MacOSUpdates) error { + if updates.MinimumVersion.Value == "" { + // TODO: OS updates disabled, remove the profile + return nil + } + // TODO: OS updates enabled and modified, create or update the profile + return nil +} + func (svc *Service) mdmWindowsEnableOSUpdates(ctx context.Context, teamID *uint, updates fleet.WindowsUpdates) error { var contents bytes.Buffer params := windowsOSUpdatesProfileOptions{ diff --git a/ee/server/service/service.go b/ee/server/service/service.go index 526aee13c4..0ba18577ae 100644 --- a/ee/server/service/service.go +++ b/ee/server/service/service.go @@ -76,6 +76,7 @@ func NewService( DeleteMDMAppleBootstrapPackage: eeservice.DeleteMDMAppleBootstrapPackage, MDMWindowsEnableOSUpdates: eeservice.mdmWindowsEnableOSUpdates, MDMWindowsDisableOSUpdates: eeservice.mdmWindowsDisableOSUpdates, + MDMAppleEditedMacOSUpdates: eeservice.mdmAppleEditedMacOSUpdates, }) return eeservice, nil diff --git a/server/fleet/service.go b/server/fleet/service.go index c38c9550c5..db3bde0ef0 100644 --- a/server/fleet/service.go +++ b/server/fleet/service.go @@ -34,6 +34,7 @@ type EnterpriseOverrides struct { DeleteMDMAppleBootstrapPackage func(ctx context.Context, teamID *uint) error MDMWindowsEnableOSUpdates func(ctx context.Context, teamID *uint, updates WindowsUpdates) error MDMWindowsDisableOSUpdates func(ctx context.Context, teamID *uint) error + MDMAppleEditedMacOSUpdates func(ctx context.Context, teamID *uint, updates MacOSUpdates) error } type OsqueryService interface {