diff --git a/CHANGELOG.md b/CHANGELOG.md index 28b06566..6936950d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Remove deprecated `-apns` flags from server startup (#528) * Move API calls to list endpoints from HTTP GET to HTTP POST (#522, #523, #524, #525, #526) * Add support for the ApplicationConfiguration Setting (#521) +* Add support for the ActivationLockBypassCode Command (#578) * Allow SCEP client validity to be adjusted via server startup flag (#577) * Fix bug in mdmctl server saving, switch config when saving automatically (#565, #566) @@ -37,7 +38,7 @@ Thanks to our contributors for this release: @erikng, @gerardkok, @knightsc, @ma * Add device_information and security_info commands with curl API (#448) * Add support for InstallEnterpriseApplication command (#452) -## [v1.3.0](https://github.com/micromdm/micromdm/compare/v1.2.0...v1.3.0) +## [v1.3.0](https://github.com/micromdm/micromdm/compare/v1.2.0...v1.3.0) ### Auto-assigner diff --git a/mdm/mdm/internal/mdmproto/mdm.pb.go b/mdm/mdm/internal/mdmproto/mdm.pb.go index 81ea0907..68e97396 100644 --- a/mdm/mdm/internal/mdmproto/mdm.pb.go +++ b/mdm/mdm/internal/mdmproto/mdm.pb.go @@ -170,6 +170,7 @@ type Command struct { // - DeviceConfigured // - AvailableOSUpdates // - NSExtensionMappings + // - ActivationLockBypassCode // // Types that are valid to be assigned to Request: // *Command_InstallProfile diff --git a/mdm/mdm/internal/mdmproto/mdm.proto b/mdm/mdm/internal/mdmproto/mdm.proto index 8bd30c91..b0662a51 100644 --- a/mdm/mdm/internal/mdmproto/mdm.proto +++ b/mdm/mdm/internal/mdmproto/mdm.proto @@ -28,6 +28,7 @@ message Command { - DeviceConfigured - AvailableOSUpdates - NSExtensionMappings + - ActivationLockBypassCode */ oneof request { InstallProfile install_profile = 2; @@ -138,7 +139,7 @@ message EnableLostMode { message InstallApplication { int64 itunes_store_id = 1; string identifier = 2; - InstallApplicationOptions options = 3; + InstallApplicationOptions options = 3; string manifest_url = 4; int64 management_flags = 5; // bitwise OR InstallApplicationConfiguration configuration = 6; @@ -163,7 +164,7 @@ message InstallEnterpriseApplication { } message Manifest { - repeated ManifestItem manifest_items = 1; + repeated ManifestItem manifest_items = 1; } message ManifestItem { @@ -290,7 +291,7 @@ message ApplicationAttributesSetting { message ApplicationConfigurationSetting { string identifier = 1; - bytes configuration_dictionary_data = 2; // A serialized plist of the dictionary. + bytes configuration_dictionary_data = 2; // A serialized plist of the dictionary. } message ApplicationAttributes { @@ -405,8 +406,8 @@ message ErrorChain { string localized_description = 1; string us_english_description = 2; - // The ErrorDomain and ErrorCode keys contain internal codes used by Apple - // that may be useful for diagnostics. Your host should not rely on these + // The ErrorDomain and ErrorCode keys contain internal codes used by Apple + // that may be useful for diagnostics. Your host should not rely on these // values, as they may change between software releases. string error_domain = 3; int32 error_code = 4; diff --git a/mdm/mdm/marshal_json.go b/mdm/mdm/marshal_json.go index 35aaa5a9..881d464f 100644 --- a/mdm/mdm/marshal_json.go +++ b/mdm/mdm/marshal_json.go @@ -24,7 +24,8 @@ func (c *Command) MarshalJSON() ([]byte, error) { "DeviceConfigured", "AvailableOSUpdates", "NSExtensionMappings", - "OSUpdateStatus": + "OSUpdateStatus", + "ActivationLockBypassCode": var x = struct { RequestType string `json:"request_type"` }{ diff --git a/mdm/mdm/marshal_plist.go b/mdm/mdm/marshal_plist.go index b2cf00ea..281d91a2 100644 --- a/mdm/mdm/marshal_plist.go +++ b/mdm/mdm/marshal_plist.go @@ -26,7 +26,8 @@ func (c *Command) MarshalPlist() (interface{}, error) { "DeviceConfigured", "AvailableOSUpdates", "NSExtensionMappings", - "OSUpdateStatus": + "OSUpdateStatus", + "ActivationLockBypassCode": return &struct { RequestType string }{ diff --git a/mdm/mdm/marshal_proto.go b/mdm/mdm/marshal_proto.go index 15327020..94036dc8 100644 --- a/mdm/mdm/marshal_proto.go +++ b/mdm/mdm/marshal_proto.go @@ -42,7 +42,8 @@ func commandToProto(cmd *Command) (*mdmproto.Command, error) { "DeviceConfigured", "AvailableOSUpdates", "NSExtensionMappings", - "OSUpdateStatus": + "OSUpdateStatus", + "ActivationLockBypassCode": case "InstallProfile": if cmd.InstallProfile == nil { diff --git a/mdm/mdm/unmarshal_json.go b/mdm/mdm/unmarshal_json.go index 4a7ec7e7..b04b480b 100644 --- a/mdm/mdm/unmarshal_json.go +++ b/mdm/mdm/unmarshal_json.go @@ -47,7 +47,8 @@ func (c *Command) UnmarshalJSON(data []byte) error { "DeviceConfigured", "AvailableOSUpdates", "NSExtensionMappings", - "OSUpdateStatus": + "OSUpdateStatus", + "ActivationLockBypassCode": return nil case "InstallProfile": var payload InstallProfile diff --git a/mdm/mdm/unmarshal_plist.go b/mdm/mdm/unmarshal_plist.go index 059303f0..beeed02b 100644 --- a/mdm/mdm/unmarshal_plist.go +++ b/mdm/mdm/unmarshal_plist.go @@ -33,7 +33,8 @@ func (c *Command) UnmarshalPlist(unmarshal func(i interface{}) error) error { "DeviceConfigured", "AvailableOSUpdates", "NSExtensionMappings", - "OSUpdateStatus": + "OSUpdateStatus", + "ActivationLockBypassCode": return nil case "InstallProfile": var payload InstallProfile diff --git a/mdm/mdm/unmarshal_proto.go b/mdm/mdm/unmarshal_proto.go index e3958b04..faaa6716 100644 --- a/mdm/mdm/unmarshal_proto.go +++ b/mdm/mdm/unmarshal_proto.go @@ -27,7 +27,8 @@ func protoToCommand(pb *mdmproto.Command) *Command { "DeviceConfigured", "AvailableOSUpdates", "NSExtensionMappings", - "OSUpdateStatus": + "OSUpdateStatus", + "ActivationLockBypassCode": case "InstallProfile": cmd.InstallProfile = &InstallProfile{ diff --git a/tools/api/commands/activation_lock_bypass_code b/tools/api/commands/activation_lock_bypass_code new file mode 100755 index 00000000..d1655060 --- /dev/null +++ b/tools/api/commands/activation_lock_bypass_code @@ -0,0 +1,10 @@ +#!/bin/bash +source $MICROMDM_ENV_PATH +endpoint="v1/commands" +jq -n \ + --arg request_type "ActivationLockBypassCode" \ + --arg udid "$1" \ + '.udid = $udid + |.request_type = $request_type + '|\ + curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-