mdm

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectTopic      = "mdm.Connect"
	AuthenticateTopic = "mdm.Authenticate"
	TokenUpdateTopic  = "mdm.TokenUpdate"
	CheckoutTopic     = "mdm.CheckOut"
)

Variables

This section is empty.

Functions

func MakeAcknowledgeEndpoint

func MakeAcknowledgeEndpoint(svc Service) endpoint.Endpoint

func MakeCheckinEndpoint

func MakeCheckinEndpoint(svc Service) endpoint.Endpoint

func MarshalAcknowledgeEvent

func MarshalAcknowledgeEvent(e *AcknowledgeEvent) ([]byte, error)

func MarshalCheckinEvent

func MarshalCheckinEvent(e *CheckinEvent) ([]byte, error)

MarshalCheckinEvent serializes an event to a protocol buffer wire format.

func RegisterHTTPHandlers

func RegisterHTTPHandlers(r *mux.Router, e Endpoints, verifier SignatureVerifier, logger log.Logger)

func UnmarshalAcknowledgeEvent

func UnmarshalAcknowledgeEvent(data []byte, e *AcknowledgeEvent) error

func UnmarshalCheckinEvent

func UnmarshalCheckinEvent(data []byte, e *CheckinEvent) error

UnmarshalCheckinEvent parses a protocol buffer representation of data into the Event.

Types

type AcknowledgeEvent

type AcknowledgeEvent struct {
	ID       string
	Time     time.Time
	Response Response
	Params   map[string]string
	Raw      []byte
}

type CheckinCommand

type CheckinCommand struct {
	// MessageType can be either Authenticate,
	// TokenUpdate or CheckOut
	MessageType string
	Topic       string
	UDID        string
	// contains filtered or unexported fields
}

CheckinRequest represents an MDM checkin command struct.

type CheckinEvent

type CheckinEvent struct {
	ID      string
	Time    time.Time
	Command CheckinCommand
	Params  map[string]string
	Raw     []byte
}

type Endpoints

type Endpoints struct {
	CheckinEndpoint     endpoint.Endpoint
	AcknowledgeEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service) Endpoints

type ErrorChainItem

type ErrorChainItem struct {
	ErrorCode            int    `json:"error_code,omitempty"`
	ErrorDomain          string `json:"error_domain,omitempty"`
	LocalizedDescription string `json:"localized_description,omitempty"`
	USEnglishDescription string `json:"us_english_description,omitempty"`
}

type MDMService

type MDMService struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(pub pubsub.Publisher, queue Queue) *MDMService

func (*MDMService) Acknowledge

func (svc *MDMService) Acknowledge(ctx context.Context, req AcknowledgeEvent) (payload []byte, err error)

func (*MDMService) Checkin

func (svc *MDMService) Checkin(ctx context.Context, event CheckinEvent) error

type Middleware

type Middleware func(Service) Service

type Queue

type Queue interface {
	Next(context.Context, Response) ([]byte, error)
}

Queue is an MDM Command Queue.

type Response

type Response struct {
	RequestType string `json:"request_type,omitempty" plist:",omitempty"`
	UDID        string
	UserID      *string `json:"user_id,omitempty" plist:"UserID,omitempty"`
	Status      string
	CommandUUID string
	ErrorChain  []ErrorChainItem `json:"error_chain" plist:",omitempty"`
}

type Service

type Service interface {
	Checkin(ctx context.Context, event CheckinEvent) error
	Acknowledge(ctx context.Context, event AcknowledgeEvent) (payload []byte, err error)
}

type SignatureVerifier

type SignatureVerifier interface {
	VerifySignature(sig string, message []byte) error
}

Directories

Path Synopsis
package appmanifest provides utilities for managing app manifest files used by MDM InstallApplication commands.
package appmanifest provides utilities for managing app manifest files used by MDM InstallApplication commands.
internal
mdm
internal/mdmproto
Package mdmproto is a generated protocol buffer package.
Package mdmproto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL