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.
Enables managing a local user on macOS.
Network users are not tested/unsupported at this time. Shared iPad probably isn't either.
When a new managed user is created, the existing managed users from the device are deleted. This is because there can only be one managed user per macOS device so the old users are deleted.
This change enables targeting a user id instead of a device by using the UserID field (the users GUID) in push notifications and MDM commands.
Closes#274Closes#247Closes#248Closes#208
For #248
Added a User DB similar to the Device DB.
The user specification be added with the API/mdmctl commands and then referenced with a blueprint.
If added to the blueprint, the user will be installed as an administrator during the AccountConfiguration step.
Wraps mdm.Responses into pubsub events and sends them downstream
This PR does not yet implement the full mdm.Response as an event, only the metadata.
The device db adds a subscription to mdm responses and updates the LastCheckin key.
Closes#251
Improves http debug logging by also logging the sent response.
Converts regular http logs to key-value format.
Changes the http server options to httputil.ListenAndServe, which is antended to be a standard
ListenAndServe method for all micromdm project.
Adds environment variables as configuration options for sensitive values.
Closes#196