Documentation
¶
Overview ¶
Package applicationpackages hosts verified installer revisions for native MDM and DDM delivery through enrollment-scoped download grants.
Design ¶
Host uses the applications library for metadata, content and manifest integrity. Prepare validates the enrolled device's capabilities and creates a bounded grant for one immutable revision. Only the grant token's hash is stored. Fetch checks expiry, revocation, enrollment status and package availability on every request. Download URLs are bearer credentials and require HTTPS and access-log redaction.
The reference server authorizes operators, dispatches the prepared MDM command or DDM publication and observes device results. Preparing or queuing a package does not establish installation. Revoke removes download access; removing a DDM assignment or uninstalling an application remains a separate device operation.
References ¶
- Apple enterprise application installation: https://developer.apple.com/documentation/devicemanagement/installenterpriseapplicationcommand
- Apple declarative package schema: https://github.com/apple/device-management/blob/release/declarative/declarations/configurations/package.yaml
Index ¶
- Constants
- type Config
- type Grant
- type Host
- func (h *Host) Content(ctx context.Context, token string) (applications.Content, Grant, error)
- func (h *Host) Manifest(ctx context.Context, token string) ([]byte, Grant, error)
- func (h *Host) Open(ctx context.Context, token string, offset, length int64) (io.ReadCloser, applications.Content, error)
- func (h *Host) Prepare(ctx context.Context, id mdm.EnrollmentID, packageID, revision, method string, ...) (Plan, error)
- func (h *Host) Revoke(ctx context.Context, id mdm.EnrollmentID, grantID string) error
- type Plan
Constants ¶
const Path = "/applications/download/"
Path is the public download prefix. Redact the next path component before logs.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Packages *applications.Manager
State state.Store
BaseURL string
Now func() time.Time
Target func(context.Context, mdm.EnrollmentID) (support.Target, error)
Authorize func(context.Context, mdm.EnrollmentID) error
}
Config separates verified content from enrollment authorization and dispatch.
type Grant ¶
type Grant struct {
ID string `json:"id"`
Enrollment mdm.EnrollmentID `json:"enrollment"`
PackageID string `json:"packageId"`
ContentRevision string `json:"contentRevision"`
Method string `json:"method"`
ExpiresAt time.Time `json:"expiresAt"`
}
Grant describes one expiring download capability. Its bearer token is never retained; ID is the token hash used for explicit revocation by the operator.
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host prepares device-specific delivery and authorizes immutable downloads.
func (*Host) Manifest ¶
Manifest returns the library-generated plist for the grant's immutable revision.
func (*Host) Open ¶
func (h *Host) Open(ctx context.Context, token string, offset, length int64) (io.ReadCloser, applications.Content, error)
Open checks grant liveness and opens the selected bounded package range.
func (*Host) Prepare ¶
func (h *Host) Prepare(ctx context.Context, id mdm.EnrollmentID, packageID, revision, method string, ttl time.Duration) (Plan, error)
Prepare validates metadata and Apple's platform rules before creating a grant. method is mdm or ddm. TTL defaults to one hour and may not exceed seven days. DDM requests a required install; optional self-service policy is not implied.