diff --git a/Gopkg.lock b/Gopkg.lock index ad64f8c9..6634c9a4 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -95,7 +95,7 @@ branch = "master" name = "github.com/micromdm/mdm" packages = ["."] - revision = "90769a42e9940a8cdc99c33840e6a4bbc192917d" + revision = "2e3f297ba6a2e801dec12771c92c301b8e15f76c" [[projects]] name = "github.com/micromdm/scep" @@ -139,9 +139,15 @@ packages = ["internal/gen","internal/triegen","internal/ucd","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable"] revision = "19e51611da83d6be54ddafce4a4af510cb3e9ea4" +[[projects]] + branch = "master" + name = "golang.org/x/tools" + packages = ["go/ast/astutil","imports"] + revision = "bc6db94186c03835daa5c1c679fba599dc1f3b79" + [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "5b77abba24cd41ee8041e87f39d656f92bbff87b25fc92f299a48400f6385d3f" + inputs-digest = "9502148927d630aed51089b18e46395f56995ed144a986d44a960379d1bff4b8" solver-name = "gps-cdcl" solver-version = 1 diff --git a/blueprint/listener.go b/blueprint/listener.go index 30cb34bf..4742f6c9 100644 --- a/blueprint/listener.go +++ b/blueprint/listener.go @@ -19,11 +19,13 @@ func (db *DB) ApplyToDevice(ctx context.Context, svc command.Service, bp *Bluepr var requests []*mdm.CommandRequest for _, appURL := range bp.ApplicationURLs { requests = append(requests, &mdm.CommandRequest{ - RequestType: "InstallApplication", - UDID: udid, - InstallApplication: mdm.InstallApplication{ - ManifestURL: appURL, - ManagementFlags: 1, + UDID: udid, + Command: mdm.Command{ + RequestType: "InstallApplication", + InstallApplication: mdm.InstallApplication{ + ManifestURL: appURL, + ManagementFlags: 1, + }, }, }) } @@ -40,10 +42,12 @@ func (db *DB) ApplyToDevice(ctx context.Context, svc command.Service, bp *Bluepr } requests = append(requests, &mdm.CommandRequest{ - RequestType: "InstallProfile", - UDID: udid, - InstallProfile: mdm.InstallProfile{ - Payload: foundProfile.Mobileconfig, + UDID: udid, + Command: mdm.Command{ + RequestType: "InstallProfile", + InstallProfile: mdm.InstallProfile{ + Payload: foundProfile.Mobileconfig, + }, }, }) } @@ -93,8 +97,8 @@ func (db *DB) StartListener(sub pubsub.Subscriber, cmdSvc command.Service) error if ev.Command.AwaitingConfiguration { _, err := cmdSvc.NewCommand(ctx, &mdm.CommandRequest{ - RequestType: "DeviceConfigured", - UDID: ev.Command.UDID, + Command: mdm.Command{RequestType: "DeviceConfigured"}, + UDID: ev.Command.UDID, }) if err != nil { fmt.Println(errors.Wrapf(err, "sending DeviceConfigured")) diff --git a/command/command_test.go b/command/command_test.go index c1669534..98586a43 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -31,9 +31,13 @@ func TestService_NewCommand(t *testing.T) { wantErr: false, publisher: passPublisher, request: &mdm.CommandRequest{ - RequestType: "DeviceInformation", - UDID: "foobarbaz", - Queries: []string{"foo", "bar", "baz"}, + UDID: "foobarbaz", + Command: mdm.Command{ + RequestType: "DeviceInformation", + DeviceInformation: mdm.DeviceInformation{ + Queries: []string{"foo", "bar", "baz"}, + }, + }, }, }, { @@ -41,7 +45,9 @@ func TestService_NewCommand(t *testing.T) { wantErr: true, publisher: failPublisher, request: &mdm.CommandRequest{ - RequestType: "DeviceInformation", + Command: mdm.Command{ + RequestType: "DeviceInformation", + }, }, }, { @@ -54,8 +60,10 @@ func TestService_NewCommand(t *testing.T) { wantErr: true, publisher: passPublisher, request: &mdm.CommandRequest{ - RequestType: "DevicePropaganda", - UDID: "foobarbaz", + UDID: "foobarbaz", + Command: mdm.Command{ + RequestType: "DevicePropaganda", + }, }, }, }