Support User Enrollment (#597)

In iOS 10.13/macOS 10.15 a new, BYOD specific enrollment type was added, called User Enrollment.
This enrollment type replaces the typical UDID field in checkin and acknowledge requests with a EnrollmentID field which is unique per each enrollment. One important aspect of this enrollment type is that no personally identifiable information is available to the MDM (UDID, SerialNumber).

The implementation implemented here adds the new EnrollmentID field where appropriate, and ensures that the device tables do not store the enrollment ID.

I will follow up this change set with one that allows listing/removing current enrollment IDs in a similar way that mdmctl get devices and mdmctl get users does.
This commit is contained in:
Victor Vrantchan
2019-06-29 15:36:13 -07:00
committed by GitHub
parent afcf5466a5
commit 127955dc74
14 changed files with 209 additions and 137 deletions

View File

@@ -48,11 +48,18 @@ func (db *Store) Next(ctx context.Context, resp mdm.Response) ([]byte, error) {
}
func (db *Store) nextCommand(ctx context.Context, resp mdm.Response) (*Command, error) {
// The UDID is the primary key for the queue.
// Depending on the enrollment type, replace the UDID with a different ID type.
// UserID for managed user channel
// EnrollmentID for BYOD User Enrollment.
udid := resp.UDID
if resp.UserID != nil {
// use the user id for user level commands
udid = *resp.UserID
}
if resp.EnrollmentID != nil {
udid = *resp.EnrollmentID
}
dc, err := db.DeviceCommand(udid)
if err != nil {
if isNotFound(err) {