file

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package file implements filesystem-based storage for MDM services

Index

Constants

View Source
const (
	AuthenticateFilename = "Authenticate.plist"
	TokenUpdateFilename  = "TokenUpdate.plist"
	UnlockTokenFilename  = "UnlockToken.dat"
	SerialNumberFilename = "SerialNumber.txt"
	IdentityCertFilename = "Identity.pem"
	DisabledFilename     = "Disabled"
	BootstrapTokenFile   = "BootstrapToken.dat"

	TokenUpdateTallyFilename = "TokenUpdate.tally.txt"

	UserAuthFilename       = "UserAuthenticate.plist"
	UserAuthDigestFilename = "UserAuthenticate.Digest.plist"

	CertAuthFilename             = "CertAuth.sha256.txt"
	CertAuthAssociationsFilename = "CertAuth.txt"

	// The associations for "sub"-enrollments (that is: user-channel
	// enrollments to device-channel enrollments) are stored in this
	// directory under the device's directory.
	SubEnrollmentPathname = "SubEnrollments"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStorage

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

FileStorage implements filesystem-based storage for MDM services

func New

func New(path string) (*FileStorage, error)

New creates a new FileStorage backend

func (*FileStorage) AssociateCertHash

func (s *FileStorage) AssociateCertHash(r *mdm.Request, hash string) error

func (*FileStorage) ClearQueue

func (s *FileStorage) ClearQueue(r *mdm.Request) error

func (*FileStorage) Disable

func (s *FileStorage) Disable(r *mdm.Request) error

func (*FileStorage) EnqueueCommand

func (s *FileStorage) EnqueueCommand(_ context.Context, ids []string, command *mdm.Command) (map[string]error, error)

EnqueueCommand writes the command to disk in the queue directory

func (*FileStorage) EnrollmentFromHash added in v0.6.0

func (s *FileStorage) EnrollmentFromHash(_ context.Context, hash string) (string, error)

func (*FileStorage) EnrollmentHasCertHash

func (s *FileStorage) EnrollmentHasCertHash(r *mdm.Request, _ string) (bool, error)

func (*FileStorage) HasCertHash

func (s *FileStorage) HasCertHash(r *mdm.Request, hash string) (bool, error)

func (*FileStorage) IsCertHashAssociated

func (s *FileStorage) IsCertHashAssociated(r *mdm.Request, hash string) (bool, error)

func (*FileStorage) IsPushCertStale

func (s *FileStorage) IsPushCertStale(ctx context.Context, topic, providedStaleToken string) (bool, error)

IsPushCertStale is passed through to a new PushCertFileStorage

func (*FileStorage) RetrieveBootstrapToken

func (s *FileStorage) RetrieveBootstrapToken(r *mdm.Request, _ *mdm.GetBootstrapToken) (*mdm.BootstrapToken, error)

func (*FileStorage) RetrieveMigrationCheckins

func (s *FileStorage) RetrieveMigrationCheckins(_ context.Context, c chan<- interface{}) error

func (*FileStorage) RetrieveNextCommand

func (s *FileStorage) RetrieveNextCommand(r *mdm.Request, skipNotNow bool) (*mdm.Command, error)

RetrieveNextCommand gets the next command from the queue while minding NotNow status

func (*FileStorage) RetrievePushCert

func (s *FileStorage) RetrievePushCert(ctx context.Context, topic string) (*tls.Certificate, string, error)

RetrievePushCert is passed through to a new PushCertFileStorage

func (*FileStorage) RetrievePushInfo

func (s *FileStorage) RetrievePushInfo(_ context.Context, ids []string) (map[string]*mdm.Push, error)

RetrievePushInfo retrieves APNs-related data for push notifications

func (*FileStorage) RetrieveTokenUpdateTally

func (s *FileStorage) RetrieveTokenUpdateTally(_ context.Context, id string) (int, error)

func (*FileStorage) StoreAuthenticate

func (s *FileStorage) StoreAuthenticate(r *mdm.Request, msg *mdm.Authenticate) error

StoreAuthenticate stores the Authenticate message

func (*FileStorage) StoreBootstrapToken

func (s *FileStorage) StoreBootstrapToken(r *mdm.Request, msg *mdm.SetBootstrapToken) error

func (*FileStorage) StoreCommandReport

func (s *FileStorage) StoreCommandReport(r *mdm.Request, report *mdm.CommandResults) error

StoreCommandReport moves commands to different queues (like NotNow)

func (*FileStorage) StorePushCert

func (s *FileStorage) StorePushCert(ctx context.Context, pemCert, pemKey []byte) error

StorePushCert is passed through to a new PushCertFileStorage

func (*FileStorage) StoreTokenUpdate

func (s *FileStorage) StoreTokenUpdate(r *mdm.Request, msg *mdm.TokenUpdate) error

StoreTokenUpdate stores the TokenUpdate message

func (*FileStorage) StoreUserAuthenticate

func (s *FileStorage) StoreUserAuthenticate(r *mdm.Request, msg *mdm.UserAuthenticate) error

type PushCertFileStorage

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

PushCertFileStorage is a filesystem-based PushCertStore

func NewPushCertFileStorage

func NewPushCertFileStorage(certPath, keyPath string) *PushCertFileStorage

func (*PushCertFileStorage) IsPushCertStale

func (s *PushCertFileStorage) IsPushCertStale(_ context.Context, topic, providedStaleToken string) (bool, error)

IsPushCertStale inspects staleToken to tell if our push certs are stale

func (*PushCertFileStorage) RetrievePushCert

func (s *PushCertFileStorage) RetrievePushCert(_ context.Context, topic string) (*tls.Certificate, string, error)

RetrievePushCert reads the Push Certificate from disk

func (*PushCertFileStorage) StorePushCert

func (s *PushCertFileStorage) StorePushCert(_ context.Context, pemCert, pemKey []byte) error

StorePushCert writes the push cert to disk

Jump to

Keyboard shortcuts

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