director

package
Version: v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const MAX = 5

Variables

View Source
var (
	TotalPushes = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "micromdm",
		Subsystem: "apns_pushes",
		Name:      "total",
		Help:      "Total number of APNS Pushes completed.",
	})

	ProfilesPushed = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "micromdm",
		Subsystem: "profiles",
		Name:      "pushed_total",
		Help:      "Number of profiles pushed.",
	})

	InstallApplicationsPushed = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "micromdm",
		Subsystem: "install_applications",
		Name:      "pushed_total",
		Help:      "Number of InstallApplications pushed.",
	})

	TotalPushes60s               float64
	ProfilesPushed60s            float64
	InstallApplicationsPushed60s float64
)
View Source
var DevicesFetchedFromMDM bool

Functions

func ClearCommands

func ClearCommands(device *types.Device) error

func CommandInQueue

func CommandInQueue(device types.Device, command string, afterDate time.Time) bool

func DebugLogger

func DebugLogger(logholder LogHolder)

func DeleteDeviceProfiles

func DeleteDeviceProfiles(devices []types.Device, profiles []types.DeviceProfile) ([]types.Command, error)

func DeletePendingCommands

func DeletePendingCommands(w http.ResponseWriter, r *http.Request)

func DeleteProfileHandler

func DeleteProfileHandler(w http.ResponseWriter, r *http.Request)

func DeleteSharedProfiles

func DeleteSharedProfiles(devices []types.Device, profiles []types.SharedProfile) ([]types.Command, error)

func DeviceHandler

func DeviceHandler(w http.ResponseWriter, r *http.Request)

func DisableSharedProfiles

func DisableSharedProfiles(payload types.DeleteProfilePayload) error

func EraseLockDevice

func EraseLockDevice(udid string) error

func ErrorLogger

func ErrorLogger(logholder LogHolder)

func ExpireCommands

func ExpireCommands() error

func FatalLogger

func FatalLogger(logholder LogHolder)

func FetchDeviceAndRelations

func FetchDeviceAndRelations(device types.Device) (types.Device, error)

func FetchDeviceModelAndRelations

func FetchDeviceModelAndRelations(device types.Device) (types.Device, error)

func FetchDevicesFromMDM

func FetchDevicesFromMDM()

func GetAllCommands

func GetAllCommands(w http.ResponseWriter, r *http.Request)

func GetAllDevices

func GetAllDevices() ([]types.Device, error)

func GetAllDevicesAndAssociations

func GetAllDevicesAndAssociations() ([]types.Device, error)

func GetDevice

func GetDevice(udid string) (types.Device, error)

func GetDeviceProfiles

func GetDeviceProfiles(w http.ResponseWriter, r *http.Request)

func GetDeviceSerial

func GetDeviceSerial(serial string) (types.Device, error)

func GetErrorCommands

func GetErrorCommands(w http.ResponseWriter, r *http.Request)

func GetPendingCommands

func GetPendingCommands(w http.ResponseWriter, r *http.Request)

func GetSharedApplicationss

func GetSharedApplicationss(w http.ResponseWriter, r *http.Request)

func GetSharedProfiles

func GetSharedProfiles(w http.ResponseWriter, r *http.Request)

func HealthCheck

func HealthCheck(w http.ResponseWriter, r *http.Request)

todo verify database is accessible verify we can connect to micromdm

func InfoLogger

func InfoLogger(logholder LogHolder)

func InstallAllProfiles

func InstallAllProfiles(device types.Device) ([]types.Command, error)

func InstallAppInQueue

func InstallAppInQueue(device types.Device, data string) (bool, error)

func InstallBootstrapPackages

func InstallBootstrapPackages(device types.Device) ([]types.Command, error)

func Metrics

func Metrics()

func PostDeviceCommandHandler

func PostDeviceCommandHandler(w http.ResponseWriter, r *http.Request)

func PostInstallApplicationHandler

func PostInstallApplicationHandler(w http.ResponseWriter, r *http.Request)

func PostProfileHandler

func PostProfileHandler(w http.ResponseWriter, r *http.Request)

func ProcessDeviceProfiles

func ProcessDeviceProfiles(device types.Device, profiles []types.DeviceProfile, pushNow bool, requestType string) (types.MetadataItem, error)

func ProcessScheduledCheckinQueue

func ProcessScheduledCheckinQueue(pushQueue taskq.Queue)

func PushDevice

func PushDevice(udid string) error

func PushDeviceHandler added in v0.2.1

func PushDeviceHandler(w http.ResponseWriter, r *http.Request)

func PushInstallApplication

func PushInstallApplication(devices []types.Device, installApplication types.DeviceInstallApplication) ([]types.Command, error)

func PushProfiles

func PushProfiles(devices []types.Device, profiles []types.DeviceProfile) ([]types.Command, error)

func PushSharedInstallApplication

func PushSharedInstallApplication(devices []types.Device, installSharedApplication types.SharedInstallApplication) ([]types.Command, error)

func PushSharedProfiles

func PushSharedProfiles(devices []types.Device, profiles []types.SharedProfile) ([]types.Command, error)

func RedisClient added in v0.2.0

func RedisClient() *redis.Client

func RequestAllDeviceInfo

func RequestAllDeviceInfo(device types.Device) error

func RequestCertificateList

func RequestCertificateList(device types.Device) error

func RequestDeviceInformation

func RequestDeviceInformation(device types.Device) error

func RequestDeviceUpdate

func RequestDeviceUpdate(device types.Device)

func RequestProfileList

func RequestProfileList(device types.Device) error

func RequestSecurityInfo

func RequestSecurityInfo(device types.Device) error

func ResetDevice

func ResetDevice(device types.Device) error

func RetryCommands

func RetryCommands()

func RunInitialTasks

func RunInitialTasks(udid string) error

func SaveDeviceConfigured

func SaveDeviceConfigured(device types.Device) error

func SaveInstallApplications

func SaveInstallApplications(devices []types.Device, payload types.InstallApplicationPayload) error

func SaveProfiles

func SaveProfiles(devices []types.Device, profiles []types.DeviceProfile) error

func SaveSecurityInfo

func SaveSecurityInfo(securityInfoData types.SecurityInfoData, device types.Device) error

func SaveSharedInstallApplications

func SaveSharedInstallApplications(payload types.InstallApplicationPayload) error

func SaveSharedProfiles

func SaveSharedProfiles(profiles []types.SharedProfile) error

func SavedDeviceProfileDiffers

func SavedDeviceProfileDiffers(device types.Device, profile types.DeviceProfile) (bool, error)

func SavedProfileIsPresent

func SavedProfileIsPresent(device types.Device, profile types.DeviceProfile) (bool, error)

func ScheduledCheckin

func ScheduledCheckin(pushQueue taskq.Queue, onceIn time.Duration)

func SendCommand

func SendCommand(commandPayload types.CommandPayload) (types.Command, error)

func SendDeviceConfigured

func SendDeviceConfigured(device types.Device) error

func SetTokenUpdate

func SetTokenUpdate(device types.Device) (types.Device, error)

func SignProfile

func SignProfile(key crypto.PrivateKey, cert *x509.Certificate, mobileconfig []byte) ([]byte, error)

Sign takes an unsigned payload and signs it with the provided private key and certificate.

func SingleDeviceHandler

func SingleDeviceHandler(w http.ResponseWriter, r *http.Request)

func SingleDeviceOutput

func SingleDeviceOutput(device types.Device, w http.ResponseWriter, r *http.Request) error

func SingleDeviceSerialHandler

func SingleDeviceSerialHandler(w http.ResponseWriter, r *http.Request)

func UnconfiguredDevices

func UnconfiguredDevices()

func UpdateCommand

func UpdateCommand(ackEvent *types.AcknowledgeEvent, device types.Device, payloadDict map[string]interface{}) error

func UpdateDevice

func UpdateDevice(newDevice types.Device) (*types.Device, error)

func UpdateDeviceBools

func UpdateDeviceBools(newDevice *types.Device) error

func VerifyMDMProfiles

func VerifyMDMProfiles(profileListData types.ProfileListData, device types.Device) error

func WarnLogger

func WarnLogger(logholder LogHolder)

func WebhookHandler

func WebhookHandler(w http.ResponseWriter, r *http.Request)

Types

type LogHolder

type LogHolder struct {
	DeviceUDID         string
	DeviceSerial       string
	CommandUUID        string
	CommandRequestType string
	CommandStatus      string
	ProfileUUID        string
	ProfileIdentifier  string
	Message            string
	Metric             string
}

type ProfileForVerification added in v0.3.0

type ProfileForVerification struct {
	PayloadUUID       string
	PayloadIdentifier string
	HashedPayloadUUID string
	MobileconfigData  []byte
	MobileconfigHash  []byte
	DeviceUDID        string
	Installed         bool
	Type              string // device or shared
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL