Added internal/frontend/account to implement account management code.
Added user registration templates and handlers.
Set up a sqlite and postgres database in package main.
The frontend server now runs a CSRF middleware on all paths except
/assets/. To enable CSRF the -csrf_key flag must be set. Instead of
enforcing the flag is set, I opted to log that CSRF is disabled. Not
running CSRF means I can test with curl.
In the future I might enforce that the flag must be set in release builds.
- Added the concept of a "trace id", a unique ID which gets associated
with every log/request by default. Will eventually use
opentelemetry/opentracing, or perhaps something better... Still very
alpha quality + lots of dependencies/API surface to bring in. For the
purpose of MicroMDM, a unique identifier per request is fine.
- Added HTTP logging middleware.
The main change here is initializing micromdm.io as the module. That
allows micromdm to decouple from GitHub in the long run. It also means
I'll have to set up Go vanity URLs and move or modify the website
directory.
Other changes:
- WIP logging package
- Package id with ulid
- Tools repo
Marshal Assets of InstallEnterpriseApplication embedded manifest
Update to support SHA256, Metadata, and other related fields. Update tests to use and test for new fields.
Match JSON field names to the plist field names. The manifest field names don't follow typical CamelCase key names like normal Plists. It looks more like JSON. To avoid confusion just make them match. This makes it simpler to follow along with Apple's documentation when composing commands in JSON for the MicroMDM API. Otherwise we have to use our Go struct field names which are specific to us and nobody should need to figure that out (or really have to translate between the two). Update the test case to match.
Closes#302
This package still needs a lot of work, but I feel like this is a good stopping point.
In a follow up, I plan on writing some tests, and refactoring some of the ways the sync.Watcher goroutines are managed.
The dep library was initially a self contained project, but doesn't have a community of users.
Keeping it in the main repo should reduce the maintenance burden and simplify dependency management for the project.