diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ee999a..9d60428c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [v1.5.0](https://github.com/micromdm/micromdm/compare/v1.4.0...master) (Unreleased) +* Fix DEP token update issue (#513, #510) * Refactor certificate verification and implement UDID-cert authentication (#358, #429) * Cleanup DEP library and integrate into main project (#504, #505) * Add API endpoint to retrieve APNS certificate (#503) diff --git a/cmd/micromdm/serve.go b/cmd/micromdm/serve.go index 6c0b90ef..c64f6ae5 100644 --- a/cmd/micromdm/serve.go +++ b/cmd/micromdm/serve.go @@ -243,6 +243,7 @@ func serve(args []string) error { command.RegisterHTTPHandlers(r, commandEndpoints, options...) depsvc := depapi.New(dc, sm.PubClient) + depsvc.Run() depEndpoints := depapi.MakeServerEndpoints(depsvc, basicAuthEndpointMiddleware) depapi.RegisterHTTPHandlers(r, depEndpoints, options...) diff --git a/dep/account.go b/dep/account.go index a59ab020..1f0f1cb8 100644 --- a/dep/account.go +++ b/dep/account.go @@ -4,20 +4,31 @@ import "github.com/pkg/errors" const accountBasePath = "account" +type LimitDict struct { + Default int `json:"default"` + Maximum int `json:"maximum"` +} + +type URL struct { + URI string `json:"uri"` + HTTPMethod []string `json:"http_method"` + Limit LimitDict `json:"limit"` +} + type Account struct { - ServerName string `json:"server_name"` - ServerUUID string `json:"server_uuid"` - AdminID string `json:"admin_id"` - FacilitatorID string `json:"facilitator_id,omitempty"` //deprecated - OrgName string `json:"org_name"` - OrgEmail string `json:"org_email"` - OrgPhone string `json:"org_phone"` - OrgAddress string `json:"org_address"` - OrgID string `json"org_id"` - OrgIDHash string `json"org_id_hash"` - URLs []string `json:"urls"` - OrgType string `json:"org_type"` - OrgVersion string `json:"org_version"` + ServerName string `json:"server_name"` + ServerUUID string `json:"server_uuid"` + AdminID string `json:"admin_id"` + FacilitatorID string `json:"facilitator_id,omitempty"` //deprecated + OrgName string `json:"org_name"` + OrgEmail string `json:"org_email"` + OrgPhone string `json:"org_phone"` + OrgAddress string `json:"org_address"` + OrgID string `json"org_id"` + OrgIDHash string `json"org_id_hash"` + URLs []URL `json:"urls"` + OrgType string `json:"org_type"` + OrgVersion string `json:"org_version"` } func (c *Client) Account() (*Account, error) { diff --git a/platform/dep/sync/depsync.go b/platform/dep/sync/depsync.go index 9f2362de..e35497e8 100644 --- a/platform/dep/sync/depsync.go +++ b/platform/dep/sync/depsync.go @@ -80,7 +80,6 @@ func NewWatcher(db WatcherDB, pub pubsub.PublishSubscriber, opts ...Option) (*Wa go func() { defer saveCursor() if w.client == nil { - panic("boom") // block until we have a DEP client to start sync process level.Info(w.logger).Log("msg", "waiting for DEP token to be added before starting sync") <-w.startSync