diff --git a/cmd/mdmctl/apply.go b/cmd/mdmctl/apply.go index d08bd43a..f3adb8e5 100644 --- a/cmd/mdmctl/apply.go +++ b/cmd/mdmctl/apply.go @@ -12,11 +12,12 @@ import ( "github.com/go-kit/kit/log" httptransport "github.com/go-kit/kit/transport/http" - "github.com/micromdm/micromdm/blueprint" - "github.com/micromdm/micromdm/core/apply" - "github.com/micromdm/micromdm/profile" "github.com/pkg/errors" uuid "github.com/satori/go.uuid" + + "github.com/micromdm/micromdm/platform/apiserver/apply" + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/profile" ) type applyCommand struct { diff --git a/cmd/mdmctl/apply_app.go b/cmd/mdmctl/apply_app.go index 8683de9d..b96d31a4 100644 --- a/cmd/mdmctl/apply_app.go +++ b/cmd/mdmctl/apply_app.go @@ -16,8 +16,9 @@ import ( "strings" "github.com/groob/plist" - "github.com/micromdm/micromdm/appmanifest" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/mdm/appmanifest" ) func (cmd *applyCommand) applyApp(args []string) error { diff --git a/cmd/mdmctl/apply_dep_profile.go b/cmd/mdmctl/apply_dep_profile.go index 34352a27..8091a937 100644 --- a/cmd/mdmctl/apply_dep_profile.go +++ b/cmd/mdmctl/apply_dep_profile.go @@ -11,8 +11,9 @@ import ( "os" "github.com/micromdm/dep" - "github.com/micromdm/micromdm/crypto" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/pkg/crypto" ) func certificatesFromURL(serverURL string, insecure bool) ([]*x509.Certificate, error) { diff --git a/cmd/mdmctl/apply_user.go b/cmd/mdmctl/apply_user.go index 4d100eba..ecd51abf 100644 --- a/cmd/mdmctl/apply_user.go +++ b/cmd/mdmctl/apply_user.go @@ -11,8 +11,8 @@ import ( "github.com/groob/plist" "github.com/pkg/errors" - "github.com/micromdm/micromdm/crypto/password" - "github.com/micromdm/micromdm/user" + "github.com/micromdm/micromdm/pkg/crypto/password" + "github.com/micromdm/micromdm/platform/user" ) func (cmd *applyCommand) applyUser(args []string) error { diff --git a/cmd/mdmctl/get.go b/cmd/mdmctl/get.go index 9be78020..3e853806 100644 --- a/cmd/mdmctl/get.go +++ b/cmd/mdmctl/get.go @@ -14,9 +14,10 @@ import ( "github.com/go-kit/kit/log" httptransport "github.com/go-kit/kit/transport/http" - "github.com/micromdm/micromdm/core/list" - "github.com/micromdm/micromdm/crypto" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/pkg/crypto" + "github.com/micromdm/micromdm/platform/apiserver/list" ) type getCommand struct { diff --git a/cmd/mdmctl/get_app.go b/cmd/mdmctl/get_app.go index 24d4eb9f..3ed066d0 100644 --- a/cmd/mdmctl/get_app.go +++ b/cmd/mdmctl/get_app.go @@ -8,7 +8,7 @@ import ( "os" "text/tabwriter" - "github.com/micromdm/micromdm/core/list" + "github.com/micromdm/micromdm/platform/apiserver/list" ) type appsTableOutput struct{ w *tabwriter.Writer } diff --git a/cmd/mdmctl/get_users.go b/cmd/mdmctl/get_users.go index a6c2fe00..092da03a 100644 --- a/cmd/mdmctl/get_users.go +++ b/cmd/mdmctl/get_users.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" - "github.com/micromdm/micromdm/core/list" + "github.com/micromdm/micromdm/platform/apiserver/list" ) type usersTableOutput struct{ w *tabwriter.Writer } diff --git a/cmd/mdmctl/mdmcert.go b/cmd/mdmctl/mdmcert.go index 096376b5..c1c49df9 100644 --- a/cmd/mdmctl/mdmcert.go +++ b/cmd/mdmctl/mdmcert.go @@ -17,9 +17,9 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/pkcs12" - "github.com/micromdm/micromdm/config" - "github.com/micromdm/micromdm/crypto" - "github.com/micromdm/micromdm/crypto/mdmcertutil" + "github.com/micromdm/micromdm/pkg/crypto" + "github.com/micromdm/micromdm/pkg/crypto/mdmcertutil" + "github.com/micromdm/micromdm/platform/config" ) type mdmcertCommand struct{} diff --git a/cmd/mdmctl/remove.go b/cmd/mdmctl/remove.go index 591cfa48..db73d31e 100644 --- a/cmd/mdmctl/remove.go +++ b/cmd/mdmctl/remove.go @@ -8,7 +8,8 @@ import ( "github.com/go-kit/kit/log" httptransport "github.com/go-kit/kit/transport/http" - "github.com/micromdm/micromdm/core/remove" + + "github.com/micromdm/micromdm/platform/apiserver/remove" ) type removeCommand struct { diff --git a/cmd/micromdm/serve.go b/cmd/micromdm/serve.go index 28cfd6b5..089c4547 100644 --- a/cmd/micromdm/serve.go +++ b/cmd/micromdm/serve.go @@ -19,48 +19,46 @@ import ( "strings" "time" - "github.com/fullsailor/pkcs7" - "github.com/groob/finalizer/logutil" - "github.com/micromdm/go4/env" - "github.com/micromdm/go4/version" - "golang.org/x/crypto/acme/autocert" - "golang.org/x/crypto/pkcs12" - "github.com/RobotsAndPencils/buford/push" "github.com/boltdb/bolt" + "github.com/fullsailor/pkcs7" "github.com/go-kit/kit/endpoint" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" httptransport "github.com/go-kit/kit/transport/http" "github.com/gorilla/mux" - "github.com/pkg/errors" - + "github.com/groob/finalizer/logutil" "github.com/micromdm/dep" + "github.com/micromdm/go4/env" "github.com/micromdm/go4/httputil" + "github.com/micromdm/go4/version" boltdepot "github.com/micromdm/scep/depot/bolt" scep "github.com/micromdm/scep/server" + "github.com/pkg/errors" + "golang.org/x/crypto/acme/autocert" + "golang.org/x/crypto/pkcs12" - "github.com/micromdm/micromdm/appstore" - "github.com/micromdm/micromdm/blueprint" - "github.com/micromdm/micromdm/command" - configsvc "github.com/micromdm/micromdm/config" - "github.com/micromdm/micromdm/core/apply" - "github.com/micromdm/micromdm/core/list" - "github.com/micromdm/micromdm/core/remove" - "github.com/micromdm/micromdm/crypto" "github.com/micromdm/micromdm/dep/depsync" "github.com/micromdm/micromdm/dep/deptoken" - "github.com/micromdm/micromdm/device" "github.com/micromdm/micromdm/mdm/checkin" "github.com/micromdm/micromdm/mdm/connect" "github.com/micromdm/micromdm/mdm/enroll" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/pubsub" - "github.com/micromdm/micromdm/pubsub/inmem" - nanopush "github.com/micromdm/micromdm/push" - "github.com/micromdm/micromdm/queue" - "github.com/micromdm/micromdm/user" - "github.com/micromdm/micromdm/webhook" + "github.com/micromdm/micromdm/pkg/crypto" + "github.com/micromdm/micromdm/platform/apiserver/apply" + "github.com/micromdm/micromdm/platform/apiserver/list" + "github.com/micromdm/micromdm/platform/apiserver/remove" + "github.com/micromdm/micromdm/platform/apns" + "github.com/micromdm/micromdm/platform/appstore" + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/command" + "github.com/micromdm/micromdm/platform/config" + "github.com/micromdm/micromdm/platform/device" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/pubsub" + "github.com/micromdm/micromdm/platform/pubsub/inmem" + "github.com/micromdm/micromdm/platform/queue" + "github.com/micromdm/micromdm/platform/user" + "github.com/micromdm/micromdm/workflow/webhook" ) const homePage = ` @@ -126,7 +124,7 @@ func serve(args []string) error { if err := os.MkdirAll(*flConfigPath, 0755); err != nil { return errors.Wrapf(err, "creating config directory %s", *flConfigPath) } - sm := &config{ + sm := &server{ configPath: *flConfigPath, ServerPublicURL: strings.TrimRight(*flServerURL, "/"), APNSCertificatePath: *flAPNSCertPath, @@ -193,17 +191,17 @@ func serve(args []string) error { ctx := context.Background() httpLogger := log.With(logger, "transport", "http") - var configHandlers configsvc.HTTPHandlers + var configHandlers config.HTTPHandlers { - pushCertEndpoint := configsvc.MakeSavePushCertificateEndpoint(sm.configService) - configEndpoints := configsvc.Endpoints{ + pushCertEndpoint := config.MakeSavePushCertificateEndpoint(sm.configService) + configEndpoints := config.Endpoints{ SavePushCertificateEndpoint: pushCertEndpoint, } configOpts := []httptransport.ServerOption{ httptransport.ServerErrorLogger(httpLogger), httptransport.ServerErrorEncoder(checkin.EncodeError), } - configHandlers = configsvc.MakeHTTPHandlers(ctx, configEndpoints, configOpts...) + configHandlers = config.MakeHTTPHandlers(ctx, configEndpoints, configOpts...) } var checkinHandlers checkin.HTTPHandlers @@ -218,16 +216,16 @@ func serve(args []string) error { checkinHandlers = checkin.MakeHTTPHandlers(ctx, e, opts...) } - var pushHandlers nanopush.HTTPHandlers + var pushHandlers apns.HTTPHandlers { - e := nanopush.Endpoints{ - PushEndpoint: nanopush.MakePushEndpoint(sm.pushService), + e := apns.Endpoints{ + PushEndpoint: apns.MakePushEndpoint(sm.pushService), } opts := []httptransport.ServerOption{ httptransport.ServerErrorLogger(httpLogger), httptransport.ServerErrorEncoder(checkin.EncodeError), } - pushHandlers = nanopush.MakeHTTPHandlers(ctx, e, opts...) + pushHandlers = apns.MakeHTTPHandlers(ctx, e, opts...) } var commandHandlers command.HTTPHandlers @@ -473,7 +471,7 @@ func printExamples() { fmt.Println(exampleText) } -type config struct { +type server struct { configPath string depsim string pubclient pubsub.PublishSubscriber @@ -487,7 +485,7 @@ type config struct { tlsCertPath string scepDepot *boltdepot.Depot profileDB *profile.DB - configDB *configsvc.DB + configDB *config.DB CommandWebhookURL string // TODO: refactor enroll service and remove the need to reference @@ -496,13 +494,13 @@ type config struct { scepCACertPath string PushService *push.Service // bufford push - pushService nanopush.Service + pushService apns.Service checkinService checkin.Service connectService connect.ConnectService enrollService enroll.Service scepService scep.Service commandService command.Service - configService configsvc.Service + configService config.Service responseWebhook *webhook.CommandWebhook webhooksHTTPClient *http.Client @@ -510,21 +508,21 @@ type config struct { err error } -func (c *config) setupPubSub() { +func (c *server) setupPubSub() { if c.err != nil { return } c.pubclient = inmem.NewPubSub() } -func (c *config) setupCommandService() { +func (c *server) setupCommandService() { if c.err != nil { return } c.commandService, c.err = command.New(c.db, c.pubclient) } -func (c *config) setupWebhooks() { +func (c *server) setupWebhooks() { if c.err != nil { return } @@ -542,7 +540,7 @@ func (c *config) setupWebhooks() { c.responseWebhook = h } -func (c *config) startWebhooks() { +func (c *server) startWebhooks() { if c.err != nil { return } @@ -552,7 +550,7 @@ func (c *config) startWebhooks() { } } -func (c *config) setupCommandQueue(logger log.Logger) { +func (c *server) setupCommandQueue(logger log.Logger) { if c.err != nil { return } @@ -578,14 +576,14 @@ func (c *config) setupCommandQueue(logger log.Logger) { c.connectService = connectService } -func (c *config) setupCheckinService() { +func (c *server) setupCheckinService() { if c.err != nil { return } c.checkinService, c.err = checkin.New(c.db, c.pubclient) } -func (c *config) setupBolt() { +func (c *server) setupBolt() { if c.err != nil { return } @@ -598,7 +596,7 @@ func (c *config) setupBolt() { c.db = db } -func (c *config) loadPushCerts() { +func (c *server) loadPushCerts() { if c.APNSCertificatePath == "" && c.APNSPrivateKeyPass == "" && c.APNSPrivateKeyPath == "" { // this is optional, config could also be provided with mdmctl return @@ -660,26 +658,26 @@ type pushServiceCert struct { PrivateKey interface{} } -func (c *config) setupConfigStore() { +func (c *server) setupConfigStore() { if c.err != nil { return } - db, err := configsvc.NewDB(c.db, c.pubclient) + db, err := config.NewDB(c.db, c.pubclient) if err != nil { c.err = err return } c.configDB = db - c.configService = configsvc.NewService(db) + c.configService = config.NewService(db) } -func (c *config) setupPushService(logger log.Logger) { +func (c *server) setupPushService(logger log.Logger) { if c.err != nil { return } - var opts []nanopush.Option + var opts []apns.Option { cert, _ := c.configDB.PushCertificate() if c.pushCert.Certificate != nil && cert == nil { @@ -698,28 +696,28 @@ func (c *config) setupPushService(logger log.Logger) { return } svc := push.NewService(client, push.Production) - opts = append(opts, nanopush.WithPushService(svc)) + opts = append(opts, apns.WithPushService(svc)) } after: - db, err := nanopush.NewDB(c.db, c.pubclient) + db, err := apns.NewDB(c.db, c.pubclient) if err != nil { c.err = err return } - service, err := nanopush.New(db, c.configDB, c.pubclient, opts...) + service, err := apns.New(db, c.configDB, c.pubclient, opts...) if err != nil { c.err = errors.Wrap(err, "starting micromdm push service") return } - c.pushService = nanopush.NewLoggingService( + c.pushService = apns.NewLoggingService( service, log.With(level.Info(logger), "component", "push"), ) } -func (c *config) setupEnrollmentService() { +func (c *server) setupEnrollmentService() { if c.err != nil { return } @@ -759,7 +757,7 @@ func (p staticTopicProvider) PushTopic() (string, error) { return p.topic, nil } -func (c *config) depClient() (dep.Client, error) { +func (c *server) depClient() (dep.Client, error) { if c.err != nil { return nil, c.err } @@ -808,7 +806,7 @@ func (c *config) depClient() (dep.Client, error) { return client, nil } -func (c *config) setupDEPSync() { +func (c *server) setupDEPSync() { if c.err != nil { return } @@ -828,7 +826,7 @@ func (c *config) setupDEPSync() { } } -func (c *config) setupSCEP(logger log.Logger) { +func (c *server) setupSCEP(logger log.Logger) { if c.err != nil { return } diff --git a/cmd/micromdm/serve_test.go b/cmd/micromdm/serve_test.go index 4f3f5d05..923996da 100644 --- a/cmd/micromdm/serve_test.go +++ b/cmd/micromdm/serve_test.go @@ -8,7 +8,7 @@ func TestLoadPushCerts(t *testing.T) { p12path := "testdata/pushcert.p12" keysecret := "secret" - cfg := &config{ + cfg := &server{ APNSPrivateKeyPath: keypath, APNSCertificatePath: certpath, APNSPrivateKeyPass: keysecret, diff --git a/dep/depsync/depsync.go b/dep/depsync/depsync.go index 41995624..0139ae71 100644 --- a/dep/depsync/depsync.go +++ b/dep/depsync/depsync.go @@ -14,7 +14,7 @@ import ( "github.com/pkg/errors" "github.com/micromdm/micromdm/dep/deptoken" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/dep/deptoken/deptopken.go b/dep/deptoken/deptopken.go index 8c0a885d..2d68be29 100644 --- a/dep/deptoken/deptopken.go +++ b/dep/deptoken/deptopken.go @@ -10,8 +10,9 @@ import ( "github.com/boltdb/bolt" "github.com/micromdm/dep" - "github.com/micromdm/micromdm/crypto" - "github.com/micromdm/micromdm/pubsub" + + "github.com/micromdm/micromdm/pkg/crypto" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/appmanifest/appmanifest.go b/mdm/appmanifest/appmanifest.go similarity index 100% rename from appmanifest/appmanifest.go rename to mdm/appmanifest/appmanifest.go diff --git a/appmanifest/appmanifest_test.go b/mdm/appmanifest/appmanifest_test.go similarity index 100% rename from appmanifest/appmanifest_test.go rename to mdm/appmanifest/appmanifest_test.go diff --git a/mdm/checkin/checkin.go b/mdm/checkin/checkin.go index 3e0e538e..f2c6d0f0 100644 --- a/mdm/checkin/checkin.go +++ b/mdm/checkin/checkin.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" "golang.org/x/net/context" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) // CheckinBucket is the *bolt.DB bucket where checkins are archived. diff --git a/mdm/connect/connect.go b/mdm/connect/connect.go index a2f151e4..a81a4588 100644 --- a/mdm/connect/connect.go +++ b/mdm/connect/connect.go @@ -6,8 +6,8 @@ import ( "github.com/micromdm/mdm" "github.com/pkg/errors" - "github.com/micromdm/micromdm/pubsub" - "github.com/micromdm/micromdm/queue" + "github.com/micromdm/micromdm/platform/pubsub" + "github.com/micromdm/micromdm/platform/queue" ) const ConnectTopic = "mdm.Connect" diff --git a/mdm/enroll/endpoint.go b/mdm/enroll/endpoint.go index 4a836038..348f9bee 100644 --- a/mdm/enroll/endpoint.go +++ b/mdm/enroll/endpoint.go @@ -5,13 +5,13 @@ import ( "errors" "fmt" - "github.com/micromdm/micromdm/crypto" - "github.com/micromdm/micromdm/profile" - boltdepot "github.com/micromdm/scep/depot/bolt" - "github.com/fullsailor/pkcs7" "github.com/go-kit/kit/endpoint" "github.com/micromdm/mdm" + boltdepot "github.com/micromdm/scep/depot/bolt" + + "github.com/micromdm/micromdm/pkg/crypto" + "github.com/micromdm/micromdm/platform/profile" ) type Endpoints struct { diff --git a/mdm/enroll/service.go b/mdm/enroll/service.go index 213d5211..1bac3f77 100644 --- a/mdm/enroll/service.go +++ b/mdm/enroll/service.go @@ -12,9 +12,9 @@ import ( "github.com/pkg/errors" "golang.org/x/net/context" - "github.com/micromdm/micromdm/config" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/config" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/mdm/enroll/transport_http.go b/mdm/enroll/transport_http.go index 2b9b3396..f5490b19 100644 --- a/mdm/enroll/transport_http.go +++ b/mdm/enroll/transport_http.go @@ -9,7 +9,8 @@ import ( "github.com/fullsailor/pkcs7" httptransport "github.com/go-kit/kit/transport/http" "github.com/groob/plist" - "github.com/micromdm/micromdm/crypto" + + "github.com/micromdm/micromdm/pkg/crypto" ) type HTTPHandlers struct { diff --git a/mock/checkin.go b/mock/checkin.go deleted file mode 100644 index c23205a5..00000000 --- a/mock/checkin.go +++ /dev/null @@ -1,44 +0,0 @@ -package mock - -import ( - "errors" - - "github.com/micromdm/mdm" - "golang.org/x/net/context" -) - -type Checkin struct { - AuthenticateInvoked bool - AuthenticateFunc CheckinFunc - - TokenUpdateInvoked bool - TokenUpdateFunc CheckinFunc - - CheckOutInvoked bool - CheckoutFunc CheckinFunc -} - -type CheckinFunc func(ctx context.Context, cmd mdm.CheckinCommand) error - -func (svc *Checkin) Authenticate(ctx context.Context, cmd mdm.CheckinCommand) error { - svc.AuthenticateInvoked = true - return svc.AuthenticateFunc(ctx, cmd) -} - -func (svc *Checkin) TokenUpdate(ctx context.Context, cmd mdm.CheckinCommand) error { - svc.TokenUpdateInvoked = true - return svc.TokenUpdateFunc(ctx, cmd) -} - -func (svc *Checkin) CheckOut(ctx context.Context, cmd mdm.CheckinCommand) error { - svc.CheckOutInvoked = true - return svc.CheckoutFunc(ctx, cmd) -} - -func FailCheckin(context.Context, mdm.CheckinCommand) error { - return errors.New("checkin failed") -} - -func SucceedCheckin(context.Context, mdm.CheckinCommand) error { - return nil -} diff --git a/mock/command.go b/mock/command.go deleted file mode 100644 index 930dd64a..00000000 --- a/mock/command.go +++ /dev/null @@ -1,38 +0,0 @@ -package mock - -import ( - "errors" - - "github.com/micromdm/mdm" - "golang.org/x/net/context" -) - -type Command struct { - NewCommandInvoked bool - NewCommandFunc NewCommandFunc -} - -type NewCommandFunc func(context.Context, *mdm.CommandRequest) (*mdm.Payload, error) - -func (svc *Command) NewCommand(ctx context.Context, request *mdm.CommandRequest) (*mdm.Payload, error) { - svc.NewCommandInvoked = true - return svc.NewCommandFunc(ctx, request) -} - -var MockPayload = &mdm.Payload{ - CommandUUID: "1234", -} - -func FailNewCommand(context.Context, *mdm.CommandRequest) (*mdm.Payload, error) { - return nil, errors.New("command creation failed") -} - -func ReturnMockPayload(context.Context, *mdm.CommandRequest) (*mdm.Payload, error) { - return MockPayload, nil -} - -func ReturnPayload(p *mdm.Payload) NewCommandFunc { - return func(context.Context, *mdm.CommandRequest) (*mdm.Payload, error) { - return p, nil - } -} diff --git a/crypto/apple.go b/pkg/crypto/apple.go similarity index 100% rename from crypto/apple.go rename to pkg/crypto/apple.go diff --git a/crypto/helpers.go b/pkg/crypto/helpers.go similarity index 100% rename from crypto/helpers.go rename to pkg/crypto/helpers.go diff --git a/crypto/mdmcertutil/certutil.go b/pkg/crypto/mdmcertutil/certutil.go similarity index 100% rename from crypto/mdmcertutil/certutil.go rename to pkg/crypto/mdmcertutil/certutil.go diff --git a/crypto/password/password.go b/pkg/crypto/password/password.go similarity index 100% rename from crypto/password/password.go rename to pkg/crypto/password/password.go diff --git a/core/apply/client.go b/platform/apiserver/apply/client.go similarity index 100% rename from core/apply/client.go rename to platform/apiserver/apply/client.go diff --git a/core/apply/endpoint.go b/platform/apiserver/apply/endpoint.go similarity index 97% rename from core/apply/endpoint.go rename to platform/apiserver/apply/endpoint.go index 374596b5..68218d04 100644 --- a/core/apply/endpoint.go +++ b/platform/apiserver/apply/endpoint.go @@ -6,9 +6,10 @@ import ( "github.com/go-kit/kit/endpoint" "github.com/micromdm/dep" - "github.com/micromdm/micromdm/blueprint" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/user" + + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/user" ) type Endpoints struct { diff --git a/core/apply/service.go b/platform/apiserver/apply/service.go similarity index 94% rename from core/apply/service.go rename to platform/apiserver/apply/service.go index 959ead36..54caa61d 100644 --- a/core/apply/service.go +++ b/platform/apiserver/apply/service.go @@ -13,15 +13,15 @@ import ( "net/textproto" "github.com/fullsailor/pkcs7" + "github.com/micromdm/dep" "github.com/pkg/errors" - "github.com/micromdm/dep" - "github.com/micromdm/micromdm/appstore" - "github.com/micromdm/micromdm/blueprint" "github.com/micromdm/micromdm/dep/deptoken" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/pubsub" - "github.com/micromdm/micromdm/user" + "github.com/micromdm/micromdm/platform/appstore" + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/pubsub" + "github.com/micromdm/micromdm/platform/user" ) type Service interface { diff --git a/core/apply/service_dep.go b/platform/apiserver/apply/service_dep.go similarity index 100% rename from core/apply/service_dep.go rename to platform/apiserver/apply/service_dep.go diff --git a/core/apply/transport_http.go b/platform/apiserver/apply/transport_http.go similarity index 100% rename from core/apply/transport_http.go rename to platform/apiserver/apply/transport_http.go diff --git a/core/apply/transport_http_test.go b/platform/apiserver/apply/transport_http_test.go similarity index 100% rename from core/apply/transport_http_test.go rename to platform/apiserver/apply/transport_http_test.go diff --git a/core/list/client.go b/platform/apiserver/list/client.go similarity index 100% rename from core/list/client.go rename to platform/apiserver/list/client.go diff --git a/core/list/endpoint.go b/platform/apiserver/list/endpoint.go similarity index 98% rename from core/list/endpoint.go rename to platform/apiserver/list/endpoint.go index 33c04850..12fb81e2 100644 --- a/core/list/endpoint.go +++ b/platform/apiserver/list/endpoint.go @@ -6,10 +6,10 @@ import ( "github.com/go-kit/kit/endpoint" "github.com/micromdm/dep" - "github.com/micromdm/micromdm/blueprint" "github.com/micromdm/micromdm/dep/deptoken" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/user" + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/user" ) type Endpoints struct { diff --git a/core/list/service.go b/platform/apiserver/list/service.go similarity index 93% rename from core/list/service.go rename to platform/apiserver/list/service.go index 88d725a1..9d36ad4e 100644 --- a/core/list/service.go +++ b/platform/apiserver/list/service.go @@ -10,13 +10,13 @@ import ( "github.com/micromdm/dep" "github.com/pkg/errors" - "github.com/micromdm/micromdm/appstore" - "github.com/micromdm/micromdm/blueprint" "github.com/micromdm/micromdm/dep/deptoken" - "github.com/micromdm/micromdm/device" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/pubsub" - "github.com/micromdm/micromdm/user" + "github.com/micromdm/micromdm/platform/appstore" + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/device" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/pubsub" + "github.com/micromdm/micromdm/platform/user" ) type ListDevicesOption struct { diff --git a/core/list/service_dep.go b/platform/apiserver/list/service_dep.go similarity index 100% rename from core/list/service_dep.go rename to platform/apiserver/list/service_dep.go diff --git a/core/list/transport_http.go b/platform/apiserver/list/transport_http.go similarity index 100% rename from core/list/transport_http.go rename to platform/apiserver/list/transport_http.go diff --git a/core/remove/client.go b/platform/apiserver/remove/client.go similarity index 100% rename from core/remove/client.go rename to platform/apiserver/remove/client.go diff --git a/core/remove/endpoint.go b/platform/apiserver/remove/endpoint.go similarity index 100% rename from core/remove/endpoint.go rename to platform/apiserver/remove/endpoint.go diff --git a/core/remove/service.go b/platform/apiserver/remove/service.go similarity index 89% rename from core/remove/service.go rename to platform/apiserver/remove/service.go index 19ccfd09..10294da1 100644 --- a/core/remove/service.go +++ b/platform/apiserver/remove/service.go @@ -2,8 +2,9 @@ package remove import ( "context" - "github.com/micromdm/micromdm/blueprint" - "github.com/micromdm/micromdm/profile" + + "github.com/micromdm/micromdm/platform/blueprint" + "github.com/micromdm/micromdm/platform/profile" ) type Service interface { diff --git a/core/remove/transport_http.go b/platform/apiserver/remove/transport_http.go similarity index 100% rename from core/remove/transport_http.go rename to platform/apiserver/remove/transport_http.go diff --git a/push/db.go b/platform/apns/db.go similarity index 97% rename from push/db.go rename to platform/apns/db.go index d1deaa75..0890431d 100644 --- a/push/db.go +++ b/platform/apns/db.go @@ -1,4 +1,4 @@ -package push +package apns import ( "context" @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" "github.com/micromdm/micromdm/mdm/checkin" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) const PushBucket = "mdm.PushInfo" diff --git a/push/endpoint.go b/platform/apns/endpoint.go similarity index 98% rename from push/endpoint.go rename to platform/apns/endpoint.go index bbb13171..3f6c9fb4 100644 --- a/push/endpoint.go +++ b/platform/apns/endpoint.go @@ -1,4 +1,4 @@ -package push +package apns import ( "context" diff --git a/push/internal/pushproto/push.go b/platform/apns/internal/pushproto/push.go similarity index 100% rename from push/internal/pushproto/push.go rename to platform/apns/internal/pushproto/push.go diff --git a/push/internal/pushproto/push.pb.go b/platform/apns/internal/pushproto/push.pb.go similarity index 100% rename from push/internal/pushproto/push.pb.go rename to platform/apns/internal/pushproto/push.pb.go diff --git a/push/internal/pushproto/push.proto b/platform/apns/internal/pushproto/push.proto similarity index 100% rename from push/internal/pushproto/push.proto rename to platform/apns/internal/pushproto/push.proto diff --git a/push/logging_service.go b/platform/apns/logging_service.go similarity index 97% rename from push/logging_service.go rename to platform/apns/logging_service.go index 4efb7cc9..9ce6b460 100644 --- a/push/logging_service.go +++ b/platform/apns/logging_service.go @@ -1,4 +1,4 @@ -package push +package apns import ( "context" diff --git a/push/push.go b/platform/apns/push.go similarity index 64% rename from push/push.go rename to platform/apns/push.go index 195b49da..e27afd97 100644 --- a/push/push.go +++ b/platform/apns/push.go @@ -1,6 +1,6 @@ -package push +package apns -import "golang.org/x/net/context" +import "context" type Service interface { Push(ctx context.Context, udid string) (string, error) diff --git a/push/push_info.go b/platform/apns/push_info.go similarity index 90% rename from push/push_info.go rename to platform/apns/push_info.go index 25b4b021..b1ea9133 100644 --- a/push/push_info.go +++ b/platform/apns/push_info.go @@ -1,10 +1,10 @@ -package push +package apns import ( "github.com/pkg/errors" "github.com/gogo/protobuf/proto" - "github.com/micromdm/micromdm/push/internal/pushproto" + "github.com/micromdm/micromdm/platform/apns/internal/pushproto" ) type PushInfo struct { diff --git a/push/service.go b/platform/apns/service.go similarity index 95% rename from push/service.go rename to platform/apns/service.go index 609fa29a..7f35daed 100644 --- a/push/service.go +++ b/platform/apns/service.go @@ -1,6 +1,7 @@ -package push +package apns import ( + "context" "crypto/tls" "encoding/json" "fmt" @@ -11,11 +12,10 @@ import ( "github.com/RobotsAndPencils/buford/payload" "github.com/RobotsAndPencils/buford/push" "github.com/pkg/errors" - "golang.org/x/net/context" - "github.com/micromdm/micromdm/config" - "github.com/micromdm/micromdm/pubsub" - "github.com/micromdm/micromdm/queue" + "github.com/micromdm/micromdm/platform/config" + "github.com/micromdm/micromdm/platform/pubsub" + "github.com/micromdm/micromdm/platform/queue" ) type Push struct { diff --git a/push/transport_http.go b/platform/apns/transport_http.go similarity index 99% rename from push/transport_http.go rename to platform/apns/transport_http.go index 6de6dd39..fafc5a7e 100644 --- a/push/transport_http.go +++ b/platform/apns/transport_http.go @@ -1,4 +1,4 @@ -package push +package apns import ( "context" diff --git a/appstore/appstore.go b/platform/appstore/appstore.go similarity index 97% rename from appstore/appstore.go rename to platform/appstore/appstore.go index b731b597..2c416373 100644 --- a/appstore/appstore.go +++ b/platform/appstore/appstore.go @@ -10,8 +10,9 @@ import ( "strings" "github.com/groob/plist" - "github.com/micromdm/micromdm/appmanifest" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/mdm/appmanifest" ) type AppStore interface { diff --git a/blueprint/blueprint.go b/platform/blueprint/blueprint.go similarity index 96% rename from blueprint/blueprint.go rename to platform/blueprint/blueprint.go index 69ffa5ce..c0088171 100644 --- a/blueprint/blueprint.go +++ b/platform/blueprint/blueprint.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/gogo/protobuf/proto" - "github.com/micromdm/micromdm/blueprint/internal/blueprintproto" + "github.com/micromdm/micromdm/platform/blueprint/internal/blueprintproto" ) // ApplyAt is a case-insensitive string that specifies at which point the diff --git a/blueprint/db.go b/platform/blueprint/db.go similarity index 98% rename from blueprint/db.go rename to platform/blueprint/db.go index 37461b87..b52b799b 100644 --- a/blueprint/db.go +++ b/platform/blueprint/db.go @@ -7,8 +7,8 @@ import ( "github.com/boltdb/bolt" "github.com/pkg/errors" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/user" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/user" ) const ( diff --git a/blueprint/internal/blueprintproto/blueprint.go b/platform/blueprint/internal/blueprintproto/blueprint.go similarity index 100% rename from blueprint/internal/blueprintproto/blueprint.go rename to platform/blueprint/internal/blueprintproto/blueprint.go diff --git a/blueprint/internal/blueprintproto/blueprint.pb.go b/platform/blueprint/internal/blueprintproto/blueprint.pb.go similarity index 100% rename from blueprint/internal/blueprintproto/blueprint.pb.go rename to platform/blueprint/internal/blueprintproto/blueprint.pb.go diff --git a/blueprint/internal/blueprintproto/blueprint.proto b/platform/blueprint/internal/blueprintproto/blueprint.proto similarity index 100% rename from blueprint/internal/blueprintproto/blueprint.proto rename to platform/blueprint/internal/blueprintproto/blueprint.proto diff --git a/blueprint/listener.go b/platform/blueprint/listener.go similarity index 95% rename from blueprint/listener.go rename to platform/blueprint/listener.go index 6e741d08..73d911a9 100644 --- a/blueprint/listener.go +++ b/platform/blueprint/listener.go @@ -4,14 +4,14 @@ import ( "context" "fmt" + "github.com/micromdm/mdm" "github.com/pkg/errors" - "github.com/micromdm/mdm" - "github.com/micromdm/micromdm/command" - "github.com/micromdm/micromdm/device" "github.com/micromdm/micromdm/mdm/checkin" - "github.com/micromdm/micromdm/profile" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/command" + "github.com/micromdm/micromdm/platform/device" + "github.com/micromdm/micromdm/platform/profile" + "github.com/micromdm/micromdm/platform/pubsub" ) func (db *DB) ApplyToDevice(ctx context.Context, svc command.Service, bp *Blueprint, udid string) error { diff --git a/command/command.go b/platform/command/command.go similarity index 97% rename from command/command.go rename to platform/command/command.go index 16be5e87..8308c920 100644 --- a/command/command.go +++ b/platform/command/command.go @@ -5,9 +5,10 @@ import ( "github.com/boltdb/bolt" "github.com/micromdm/mdm" - "github.com/micromdm/micromdm/pubsub" "github.com/pkg/errors" "golang.org/x/net/context" + + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/command/command_test.go b/platform/command/command_test.go similarity index 100% rename from command/command_test.go rename to platform/command/command_test.go diff --git a/command/endpoint.go b/platform/command/endpoint.go similarity index 100% rename from command/endpoint.go rename to platform/command/endpoint.go diff --git a/command/event.go b/platform/command/event.go similarity index 99% rename from command/event.go rename to platform/command/event.go index 22741cf0..0b9a09d3 100644 --- a/command/event.go +++ b/platform/command/event.go @@ -5,9 +5,10 @@ import ( "github.com/gogo/protobuf/proto" "github.com/micromdm/mdm" - "github.com/micromdm/micromdm/command/internal/commandproto" "github.com/pkg/errors" uuid "github.com/satori/go.uuid" + + "github.com/micromdm/micromdm/platform/command/internal/commandproto" ) type Event struct { diff --git a/command/event_test.go b/platform/command/event_test.go similarity index 97% rename from command/event_test.go rename to platform/command/event_test.go index 8ee21dd4..ce22eea4 100644 --- a/command/event_test.go +++ b/platform/command/event_test.go @@ -9,7 +9,7 @@ import ( "github.com/groob/plist" "github.com/micromdm/mdm" - "github.com/micromdm/micromdm/command" + "github.com/micromdm/micromdm/platform/command" ) var marshalTests = []string{ diff --git a/command/internal/commandproto/command.go b/platform/command/internal/commandproto/command.go similarity index 100% rename from command/internal/commandproto/command.go rename to platform/command/internal/commandproto/command.go diff --git a/command/internal/commandproto/command.pb.go b/platform/command/internal/commandproto/command.pb.go similarity index 100% rename from command/internal/commandproto/command.pb.go rename to platform/command/internal/commandproto/command.pb.go diff --git a/command/internal/commandproto/command.proto b/platform/command/internal/commandproto/command.proto similarity index 100% rename from command/internal/commandproto/command.proto rename to platform/command/internal/commandproto/command.proto diff --git a/command/service.go b/platform/command/service.go similarity index 100% rename from command/service.go rename to platform/command/service.go diff --git a/command/testdata/DeviceInformation.plist b/platform/command/testdata/DeviceInformation.plist similarity index 100% rename from command/testdata/DeviceInformation.plist rename to platform/command/testdata/DeviceInformation.plist diff --git a/command/testdata/DeviceInformation_empty_queries.plist b/platform/command/testdata/DeviceInformation_empty_queries.plist similarity index 100% rename from command/testdata/DeviceInformation_empty_queries.plist rename to platform/command/testdata/DeviceInformation_empty_queries.plist diff --git a/command/testdata/InstallProfile.plist b/platform/command/testdata/InstallProfile.plist similarity index 100% rename from command/testdata/InstallProfile.plist rename to platform/command/testdata/InstallProfile.plist diff --git a/command/testdata/Settings_hostname_devicename.plist b/platform/command/testdata/Settings_hostname_devicename.plist similarity index 100% rename from command/testdata/Settings_hostname_devicename.plist rename to platform/command/testdata/Settings_hostname_devicename.plist diff --git a/command/transport_http.go b/platform/command/transport_http.go similarity index 100% rename from command/transport_http.go rename to platform/command/transport_http.go diff --git a/command/transport_http_test.go b/platform/command/transport_http_test.go similarity index 100% rename from command/transport_http_test.go rename to platform/command/transport_http_test.go diff --git a/config/client.go b/platform/config/client.go similarity index 100% rename from config/client.go rename to platform/config/client.go diff --git a/config/config.go b/platform/config/config.go similarity index 92% rename from config/config.go rename to platform/config/config.go index 5402ca45..3175b0e3 100644 --- a/config/config.go +++ b/platform/config/config.go @@ -2,8 +2,9 @@ package config import ( "github.com/gogo/protobuf/proto" - "github.com/micromdm/micromdm/config/internal/configproto" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/platform/config/internal/configproto" ) // ServerConfig holds the configuration of the MDM Server. diff --git a/config/db.go b/platform/config/db.go similarity index 97% rename from config/db.go rename to platform/config/db.go index 21d4501b..015a6e25 100644 --- a/config/db.go +++ b/platform/config/db.go @@ -9,9 +9,10 @@ import ( "fmt" "github.com/boltdb/bolt" - "github.com/micromdm/micromdm/crypto" - "github.com/micromdm/micromdm/pubsub" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/pkg/crypto" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/config/endpoints.go b/platform/config/endpoints.go similarity index 100% rename from config/endpoints.go rename to platform/config/endpoints.go diff --git a/config/internal/configproto/config.go b/platform/config/internal/configproto/config.go similarity index 100% rename from config/internal/configproto/config.go rename to platform/config/internal/configproto/config.go diff --git a/config/internal/configproto/config.pb.go b/platform/config/internal/configproto/config.pb.go similarity index 100% rename from config/internal/configproto/config.pb.go rename to platform/config/internal/configproto/config.pb.go diff --git a/config/internal/configproto/config.proto b/platform/config/internal/configproto/config.proto similarity index 100% rename from config/internal/configproto/config.proto rename to platform/config/internal/configproto/config.proto diff --git a/config/service.go b/platform/config/service.go similarity index 100% rename from config/service.go rename to platform/config/service.go diff --git a/config/transport_http.go b/platform/config/transport_http.go similarity index 100% rename from config/transport_http.go rename to platform/config/transport_http.go diff --git a/device/db.go b/platform/device/db.go similarity index 99% rename from device/db.go rename to platform/device/db.go index 4810f2b2..5f884020 100644 --- a/device/db.go +++ b/platform/device/db.go @@ -12,7 +12,7 @@ import ( "github.com/micromdm/micromdm/dep/depsync" "github.com/micromdm/micromdm/mdm/checkin" "github.com/micromdm/micromdm/mdm/connect" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/device/db_test.go b/platform/device/db_test.go similarity index 100% rename from device/db_test.go rename to platform/device/db_test.go diff --git a/device/device.go b/platform/device/device.go similarity index 98% rename from device/device.go rename to platform/device/device.go index 32686283..f333b915 100644 --- a/device/device.go +++ b/platform/device/device.go @@ -4,8 +4,9 @@ import ( "time" "github.com/gogo/protobuf/proto" - "github.com/micromdm/micromdm/device/internal/deviceproto" "github.com/pkg/errors" + + "github.com/micromdm/micromdm/platform/device/internal/deviceproto" ) type Device struct { diff --git a/device/internal/deviceproto/device.go b/platform/device/internal/deviceproto/device.go similarity index 100% rename from device/internal/deviceproto/device.go rename to platform/device/internal/deviceproto/device.go diff --git a/device/internal/deviceproto/device.pb.go b/platform/device/internal/deviceproto/device.pb.go similarity index 100% rename from device/internal/deviceproto/device.pb.go rename to platform/device/internal/deviceproto/device.pb.go diff --git a/device/internal/deviceproto/device.proto b/platform/device/internal/deviceproto/device.proto similarity index 100% rename from device/internal/deviceproto/device.proto rename to platform/device/internal/deviceproto/device.proto diff --git a/profile/db.go b/platform/profile/db.go similarity index 100% rename from profile/db.go rename to platform/profile/db.go diff --git a/profile/internal/profileproto/profile.go b/platform/profile/internal/profileproto/profile.go similarity index 100% rename from profile/internal/profileproto/profile.go rename to platform/profile/internal/profileproto/profile.go diff --git a/profile/internal/profileproto/profile.pb.go b/platform/profile/internal/profileproto/profile.pb.go similarity index 100% rename from profile/internal/profileproto/profile.pb.go rename to platform/profile/internal/profileproto/profile.pb.go diff --git a/profile/internal/profileproto/profile.proto b/platform/profile/internal/profileproto/profile.proto similarity index 100% rename from profile/internal/profileproto/profile.proto rename to platform/profile/internal/profileproto/profile.proto diff --git a/profile/profile.go b/platform/profile/profile.go similarity index 96% rename from profile/profile.go rename to platform/profile/profile.go index 0cd27d11..1ebd1883 100644 --- a/profile/profile.go +++ b/platform/profile/profile.go @@ -6,7 +6,8 @@ import ( "github.com/fullsailor/pkcs7" "github.com/gogo/protobuf/proto" "github.com/groob/plist" - "github.com/micromdm/micromdm/profile/internal/profileproto" + + "github.com/micromdm/micromdm/platform/profile/internal/profileproto" ) type Mobileconfig []byte diff --git a/pubsub/inmem/consumer.go b/platform/pubsub/inmem/consumer.go similarity index 92% rename from pubsub/inmem/consumer.go rename to platform/pubsub/inmem/consumer.go index f32a9603..2b42c47f 100644 --- a/pubsub/inmem/consumer.go +++ b/platform/pubsub/inmem/consumer.go @@ -3,7 +3,7 @@ package inmem import ( "context" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) func (p *Inmem) Subscribe(_ context.Context, name, topic string) (<-chan pubsub.Event, error) { diff --git a/pubsub/inmem/inmem_test.go b/platform/pubsub/inmem/inmem_test.go similarity index 100% rename from pubsub/inmem/inmem_test.go rename to platform/pubsub/inmem/inmem_test.go diff --git a/pubsub/inmem/publisher.go b/platform/pubsub/inmem/publisher.go similarity index 93% rename from pubsub/inmem/publisher.go rename to platform/pubsub/inmem/publisher.go index af38d180..eec96cd6 100644 --- a/pubsub/inmem/publisher.go +++ b/platform/pubsub/inmem/publisher.go @@ -4,7 +4,7 @@ import ( "context" "sync" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) func NewPubSub() *Inmem { diff --git a/pubsub/pubsub.go b/platform/pubsub/pubsub.go similarity index 100% rename from pubsub/pubsub.go rename to platform/pubsub/pubsub.go diff --git a/queue/command_queued.go b/platform/queue/command_queued.go similarity index 91% rename from queue/command_queued.go rename to platform/queue/command_queued.go index 908e89c9..33fb504e 100644 --- a/queue/command_queued.go +++ b/platform/queue/command_queued.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/gogo/protobuf/proto" - "github.com/micromdm/micromdm/queue/internal/commandqueuedproto" + "github.com/micromdm/micromdm/platform/queue/internal/commandqueuedproto" ) type QueueCommandQueued struct { diff --git a/queue/device_command.go b/platform/queue/device_command.go similarity index 98% rename from queue/device_command.go rename to platform/queue/device_command.go index 24e96c04..7cbefb10 100644 --- a/queue/device_command.go +++ b/platform/queue/device_command.go @@ -6,7 +6,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/pkg/errors" - "github.com/micromdm/micromdm/queue/internal/devicecommandproto" + "github.com/micromdm/micromdm/platform/queue/internal/devicecommandproto" ) type Command struct { @@ -30,7 +30,7 @@ type DeviceCommand struct { // These are going to scale great. We'll have to see. Completed []Command Failed []Command - NotNow []Command + NotNow []Command } func MarshalDeviceCommand(c *DeviceCommand) ([]byte, error) { diff --git a/queue/internal/commandqueuedproto/command_queued.pb.go b/platform/queue/internal/commandqueuedproto/command_queued.pb.go similarity index 100% rename from queue/internal/commandqueuedproto/command_queued.pb.go rename to platform/queue/internal/commandqueuedproto/command_queued.pb.go diff --git a/queue/internal/commandqueuedproto/command_queued.proto b/platform/queue/internal/commandqueuedproto/command_queued.proto similarity index 100% rename from queue/internal/commandqueuedproto/command_queued.proto rename to platform/queue/internal/commandqueuedproto/command_queued.proto diff --git a/queue/internal/devicecommandproto/device_command.go b/platform/queue/internal/devicecommandproto/device_command.go similarity index 100% rename from queue/internal/devicecommandproto/device_command.go rename to platform/queue/internal/devicecommandproto/device_command.go diff --git a/queue/internal/devicecommandproto/device_command.pb.go b/platform/queue/internal/devicecommandproto/device_command.pb.go similarity index 100% rename from queue/internal/devicecommandproto/device_command.pb.go rename to platform/queue/internal/devicecommandproto/device_command.pb.go diff --git a/queue/internal/devicecommandproto/device_command.proto b/platform/queue/internal/devicecommandproto/device_command.proto similarity index 100% rename from queue/internal/devicecommandproto/device_command.proto rename to platform/queue/internal/devicecommandproto/device_command.proto diff --git a/queue/queue.go b/platform/queue/queue.go similarity index 98% rename from queue/queue.go rename to platform/queue/queue.go index 6d5707e4..cd65757d 100644 --- a/queue/queue.go +++ b/platform/queue/queue.go @@ -10,8 +10,8 @@ import ( "github.com/pkg/errors" "github.com/micromdm/mdm" - "github.com/micromdm/micromdm/command" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/command" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/queue/queue_test.go b/platform/queue/queue_test.go similarity index 100% rename from queue/queue_test.go rename to platform/queue/queue_test.go diff --git a/user/db.go b/platform/user/db.go similarity index 99% rename from user/db.go rename to platform/user/db.go index 3c452303..906461c0 100644 --- a/user/db.go +++ b/platform/user/db.go @@ -11,7 +11,7 @@ import ( uuid "github.com/satori/go.uuid" "github.com/micromdm/micromdm/mdm/checkin" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" ) const ( diff --git a/user/internal/userproto/user.go b/platform/user/internal/userproto/user.go similarity index 100% rename from user/internal/userproto/user.go rename to platform/user/internal/userproto/user.go diff --git a/user/internal/userproto/user.pb.go b/platform/user/internal/userproto/user.pb.go similarity index 100% rename from user/internal/userproto/user.pb.go rename to platform/user/internal/userproto/user.pb.go diff --git a/user/internal/userproto/user.proto b/platform/user/internal/userproto/user.proto similarity index 100% rename from user/internal/userproto/user.proto rename to platform/user/internal/userproto/user.proto diff --git a/user/user.go b/platform/user/user.go similarity index 96% rename from user/user.go rename to platform/user/user.go index fba695e5..cfa7f8e4 100644 --- a/user/user.go +++ b/platform/user/user.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" uuid "github.com/satori/go.uuid" - "github.com/micromdm/micromdm/user/internal/userproto" + "github.com/micromdm/micromdm/platform/user/internal/userproto" ) type User struct { diff --git a/webhook/command.go b/workflow/webhook/command.go similarity index 96% rename from webhook/command.go rename to workflow/webhook/command.go index 8abc0fc6..849a4097 100644 --- a/webhook/command.go +++ b/workflow/webhook/command.go @@ -7,7 +7,7 @@ import ( "net/http" "github.com/micromdm/micromdm/mdm/connect" - "github.com/micromdm/micromdm/pubsub" + "github.com/micromdm/micromdm/platform/pubsub" "github.com/pkg/errors" )