Add DeviceName MDM command builder for renaming Apple devices - #48703
Conversation
Relates to #48622 Add the MDMAppleCommander.DeviceNameSetting method that emits a Settings command with a DeviceName item to rename macOS/iOS/iPadOS devices, along with the DEVNAME- command UUID prefix. Device names come from admin input, so the name is XML-escaped via mobileconfig.XMLEscapeString.
|
@coderabbitai full review |
✅ Action performedFull review finished. |
WalkthroughThis PR adds support for renaming Apple MDM-managed devices via a new Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant MDMAppleCommander
participant EnqueueCommand
Caller->>MDMAppleCommander: DeviceNameSetting(ctx, hostUUID, cmdUUID, deviceName)
MDMAppleCommander->>MDMAppleCommander: XML-escape deviceName
MDMAppleCommander->>MDMAppleCommander: build Settings plist with DeviceName item
MDMAppleCommander->>EnqueueCommand: send command to hostUUID
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 38806-macos-iosipados-rename-hosts #48703 +/- ##
=====================================================================
Coverage ? 68.02%
=====================================================================
Files ? 3679
Lines ? 233833
Branches ? 12268
=====================================================================
Hits ? 159060
Misses ? 60459
Partials ? 14314
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
| ) | ||
|
|
||
| // DeviceNameCommandUUIDPrefix is the prefix used for the MDM command that renames a device. | ||
| const DeviceNameCommandUUIDPrefix = "DEVNAME-" |
d437406
into
38806-macos-iosipados-rename-hosts
Relates to #48622 Add the MDMAppleCommander.DeviceNameSetting method that emits a Settings command with a DeviceName item to rename macOS/iOS/iPadOS devices, along with the DEVNAME- command UUID prefix. Device names come from admin input, so the name is XML-escaped via mobileconfig.XMLEscapeString.
Related issue: Relates to #48622
Add the MDMAppleCommander.DeviceNameSetting method that emits a Settings command with a DeviceName item to rename macOS/iOS/iPadOS devices, along with the DEVNAME- command UUID prefix. Device names come from admin input, so the name is XML-escaped via mobileconfig.XMLEscapeString.
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Testing
Summary by CodeRabbit
New Features
Tests