Saving a blueprint was creating multiple records in the
blueprint index bucket. One was the index that gets used
for lookup which is a key of the blueprint Name and the value
being the blueprint UUID and the other record had a key and
value of blueprint UUID. The second with a key of UUID is not
needed since the key in the main blueprint bucket is already UUID
In order to set custom transport options on the http.Client used
by the push service we need to create our own instance. This
allows us to configure the IdleConnTimeout and prevent connections
from being killed and pushes not being sent. 90 seconds is used
here since it's the same as the DefaultTransport provided by Go.
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.
Previously the github.com/micromdm/mdm library was used, but the code there was a bit naive and had a few issues as it grew to support the full library of MDM Commands.
All the request types have been moved to `package mdm`.
* 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.