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 ¶
type AllStorage interface {
ServiceStore
PushStore
PushCertStore
CommandEnqueuer
CertAuthStore
CertAuthRetriever
StoreMigrator
TokenUpdateTallyStore
}
AllStorage represents all required storage by NanoMDM
type BootstrapTokenStore ¶
type BootstrapTokenStore interface {
StoreBootstrapToken(r *mdm.Request, msg *mdm.SetBootstrapToken) error
// RetrieveBootstrapToken retrieves the previously-escrowed Bootstrap Token.
// If a token has not yet been escrowed then a nil token and no error should be returned.
RetrieveBootstrapToken(r *mdm.Request, msg *mdm.GetBootstrapToken) (*mdm.BootstrapToken, error)
}
type CertAuthRetriever ¶ added in v0.6.0
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
Disable(r *mdm.Request) error
UserAuthenticateStore
}
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 retrieves push data for the given ids.
//
// If an ID does not exist or is not enrolled properly then
// implementations should silently skip returning any push data for
// them. It is up to the caller to discern any missing IDs from the
// returned map.
RetrievePushInfo(ctx context.Context, ids []string) (map[string]*mdm.Push, error)
}
PushStore retrieves APNs push-related data.
type ServiceStore ¶
type ServiceStore interface {
CheckinStore
CommandAndReportResultsStore
BootstrapTokenStore
}
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
type UserAuthenticateStore ¶ added in v0.7.0
type UserAuthenticateStore interface {
StoreUserAuthenticate(r *mdm.Request, msg *mdm.UserAuthenticate) error
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package file implements filesystem-based storage for MDM services
|
Package file implements filesystem-based storage for MDM services |
|
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 |