devices

package
v0.0.0-...-baca4c3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountAPI

func MountAPI(s Service, builder *schemabuilder.Schema)

MountAPI attaches the Devices Schema to the GraphQL API

Types

type Device

type Device struct {
	UUID                string                    `graphql:"uuid"`      // A unique identifier given to each device by the MDM server upon enrollment
	DisplayName         string                    `graphql:",optional"` // The user friendly name for the device.
	Protocol            MDMProtcol                `graphql:",optional"` // The MDM Protocol that manages the device
	EnrolledAt          time.Time                 `graphql:",optional"` // Time device was enrolled in MDM (Read only)
	EnrolledBy          types.User                `graphql:",optional"` // The user that enrolled the device in MDM (Stores UUID only in struct as reference) (Read only)
	Windows             WindowsDevice             `graphql:",optional"`
	Hardware            DeviceHardware            `graphql:",optional"`
	IdentityCertificate DeviceIdentityCertificate `graphql:",optional"`
}

Device is an electronic device that is managed by the MDM server TODO: Make cross platform. Currently it has lots of Windows only values.

type DeviceHardware

type DeviceHardware struct {
	ID  string   `graphql:",optional"` // HardwareID
	MAC []string `graphql:",optional"`
}

DeviceHardware contains details about the physical device managed by MDM

type DeviceIdentityCertificate

type DeviceIdentityCertificate struct {
	Subject   pkix.Name `graphql:"-"`
	Hash      string    `graphql:",optional"`
	NotBefore time.Time `graphql:",optional"`
	NotAfter  time.Time `graphql:",optional"`
}

DeviceIdentityCertificate contains detials about the identity certificate issued to the device

type MDMProtcol

type MDMProtcol int

MDMProtcol defines the protocol a device is being managed by

const (
	// WindowsMDM is MDMProtocol used to manage Windows devices
	WindowsMDM MDMProtcol = iota
	// AppleMDM is the MDMProtocol used to manage Apple devices
	AppleMDM
)

type Service

type Service interface {
	GetAll() ([]Device, error)
	GetXDevices(firstDeviceUUID *string, count int64) ([]Device, error)
	Get(uuid string) (Device, error)
	Search(query string) ([]Device, error)
	EditOrCreate(device Device) error
}

Service contains the code for interfacing with devices.

type WindowsDevice

type WindowsDevice struct {
	DeviceID           string `graphql:",optional"`
	DeviceType         string `graphql:",optional"`
	EnrollmentType     string `graphql:",optional"`
	OSEdition          string `graphql:",optional"`
	OSVersion          string `graphql:",optional"`
	ApplicationVersion string `graphql:",optional"`
}

TODO: move to Windows package

Jump to

Keyboard shortcuts

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