mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-08 10:45:34 +08:00
DEP fixes (#513)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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...)
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user