Documentation ¶
Overview ¶
Package foss implements communication with with Free/Open Source MDM servers.
Index ¶
- Variables
- func WebhookHandler(recv MDMEventReceiver, logger log.Logger) http.HandlerFunc
- type AcknowledgeEvent
- type CheckinEvent
- type Doer
- type Event
- type FossMDM
- type MDMCheckinEventer
- type MDMCommandResponseEventer
- type MDMEventDumper
- func (d *MDMEventDumper) MDMCheckinEvent(ctx context.Context, id string, checkin interface{}, ...) error
- func (d *MDMEventDumper) MDMCommandResponseEvent(ctx context.Context, id string, uuid string, raw []byte, ...) error
- func (d *MDMEventDumper) MDMIdleEvent(ctx context.Context, id string, raw []byte, mdmContext *workflow.MDMContext, ...) error
- type MDMEventReceiver
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrNoIDsInIDChunk = errors.New("no ids in id chunk")
Functions ¶
func WebhookHandler ¶
func WebhookHandler(recv MDMEventReceiver, logger log.Logger) http.HandlerFunc
WebhookHandler parses the F/OSS MDM webhook callback for hand-off for futher processing.
Types ¶
type AcknowledgeEvent ¶
type CheckinEvent ¶
type CheckinEvent struct { UDID string `json:"udid,omitempty"` EnrollmentID string `json:"enrollment_id,omitempty"` Params map[string]string `json:"url_params"` RawPayload []byte `json:"raw_payload"` // signals which tokenupdate this is to be able to tell whether this // is the initial enrollment vs. a following tokenupdate TokenUpdateTally *int `json:"token_update_tally,omitempty"` }
type Event ¶
type Event struct { Topic string `json:"topic"` EventID string `json:"event_id"` CreatedAt time.Time `json:"created_at"` AcknowledgeEvent *AcknowledgeEvent `json:"acknowledge_event,omitempty"` CheckinEvent *CheckinEvent `json:"checkin_event,omitempty"` }
type FossMDM ¶
type FossMDM struct {
// contains filtered or unexported fields
}
FossMDM sends requests to Free/Open Source MDM servers for enqueueing MDM commands and sending APNs pushes. Ostensibly this means NanoMDM and MicroMDM servers, but any server that supports compatible API endpoints could work, too.
func NewFossMDM ¶
NewFossMDM creates a new FossMDM. The enqueue and push URL "base" is specified with enqRef. By default we target NanoMDM conventions.
func (*FossMDM) Enqueue ¶
Enqueue sends the HTTP request to enqueue rawCommand to ids on the MDM server.
func (*FossMDM) SupportsMultiCommands ¶
SupportsMultiCommands reports whether we support multi-targeted commands. These are commands that can be sent to multiple devices (i.e. using the same UUID).
type MDMCheckinEventer ¶
type MDMCommandResponseEventer ¶
type MDMCommandResponseEventer interface { MDMCommandResponseEvent(ctx context.Context, id string, uuid string, raw []byte, mdmContext *workflow.MDMContext) error // MDMIdleEvent is called when an MDM Report Results has an "Idle" status. MDMIdleEvent(ctx context.Context, id string, raw []byte, mdmContext *workflow.MDMContext, eventAt time.Time) error }
type MDMEventDumper ¶
type MDMEventDumper struct {
// contains filtered or unexported fields
}
MDMEventDumper is an MDM eventer middleware that dumps command responses to an output writer.
func NewMDMEventDumper ¶
func NewMDMEventDumper(next MDMEventReceiver, output io.Writer) *MDMEventDumper
func (*MDMEventDumper) MDMCheckinEvent ¶
func (d *MDMEventDumper) MDMCheckinEvent(ctx context.Context, id string, checkin interface{}, mdmContext *workflow.MDMContext) error
MDMCheckinEvent processes the next eventer.
func (*MDMEventDumper) MDMCommandResponseEvent ¶
func (d *MDMEventDumper) MDMCommandResponseEvent(ctx context.Context, id string, uuid string, raw []byte, mdmContext *workflow.MDMContext) error
MDMCommandResponseEvent dumps the raw command response and processes the next eventer.
func (*MDMEventDumper) MDMIdleEvent ¶ added in v0.3.0
func (d *MDMEventDumper) MDMIdleEvent(ctx context.Context, id string, raw []byte, mdmContext *workflow.MDMContext, eventAt time.Time) error
MDMIdleEvent is called when an MDM Report Results has an "Idle" status.
type MDMEventReceiver ¶
type MDMEventReceiver interface { MDMCommandResponseEventer MDMCheckinEventer }