mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-11 12:15:34 +08:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user