Documentation
¶
Overview ¶
Package dmhook defines service-operation metadata and the hook interface for observing or vetoing operations.
Design ¶
Call and Hook let protocol packages supply behavior without importing server/service. Account-driven authentication checks and declarative lifecycle cleanup use this interface. server/service exposes aliases, so implementations written against either package satisfy the same contract. Hook ordering and error handling are defined by the service that invokes them.
References ¶
- Decision record 0001: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0001-architecture.md (the hook chain)
- Decision record 0004: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0004-checkin-and-command-core.md
- Decision record 0028: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0028-account-driven-enrollment-and-service-discovery.md
- Decision record 0044: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0044-repository-layout.md
- Apple: https://developer.apple.com/documentation/devicemanagement/check-in
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
// Op is "checkin:<MessageType>", "connect", "enqueue", "export", or
// "import".
Op string
Request *mdm.Request
Checkin *mdm.Checkin
Response *mdm.Response
Command *mdm.Command
}
Call describes one service operation for hooks.
type Completer ¶ added in v0.2.0
Completer persists a successful check-in's authorization state before the transport reports success. An error is returned to the device; implementations must permit an idempotent retry after a partially completed service operation.
type Hook ¶
type Hook interface {
Before(ctx context.Context, c *Call) (context.Context, error)
After(ctx context.Context, c *Call, err error)
}
Hook observes and may veto operations. Before runs before storage is touched; an error aborts the operation with CodeForbidden. After runs with the operation's result.