The new remove devices command takes a UDID or list of UDIDs
as input and calls the devices delete endpoint. Since serial number
isn't strictly required by the spec it seemed to make more sense
to keep the remove working with only UDIDs. The get devices command
with a serial number filter can always be used to look up a UDID
from a serial number.
Move the code for polling topics and updating device records into an independent worker.
Cleans up the code and makes it possible to swap the db backend.
* search a serial out of all serials
* clean up usage
* roll back development code, cleanup
* pull changes to mdmctl and decode url params
* wire up List to accept opts with debugging
* implement forEach without filtering opt
* implement filtering for multiple inbound serials
* drop gorilla/schema in favor of json body
* address comments
* tighten up return
* remove device.Store ref and make use of httputil pkg
Moved all the endpoints into the profile package.
Defined a Store interface which includes all the used BoltDB methods.
Moved the BoltDB implementation into a subpackage.
re-did the folder structure for the API. The client still lives in the server
packages, but will be gradually moved into api/client to remove coupling and make the APIs clearer.
I noticed that all deptoken is is a store for DEP tokens, which fits nicely with
the rest of the storage/api packages in platform.
The next step will be to move the deptoken store into the config package, but it must be
done in a gradual way since people are already using it today.
Add more logic to the way code is organized.
/pkg -- library code not directly connected to micromdm
/mdm -- packages meant for the services devices interract with. The MDM protocol.
/dep -- DEP API and related packages.
/platform -- Core APIs the server provides. Commands API, Devices API, queue, pubsub etc.
/workflow -- Packages/API that build on top of platform. Today that's the webhook package.
Depending on what ends up here, the workflow folder might become its own repository.
Organize the packages essential to the MDM server into a mdm folder.
This includes the enroll, checkin and connect services. The packages in this folder make up the
APIs that a device will directly interact with.
Moved all the go files from the top level directory into the cmd/ package.
Updated Makefile so that all the commands still work.
The common pattern in Go programs, and one we adapted with the addition with the mdmdctl binary is that binaries live in cmd/binary-name/binary-name.go while libraries live in folders at the top level.