mdm icon indicating copy to clipboard operation
mdm copied to clipboard

Response struct missing fields for ProfileList and ProvisioningProfileList

Open ThomasDotCodes opened this issue 9 years ago • 1 comments

If it matters, this is via iOS 9.3.5

The ResponseStruct has a field for InstalledApplicationList: https://github.com/micromdm/mdm/blob/6e0586cca72594720a1c7c48214661a87c73bd17/response.go#L16

However it does not have any fields for ProfileList or ProvisioningProfileList

A quick (but less than ideal) solution in testing so far was to update response.go with following edits:

Response struct

// Response is an MDM Command Response
type Response struct {
	UDID                     string
	UserID                   *string `json:"user_id,omitempty" plist:"UserID,omitempty"`
	Status                   string
	CommandUUID              string
	RequestType              string                           `json:"request_type,omitempty" plist:",omitempty"`
	ErrorChain               []ErrorChainItem                 `json:"error_chain" plist:",omitempty"`
	QueryResponses           QueryResponses                   `json:"query_responses,omitempty" plist:",omitempty"`
	SecurityInfo             SecurityInfo                     `json:"security_info,omitempty" plist:",omitempty"`
	CertificateList          CertificateList                  `json:"certificate_list,omitempty" plist:",omitempty"`
	InstalledApplicationList InstalledApplicationListResponse `json:"installed_application_list,omitempty" plist:",omitempty"`
	ProvisioningProfileList  []ProvisioningProfileListItem
	ProfileList              []ProfileListItem
}

additional structs

type ProfileListItem struct {
	HasRemovalPasscode bool
	IsEncrypted        bool
	PayloadContent     []PayloadData
	PayloadData
}

type PayloadData struct {
	PayloadDescription       string
	PayloadDisplayName       string
	PayloadIdentifier        string
	PayloadType              string
	PayloadVersion           uint32
	PayloadUUID              string
	PayloadRemovalDisallowed bool
}

Any suggestions on how to do this better are more than welcome. Will update this issue as I make any changes/improvements.

ThomasDotCodes avatar Nov 18 '16 17:11 ThomasDotCodes

NOTE: I'm not using micromdm, only using the mdm package for structs. So the associated json isn't important for me, but I assume would be for micromdm.

Another NOTE: same issue applies to Restrictions response (it doesn't have a field in the Response struct)

ThomasDotCodes avatar Nov 18 '16 17:11 ThomasDotCodes