support

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package support queries generated platform, version, channel and enrollment-context metadata.

Design

Generated packages register supportedOS tables. Lookup, Families and Paths expose those entries, and Check evaluates a Target with a reason and deprecation information. Generated validators and dmctl explain use the same metadata. Pointer booleans preserve the difference between an unspecified condition and an explicit prohibition.

The tables describe the pinned Apple schema. Missing support or target data limits what can be inferred; consumers must inspect the result reason rather than treat an unspecified target as verified compatibility.

References

Index

Constants

This section is empty.

Variables

View Source
var AllOS = []OS{IOS, MacOS, TvOS, VisionOS, WatchOS}

AllOS lists the operating systems in schema order.

View Source
var ErrVersion = errors.New("support: malformed version")

ErrVersion is returned by ParseVersion for malformed input.

Functions

func Bool

func Bool(b bool) *bool

Bool is a helper for table literals.

func Families

func Families() []string

Families lists registered families in sorted order.

func Paths

func Paths(family string) []string

Paths lists the key paths of a family in sorted order.

func Register

func Register(family string, table map[string]*Entry)

Register installs a family's table. Generated packages call it from init. Registering the same family twice replaces the table.

Types

type Channel

type Channel string

Channel is the MDM channel a message travels on.

const (
	ChannelDevice Channel = "device"
	ChannelUser   Channel = "user"
)

Channels.

type Entry

type Entry struct {
	Path string
	OS   map[OS]*OSSupport
}

Entry is the support table row for one schema key path.

func Lookup

func Lookup(family, path string) *Entry

Lookup returns the entry for a key path in a family, or nil.

func (*Entry) Check

func (e *Entry) Check(t Target) Result

Check evaluates the entry against a target.

type Mode

type Mode string

Mode is Apple's allowed/required/forbidden/ignored setting for shared iPad and user enrollment contexts. Empty means unspecified (allowed).

const (
	ModeAllowed   Mode = "allowed"
	ModeRequired  Mode = "required"
	ModeForbidden Mode = "forbidden"
	ModeIgnored   Mode = "ignored"
)

Modes.

type OS

type OS string

OS names as used in Apple's schema.

const (
	IOS      OS = "iOS"
	MacOS    OS = "macOS"
	TvOS     OS = "tvOS"
	VisionOS OS = "visionOS"
	WatchOS  OS = "watchOS"
)

Operating systems.

func OSFromProduct

func OSFromProduct(product string) OS

OSFromProduct maps a device product type (Authenticate's ProductName or MachineInfo's PRODUCT, for example "iPhone17,2", "Mac16,1", "iPad14,1", "AppleTV14,1", "RealityDevice14,1", "Watch7,1") to the OS family Apple's schema keys support on. iPadOS is keyed as iOS in the schema. Unknown prefixes return "".

type OSSupport

type OSSupport struct {
	// NotAvailable is set when Apple lists "introduced: n/a".
	NotAvailable bool
	Introduced   Version
	Deprecated   Version
	Removed      Version
	AccessRights string
	Beta         bool

	// Tri-state booleans: nil means Apple did not say.
	Multiple           *bool
	DeviceChannel      *bool
	UserChannel        *bool
	Supervised         *bool
	RequiresDEP        *bool
	UserApprovedMDM    *bool
	AllowManualInstall *bool
	AlwaysSkippable    *bool

	AllowedEnrollments []string
	AllowedScopes      []string

	SharedIPadMode          Mode
	SharedIPadDeviceChannel *bool
	SharedIPadUserChannel   *bool
	SharedIPadScopes        []string

	UserEnrollmentMode     Mode
	UserEnrollmentBehavior string
}

OSSupport is the effective support block for one key on one OS after inheritance from the enclosing payload and parent keys.

type Result

type Result struct {
	Supported  bool
	Deprecated bool
	Reason     string
	OS         *OSSupport
}

Result of a support check.

type Target

type Target struct {
	OS             OS
	Version        Version
	Channel        Channel
	Supervised     bool
	SharedIPad     bool
	UserEnrollment bool
	DEP            bool
	UserApproved   bool
}

Target describes the device a value is destined for. The zero Target disables every context check.

type Version

type Version struct {
	Major, Minor, Patch int
}

Version is a dotted OS version. The zero Version means "unspecified".

func MustVersion

func MustVersion(s string) Version

MustVersion parses or panics; for generated tables and tests.

func ParseVersion

func ParseVersion(s string) (Version, error)

ParseVersion parses "26", "26.4", or "10.15.4".

func V

func V(major, minor, patch int) Version

V builds a Version.

func (Version) Compare

func (v Version) Compare(o Version) int

Compare returns -1, 0, or 1.

func (Version) IsZero

func (v Version) IsZero() bool

IsZero reports whether the version is unspecified.

func (Version) String

func (v Version) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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