Documentation
¶
Overview ¶
Package plist wraps XML and binary property-list encoding and bounded decoding.
Design ¶
Marshal, Unmarshal, format detection and Decoder centralize use of github.com/micromdm/plist. Untrusted input can be bounded by bytes and XML nesting depth before codec dispatch. The depth control is specific to XML; the byte limit also applies to binary input.
MessageType and RequestType dispatch belong to mdmprotocol/mdm. Using one codec wrapper keeps format and resource-limit choices consistent across protocol callers.
References ¶
- Decision record 0002: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0002-plist-library.md
- Decision record 0004: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0004-checkin-and-command-core.md
- Threat model: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/security/threat-model.md (tampering with message bodies row)
- Apple: https://developer.apple.com/documentation/devicemanagement/check-in
- Apple: https://developer.apple.com/documentation/devicemanagement/commands-and-queries
Index ¶
Constants ¶
const ( DefaultMaxBytes = 4 << 20 DefaultMaxDepth = 64 )
Defaults applied by Unmarshal. Apple devices send command results of a few hundred KB at most (large inventories); 4 MiB leaves headroom.
Variables ¶
var ( ErrTooLarge = errors.New("plist: input exceeds size limit") ErrTooDeep = errors.New("plist: nesting exceeds depth limit") ErrUnknownFormat = errors.New("plist: input is neither XML nor binary plist") )
Errors returned by the decoders.
Functions ¶
func MarshalIndent ¶
MarshalIndent encodes v as an indented XML plist.
Types ¶
type Decoder ¶
Decoder decodes with explicit limits. Zero values mean the defaults; a negative value disables that limit.
type Format ¶
type Format int
Format is the detected plist serialisation.
func DetectFormat ¶
DetectFormat inspects the first bytes of data.
type Marshaler ¶
Marshaler and Unmarshaler are re-exported so callers do not import the underlying library.
type Unmarshaler ¶
type Unmarshaler = mplist.Unmarshaler
Marshaler and Unmarshaler are re-exported so callers do not import the underlying library.