storage

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: 3 Imported by: 3

Documentation

Overview

Package storage defines interfaces, types, data, and helpers related to storage and retrieval for MDM enrollments and commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllStorage

AllStorage represents all required storage by NanoMDM

type BootstrapTokenStore

type BootstrapTokenStore interface {
	StoreBootstrapToken(r *mdm.Request, msg *mdm.SetBootstrapToken) error
	RetrieveBootstrapToken(r *mdm.Request, msg *mdm.GetBootstrapToken) (*mdm.BootstrapToken, error)
}

type CertAuthRetriever added in v0.6.0

type CertAuthRetriever interface {
	// EnrollmentFromHash retrieves an enrollment ID from a cert hash.
	// Implementations should return an empty string if no result is found.
	EnrollmentFromHash(ctx context.Context, hash string) (string, error)
}

type CertAuthStore

type CertAuthStore interface {
	HasCertHash(r *mdm.Request, hash string) (bool, error)
	EnrollmentHasCertHash(r *mdm.Request, hash string) (bool, error)
	IsCertHashAssociated(r *mdm.Request, hash string) (bool, error)
	AssociateCertHash(r *mdm.Request, hash string) error
}

CertAuthStore stores and retrieves cert-to-enrollment associations.

type CheckinStore

type CheckinStore interface {
	StoreAuthenticate(r *mdm.Request, msg *mdm.Authenticate) error
	StoreTokenUpdate(r *mdm.Request, msg *mdm.TokenUpdate) error
	StoreUserAuthenticate(r *mdm.Request, msg *mdm.UserAuthenticate) error
	Disable(r *mdm.Request) error
}

CheckinStore stores MDM check-in data.

type CommandAndReportResultsStore

type CommandAndReportResultsStore interface {
	StoreCommandReport(r *mdm.Request, report *mdm.CommandResults) error
	RetrieveNextCommand(r *mdm.Request, skipNotNow bool) (*mdm.Command, error)
	ClearQueue(r *mdm.Request) error
}

CommandAndReportResultsStore stores and retrieves MDM command queue data.

type CommandEnqueuer

type CommandEnqueuer interface {
	EnqueueCommand(ctx context.Context, id []string, cmd *mdm.Command) (map[string]error, error)
}

CommandEnqueuer is able to enqueue MDM commands.

type PushCertStore

type PushCertStore interface {
	// IsPushCertStale asks a PushStore if the staleToken it has
	// is stale or not. The staleToken is returned from RetrievePushCert
	// and should turn stale (and return true) if the certificate has
	// changed—such as being renewed.
	IsPushCertStale(ctx context.Context, topic string, staleToken string) (bool, error)
	RetrievePushCert(ctx context.Context, topic string) (cert *tls.Certificate, staleToken string, err error)
	StorePushCert(ctx context.Context, pemCert, pemKey []byte) error
}

PushCertStore stores and retrieves APNs push certificates.

type PushStore

type PushStore interface {
	RetrievePushInfo(context.Context, []string) (map[string]*mdm.Push, error)
}

PushStore stores and retrieves APNs push-related data.

type ServiceStore

ServiceStore stores & retrieves both command and check-in data.

type StoreMigrator

type StoreMigrator interface {
	// RetrieveMigrationCheckins sends the (decoded) forms of
	// Authenticate and TokenUpdate messages to the provided channel.
	// Note that order matters: device channel TokenUpdate messages must
	// follow Authenticate messages and user channel TokenUpdates must
	// follow the device channel TokenUpdate.
	RetrieveMigrationCheckins(context.Context, chan<- interface{}) error
}

StoreMigrator retrieves MDM check-ins

type TokenUpdateTallyStore

type TokenUpdateTallyStore interface {
	RetrieveTokenUpdateTally(ctx context.Context, id string) (int, error)
}

TokenUpdateTallyStore retrieves the TokenUpdate tally (count) for an id

Directories

Path Synopsis
Package file implements filesystem-based storage for MDM services
Package file implements filesystem-based storage for MDM services
internal
Package mysql stores and retrieves MDM data from MySQL
Package mysql stores and retrieves MDM data from MySQL
Package pgsql stores and retrieves MDM data from PostgresSQL
Package pgsql stores and retrieves MDM data from PostgresSQL

Jump to

Keyboard shortcuts

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