1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 option optimize_for = LITE_RUNTIME;
9 package enterprise_management;
11 // Request from device to server to register device.
12 message DeviceRegisterRequest {
13 // Reregister device without erasing server state. It can be used
14 // to refresh dmtoken etc. Client MUST set this value to true if it
15 // reuses an existing device id.
16 optional bool reregister = 1;
18 // Device register type. This field does not exist for TT release.
19 // When a client requests for policies, server should verify the
20 // client has been registered properly. For example, a client must
21 // register with type DEVICE in order to retrieve device policies.
23 TT = 0; // Register for TT release.
24 USER = 1; // Register for Chrome OS user polices.
25 DEVICE = 2; // Register for device policies.
26 BROWSER = 3; // Register for Chrome user policies.
27 ANDROID_BROWSER = 4; // Register for Android Chrome browser user policies.
28 IOS_BROWSER = 5; // Register for iOS Chrome browser user policies.
30 // NOTE: we also use this field to detect client version. If this
31 // field is missing, then the request comes from TT. We will remove
32 // Chrome OS TT support once it is over.
33 optional Type type = 2 [default = TT];
35 // Machine hardware id, such as serial number.
36 // This field is required if register type == DEVICE.
37 optional string machine_id = 3;
39 // Machine model name, such as "ZGA", "Cr-48", "Nexus One". If the
40 // model name is not available, client SHOULD send generic name like
41 // "Android", or "Chrome OS".
42 optional string machine_model = 4;
44 // OBSOLETE: Legacy auto-enrollment is not longer supported.
45 optional bool OBSOLETE_auto_enrolled = 5 [deprecated = true];
47 // Indicates a requisition of the registering entity that the server can act
48 // upon. This allows clients to pass hints e.g. at device enrollment time
49 // about the intended use of the device.
50 optional string requisition = 6;
52 // The current server-backed state key for the client, if applicable. This can
53 // be used by the server to link the registration request to an existing
54 // device record for re-enrollment.
55 optional bytes server_backed_state_key = 7;
57 // Enumerates different flavors of registration.
59 // User manually enrolls a device for device management.
60 FLAVOR_ENROLLMENT_MANUAL = 0;
61 // User re-starts enrollment manually to recover from loss of policy.
62 FLAVOR_ENROLLMENT_MANUAL_RENEW = 1;
63 // Device enrollment forced by local device configuration, such as OEM
64 // partition flags to force enrollment.
65 FLAVOR_ENROLLMENT_LOCAL_FORCED = 2;
66 // Enrollment advertised by local device configuration, such as OEM
67 // partition flags indicating to prompt for enrollment, but allowing the
69 FLAVOR_ENROLLMENT_LOCAL_ADVERTISED = 3;
70 // Device state downloaded from the server during OOBE indicates that
71 // (re-)enrollment is mandatory.
72 FLAVOR_ENROLLMENT_SERVER_FORCED = 4;
73 // Device state downloaded from the server during OOBE indicates that the
74 // device should prompt for (re-)enrollment, but the user is allowed to
76 FLAVOR_ENROLLMENT_SERVER_ADVERTISED = 5;
77 // Device detected in steady state that it is supposed to be enrolled, but
78 // the policy is missing.
79 FLAVOR_ENROLLMENT_RECOVERY = 6;
80 // User policy registration for a logged-in user.
81 FLAVOR_USER_REGISTRATION = 7;
84 // Indicates the registration flavor. This is passed to the server FYI when
85 // registering for policy so the server can distinguish registration triggers.
86 optional Flavor flavor = 8;
89 // Response from server to device register request.
90 message DeviceRegisterResponse {
91 // Device management token for this registration. This token MUST be
92 // part of HTTP Authorization header for all future requests from
94 required string device_management_token = 1;
96 // Device display name. By default, server generates the name in
97 // the format of "Machine Model - Machine Id". However, domain
98 // admin can update it using CPanel, so do NOT treat it as constant.
99 optional string machine_name = 2;
101 // Enum listing the possible modes the device should be locked into when the
102 // registration is finished.
104 // In ENTERPRISE mode the device has no local owner and device settings are
105 // controlled through the cloud policy infrastructure. Auto-enrollment is
106 // supported in that mode.
108 // Devices in RETAIL mode also have no local owner and get their device
109 // settings from the cloud, but additionally this mode enables the demo
110 // account on the device.
113 optional DeviceMode enrollment_type = 3 [default = ENTERPRISE];
116 // Request from device to server to unregister device.
117 // GoogleDMToken MUST be in HTTP Authorization header.
118 message DeviceUnregisterRequest {
121 // Response from server to device for unregister request.
122 message DeviceUnregisterResponse {
125 // Request from device to server to upload device EMCert
126 // (enterprise machine cert used for remote attestation).
127 // GoogleDMToken MUST be in HTTP Authorization header.
128 message DeviceCertUploadRequest {
129 // EMCert in X.509 format.
130 optional bytes device_certificate = 1;
133 // Response from server to device for cert upload request.
134 message DeviceCertUploadResponse {
137 // Request to access a Google service with the given scope.
138 message DeviceServiceApiAccessRequest {
139 // The list of auth scopes the device requests from DMServer.
140 repeated string auth_scope = 1;
142 // OAuth2 client ID to which the returned authorization code is bound.
143 optional string oauth2_client_id = 2;
146 message DeviceServiceApiAccessResponse {
147 // The OAuth2 authorization code for the requested scope(s).
148 // This can be exchanged for a refresh token.
149 optional string auth_code = 1;
152 message PolicyFetchRequest {
153 // This is the policy type, which maps to D3 policy type internally.
154 // By convention, we use "/" as separator to create policy namespace.
155 // The policy type names are case insensitive.
157 // Possible values for Chrome OS are:
158 // google/chromeos/device => ChromeDeviceSettingsProto
159 // google/chromeos/user => ChromeSettingsProto
160 // google/chromeos/publicaccount => ChromeSettingsProto
161 // google/chrome/extension => ExternalPolicyData
162 // google/android/user => ChromeSettingsProto
163 // google/ios/user => ChromeSettingsProto
164 optional string policy_type = 1;
166 // This is the last policy timestamp that client received from server.
167 optional int64 timestamp = 2;
169 // Tell server what kind of security signature is required.
174 optional SignatureType signature_type = 3 [default = NONE];
176 // The version number of the public key that is currently stored
177 // on the client. This should be the last number the server had
178 // supplied as new_public_key_version in PolicyData.
179 // This field is unspecified if the client does not yet have a
181 optional int32 public_key_version = 4;
183 // Machine hardware id, such as serial number.
184 // This field is should be set only if the serial number for the device is
185 // missing from the server, as indicated by the valid_serial_number_missing
186 // field in the last policy fetch response.
187 optional string machine_id = 5;
189 // This field is used for devices to send the additional ID to fetch settings.
190 // Retrieving some settings requires more than just device or user ID.
191 // For example, to retrieve public account, devices need to pass in
192 // public account ID in addition to device ID. To retrieve extension or
193 // plug-in settings, devices need to pass in extension/plug-in ID in
194 // addition to user ID.
195 // policy_type represents the type of settings (e.g. public account,
196 // extension) devices request to fetch.
197 optional string settings_entity_id = 6;
199 // If this fetch is due to a policy invalidation, this field contains the
200 // version provided with the invalidation. The server interprets this value
201 // and the value of invalidation_payload to fetch the up-to-date policy.
202 optional int64 invalidation_version = 7;
204 // If this fetch is due to a policy invalidation, this field contains the
205 // payload delivered with the invalidation. The server interprets this value
206 // and the value of invalidation_version to fetch the up-to-date policy.
207 optional bytes invalidation_payload = 8;
209 // Hash string for the chrome policy verification public key which is embedded
210 // into Chrome binary. Matching private key will be used by the server
211 // to sign per-domain policy keys during key rotation. If server does not
212 // have the key which matches this hash string, that could indicate malicious
213 // or out-of-date Chrome client.
214 optional string verification_key_hash = 9;
217 // This message customizes how the device behaves when it is disabled by its
218 // owner. The message will be sent as part of the DeviceState fetched during
219 // normal operation and as part of the DeviceStateRetrievalResponse fetched when
220 // the device is wiped/reinstalled.
221 message DisabledState {
222 // A message to the finder/thief that should be shown on the screen.
223 optional string message = 1;
226 message DeviceState {
227 // Modes of operation that the device can be in.
229 // The device is operating normally. Sessions can be started and the device
231 DEVICE_MODE_NORMAL = 0;
232 // The device has been disabled by its owner. The device will show a warning
233 // screen and will not allow any sessions to be started.
234 DEVICE_MODE_DISABLED = 1;
236 // The mode of operation that the device should be in.
237 optional DeviceMode device_mode = 1 [default = DEVICE_MODE_NORMAL];
239 // State that is relevant only when the |device_mode| is
240 // |DEVICE_MODE_DISABLED|.
241 optional DisabledState disabled_state = 2;
244 // This message is included in serialized form in PolicyFetchResponse
245 // below. It may also be signed, with the signature being created for
246 // the serialized form.
248 // See PolicyFetchRequest.policy_type.
249 optional string policy_type = 1;
251 // [timestamp] is milliseconds since Epoch in UTC timezone. It is
252 // included here so that the time at which the server issued this
253 // response cannot be faked (as protection against replay attacks).
254 // It is the timestamp generated by DMServer, NOT the time admin
255 // last updated the policy or anything like that.
256 optional int64 timestamp = 2;
258 // The DM token that was used by the client in the HTTP POST header
259 // for authenticating the request. It is included here again so that
260 // the client can verify that the response is meant for him (and not
261 // issued by a replay or man-in-the-middle attack).
262 optional string request_token = 3;
264 // The serialized value of the actual policy protobuf. This can be
265 // deserialized to an instance of, for example, ChromeSettingsProto,
266 // ChromeDeviceSettingsProto, or ExternalPolicyData.
267 optional bytes policy_value = 4;
269 // The device display name assigned by the server. It is only
270 // filled if the display name is available.
272 // The display name of the machine as generated by the server or set
273 // by the Administrator in the CPanel GUI. This is the same thing as
274 // |machine_name| in DeviceRegisterResponse but it might have
275 // changed since then.
276 optional string machine_name = 5;
278 // Version number of the server's current public key. (The key that
279 // was used to sign this response. Numbering should start at 1 and be
280 // increased by 1 at each key rotation.)
281 optional int32 public_key_version = 6;
283 // The user this policy is intended for. In case of device policy, the name
284 // of the owner (who registered the device).
285 optional string username = 7;
287 // In this field the DMServer should echo back the "deviceid" HTTP parameter
289 optional string device_id = 8;
291 // Indicates which state this association with DMServer is in. This can be
292 // used to tell the client that it is not receiving policy even though the
293 // registration with the server is kept active.
294 enum AssociationState {
295 // Association is active and policy is pushed.
297 // Association is alive, but the corresponding domain is not managed.
299 // Client got dropped on the server side.
302 optional AssociationState state = 9 [default = ACTIVE];
304 // Indicates if the the server cannot find a valid serial number for the
305 // device. If this flag is set, the device should send the valid serial
306 // number with a device policy fetch request. Note that this only
307 // applies to device policy.
308 optional bool valid_serial_number_missing = 10;
310 // Indicates which public account or extension/plug-in this policy data is
311 // for. See PolicyFetchRequest.settings_entity_id for more details.
312 optional string settings_entity_id = 11;
314 // Indicates the identity the device service account is associated with.
315 // This is only sent as part of device policy fetch.
316 optional string service_account_identity = 12;
318 // The object source which hosts policy objects within the invalidation
319 // service. This value is combined with invalidation_name to form the object
320 // id used to register for invalidations to this policy.
321 optional int32 invalidation_source = 13;
323 // The name which uniquely identifies this policy within the invalidation
324 // service object source. This value is combined with invalidation_source to
325 // form the object id used to register for invalidations to this policy.
326 optional bytes invalidation_name = 14;
328 // Server-provided identifier of the fetched policy. This is to be used
329 // by the client when requesting Policy Posture assertion through an API
330 // call or SAML flow.
331 optional string policy_token = 15;
333 // Indicates the management mode of the device. Note that old policies do not
334 // have this field. If this field is not set but request_token is set, assume
335 // the management mode is ENTERPRISE_MANAGED. If both this field and
336 // request_token are not set, assume the management mode is LOCAL_OWNER.
337 enum ManagementMode {
338 // The device is owned locally. The policies are set by the local owner of
341 // The device is enterprise-managed. The policies come from the enterprise
342 // server. See the comment above for backward compatibility.
343 ENTERPRISE_MANAGED = 1;
344 // The device is consumer-managed. The policies currently can only be set
345 // by the local owner of the device.
346 CONSUMER_MANAGED = 2;
348 optional ManagementMode management_mode = 16;
350 // Indicates the state that the device should be in.
351 optional DeviceState device_state = 17;
353 // The object source which hosts command queue objects within the
354 // invalidation service. This value is combined with
355 // command_invalidation_name to form the object ID used to
356 // register for invalidations to the command queue.
357 optional int32 command_invalidation_source = 18;
359 // The name which uniquely identifies this device’s queue within
360 // the invalidation service object source. This value is combined
361 // with command_invalidation_source to form the object ID used to
362 // register for invalidations to the command queue.
363 optional bytes command_invalidation_name = 19;
365 // The free-text location info the admin enters to associate the device
367 optional string annotated_location = 20;
369 // The free-text asset identifier the admin enters to associate the device
370 // with a user-generated identifier.
371 optional string annotated_asset_id = 21;
373 // The unique directory api ID of the device which was generated on the
375 optional string directory_api_id = 22;
378 message PolicyFetchResponse {
379 // Since a single policy request may ask for multiple policies, we
380 // provide separate error code for each individual policy fetch.
382 // We will use standard HTTP Status Code as error code.
383 optional int32 error_code = 1;
385 // Human readable error message for customer support purpose.
386 optional string error_message = 2;
388 // This is a serialized |PolicyData| protobuf (defined above).
389 optional bytes policy_data = 3;
391 // Signature of the policy data above.
392 optional bytes policy_data_signature = 4;
394 // If the public key has been rotated on the server, the new public
395 // key is sent here. It is already used for |policy_data_signature|
396 // above, whereas |new_public_key_signature| is created using the
397 // old key (so the client can trust the new key). If this is the
398 // first time when the client requests policies (so it doesn't have
399 // on old public key), then |new_public_key_signature| is empty.
400 optional bytes new_public_key = 5;
401 optional bytes new_public_key_signature = 6;
403 // If new_public_key is specified, this field contains a signature
404 // of a PolicyPublicKeyAndDomain protobuf, signed using a key only
405 // available to DMServer. The public key portion of this well-known key is
406 // embedded into the Chrome binary. The hash of that embedded key is passed
407 // to DMServer as verification_key_hash field in PolicyFetchRequest. DMServer
408 // will pick a private key on the server which matches the hash (matches
409 // public key on the client). If DMServer is unable to find matching key, it
410 // will return an error instead of policy data.
411 // In case hash was not specified, DMServer will leave verification signature
412 // field empty (legacy behavior).
413 // In addition to the checks between new_public_key
414 // and new_public_key_signature described above, Chrome also verifies
415 // new_public_key with the embedded public key and
416 // new_public_key_verification_signature.
417 optional bytes new_public_key_verification_signature = 7;
420 // Protobuf used to generate the new_public_key_verification_signature field.
421 message PolicyPublicKeyAndDomain {
422 // The public key to sign (taken from the |new_public_key| field in
423 // PolicyFetchResponse).
424 optional bytes new_public_key = 1;
426 // The domain associated with this key (should match the domain portion of
427 // the username field of the policy).
428 optional string domain = 2;
431 // This protobuf defines a single remote command from server to client for
433 message RemoteCommand {
435 // Simple echo command for testing, will be ignored in production code.
436 COMMAND_ECHO_TEST = -1;
438 // Reboot the device.
441 // Take a screenshot.
442 DEVICE_SCREENSHOT = 1;
446 optional Type type = 1;
448 // An opaque unique identifier for the command.
449 optional int64 unique_id = 2;
451 // The age of the command (in milliseconds) when it is sent from server to
452 // client, defined as current_server_time - command_generated_time.
453 optional int64 age_of_command = 3;
455 // Extra parameters for this command, expected to be a JSON string.
456 optional string payload = 4;
459 // This protobuf defines the execution result of a single remote command
460 // which will be sent back to the server.
461 message RemoteCommandResult {
463 RESULT_IGNORED = 0; // The command was ignored as obsolete.
464 RESULT_FAILURE = 1; // The command could not be executed.
465 RESULT_SUCCESS = 2; // The command was successfully executed.
468 // The result of the command.
469 optional ResultType result = 1;
471 // The opaque unique identifier of the command. This value is copied from the
472 // RemoteCommand protobuf that contained the command.
473 optional int64 unique_id = 2;
475 // The time at which the command was executed, if the the result is
477 optional int64 timestamp = 3;
479 // Extra information sent to server as result of execution, expected to be a
481 optional string payload = 4;
484 message DeviceRemoteCommandRequest {
485 // The command ID of the last command received from the server until
486 // now. Omitted if no commands have been received yet.
487 optional int64 last_command_unique_id = 1;
489 // The execution results of previously fetched commands.
490 // The client should send back a command result whenever possible.
491 repeated RemoteCommandResult command_results = 2;
494 message DeviceRemoteCommandResponse {
495 // The queue of pending commands.
496 repeated RemoteCommand commands = 1;
499 // Request from device to server for reading policies.
500 message DevicePolicyRequest {
501 // The policy fetch request. If this field exists, the request must
502 // comes from a non-TT client. The repeated field allows client to
503 // request multiple policies for better performance.
504 repeated PolicyFetchRequest request = 3;
507 // Response from server to device for reading policies.
508 message DevicePolicyResponse {
509 // The policy fetch response.
510 repeated PolicyFetchResponse response = 3;
514 // [timestamp] is milli seconds since Epoch in UTC timezone.
515 optional int64 start_timestamp = 1;
516 optional int64 end_timestamp = 2;
519 message ActiveTimePeriod {
520 optional TimePeriod time_period = 1;
522 // The active duration during the above time period.
523 // The unit is milli-second.
524 optional int32 active_duration = 2;
527 // This captures launch events for one app/extension or other installments.
528 message InstallableLaunch {
529 optional string install_id = 1;
531 // Time duration where this report covers. These are required
532 // and the record will be ignored if not set.
533 optional TimePeriod duration = 2;
535 // Client will send at most 50 timestamps to DM. All the rest
536 // launch activities will be summed into the total count.
537 // We will distribute the count evenly among the time span when
538 // doing time based aggregation.
539 repeated int64 timestamp = 3;
540 optional int64 total_count = 4;
543 // Used to report the device location.
544 message DeviceLocation {
547 ERROR_CODE_POSITION_UNAVAILABLE = 1;
550 // Latitude in decimal degrees north (WGS84 coordinate frame).
551 optional double latitude = 1;
553 // Longitude in decimal degrees west (WGS84 coordinate frame).
554 optional double longitude = 2;
556 // Altitude in meters (above WGS84 datum).
557 optional double altitude = 3;
559 // Accuracy of horizontal position in meters.
560 optional double accuracy = 4;
562 // Accuracy of altitude in meters.
563 optional double altitude_accuracy = 5;
565 // Heading in decimal degrees clockwise from true north.
566 optional double heading = 6;
568 // Horizontal component of device velocity in meters per second.
569 optional double speed = 7;
571 // Time of position measurement in milisecons since Epoch in UTC time.
572 optional int64 timestamp = 8;
574 // Error code, see enum above.
575 optional ErrorCode error_code = 9;
577 // Human-readable error message.
578 optional string error_message = 10;
581 // Details about a network interface.
582 message NetworkInterface {
583 // Indicates the type of network device.
584 enum NetworkDeviceType {
592 // Network device type.
593 optional NetworkDeviceType type = 1;
595 // MAC address (if applicable) of the corresponding network device. This is
596 // formatted as an ASCII string with 12 hex digits. Example: A0B1C2D3E4F5.
597 optional string mac_address = 2;
599 // MEID (if applicable) of the corresponding network device. Formatted as
600 // ASCII string composed of 14 hex digits. Example: A10000009296F2.
601 optional string meid = 3;
603 // IMEI (if applicable) of the corresponding network device. 15-16 decimal
604 // digits encoded as ASCII string. Example: 355402040158759.
605 optional string imei = 4;
607 // The device path associated with this network interface.
608 optional string device_path = 5;
612 // Information about configured/visible networks - this is separate from
613 // NetworkInterface because a configured network may not be associated with
614 // any specific interface, or may be visible across multiple interfaces.
615 message NetworkState {
616 // The current state of this network.
617 enum ConnectionState {
628 ACTIVATION_FAILURE = 10;
632 // For networks associated with a device, the path of the device.
633 optional string device_path = 1;
635 // Current state of this connection as reported by shill.
636 optional ConnectionState connection_state = 2;
638 // For wireless networks, the signal_strength in dBm.
639 optional int32 signal_strength = 3;
641 // The IP address this interface is bound to, if any.
642 optional string ip_address = 4;
644 // The gateway IP for this interface, if any.
645 optional string gateway = 5;
648 // Details about a device user.
650 // Types of device users which can be reported.
652 // A user managed by the same domain as the device.
653 USER_TYPE_MANAGED = 0;
655 // A user not managed by the same domain as the device.
656 USER_TYPE_UNMANAGED = 1;
659 // The type of the user.
660 required UserType type = 1;
662 // Email address of the user. Present only if the user type is managed.
663 optional string email = 2;
666 // Information about a single disk volume.
668 optional string volume_id = 1;
669 optional int64 storage_total = 2;
670 optional int64 storage_free = 3;
673 // Report device level status.
674 message DeviceStatusReportRequest {
675 // The OS version reported by the device is a platform version
676 // e.g. 1435.0.2011_12_16_1635.
677 optional string os_version = 1;
678 optional string firmware_version = 2;
680 // "Verified", "Dev". Same as verified mode.
681 // If the mode is unknown, this field should not be set.
682 optional string boot_mode = 3;
684 // Device active times collection since last report rpc call.
685 // No longer used -- use active_period instead.
686 repeated TimePeriod active_time = 4 [deprecated = true];
688 // The browser version string as shown in the About dialog.
690 optional string browser_version = 5;
692 // A list of periods when the device was active, aggregated by day.
693 repeated ActiveTimePeriod active_period = 6;
695 // The device location.
696 optional DeviceLocation device_location = 7;
698 // List of network interfaces.
699 repeated NetworkInterface network_interface = 8;
701 // List of recent device users, in descending order by last login time.
702 repeated DeviceUser user = 9;
704 // Disk space + other info about mounted/connected volumes.
705 repeated VolumeInfo volume_info = 10;
707 // List of visible/configured networks
708 repeated NetworkState network_state = 11;
710 // Samples of CPU utilization (0-100), sampled once every 120 seconds.
711 repeated int32 cpu_utilization_pct = 12;
713 // Free RAM (unreliable due to GC).
714 optional int64 deprecated_system_ram_free = 13 [deprecated = true];
716 // Total RAM on the device.
717 optional int64 system_ram_total = 14;
719 // Samples of free RAM [in bytes] (unreliable due to GC).
720 repeated int64 system_ram_free = 15;
723 // Provides status information for an installed app/extension.
725 // ID of the installed app/extension
726 optional string app_id = 1;
728 // Currently installed version of the app.
729 optional string extension_version = 2;
731 // Self-reported status summary (via chrome.reporting APIs)
732 optional string status = 3;
734 // If true, the application is currently in a self-reported error state.
735 optional bool error = 4;
738 // Report session (a user on one device) level status.
739 message SessionStatusReportRequest {
740 // Installed apps for this user on this device.
741 // No longer used -- use installed_apps instead.
742 repeated string installed_app_id = 1 [deprecated = true];
744 // Installed extensions for this user on this device.
745 // No longer used -- use installed_extensions instead.
746 repeated string installed_extension_id = 2 [deprecated = true];
748 // One stat per app for top 30 apps.
749 repeated InstallableLaunch app_launch_stat = 3;
751 // If this is a kiosk session, this is the device local account ID.
752 optional string device_local_account_id = 4;
754 // Information about installed apps for this user on this device.
755 repeated AppStatus installed_apps = 5;
757 // Information about installed extensions for this user on this device.
758 repeated AppStatus installed_extensions = 6;
761 // Response from DMServer to update devices' status.
762 // It is possible that status report fails but policy request succeed. In such
763 // case, the DeviceStatusReportResponse will contain an error code and the
764 // device should re-send status report data in the next policy request. The
765 // device should re-send report data if policy request fails, even if
766 // DeviceStatusReportResponse contains no error code.
767 message DeviceStatusReportResponse {
768 optional int32 error_code = 1;
770 // Human readable error message for customer support purpose.
771 optional string error_message = 2;
774 // Response from DMServer to update user devices' status.
775 // It is possible that status report fails but policy request succeed. In such
776 // case, the SessionStatusReportResponse will contain an error code and the
777 // device should re-send status report data in the next policy request. The
778 // device should re-send report data if policy request fails, even if
779 // SessionStatusReportResponse contains no error code.
780 message SessionStatusReportResponse {
781 optional int32 error_code = 1;
783 // Human readable error message for customer support purpose.
784 optional string error_message = 2;
787 // Request from device to server to determine whether the device should
788 // go through enterprise enrollment. Unlike the other requests, this request is
789 // not authenticated.
790 message DeviceAutoEnrollmentRequest {
791 // SHA-256 hash of the device's serial number, mod |modulus|.
792 // Should always be present.
793 optional int64 remainder = 1;
795 // Modulus of the hash used by the client. Should always be present. This
796 // is the number of buckets the client thinks the server has. For now,
797 // it is a power of 2, but due to the strict constraint on how many serial
798 // numbers a bucket can contain, it may become non power of 2. If that
799 // happens, client-side needs to change its assumption.
800 optional int64 modulus = 2;
803 // Response from server to auto-enrollment detection request.
804 message DeviceAutoEnrollmentResponse {
805 // If this field is present, the other fields are ignored and the client
806 // should send a new DeviceAutoEnrollmentRequest with a new |remainder|
807 // computed using this new |modulus|. If this field is empty, the client's
808 // request was accepted.
809 // DMServer guarantees that if the modulus sent by client in
810 // DeviceAutoEnrollmentRequest matches server's expectation, this field
812 optional int64 expected_modulus = 1;
814 // List of hashes in the client's hash bucket. If the client's hash matches
815 // any in this list, the client device should do enterprise enrollment.
816 // If it matches none, enrollment should be optional.
817 // Each entry has exactly 256 bits (32 bytes).
818 repeated bytes hash = 2;
821 // Sent by the client to the server. The device management server keeps a
822 // mapping of device identifiers to device state. Devices query this table after
823 // hard reset in order recover state. This request is keyed just by the opaque
824 // server-backed state key; there is no further authentication.
825 message DeviceStateRetrievalRequest {
826 // Opaque, client-determined, unpredictable, stable and unique device
827 // identifier to retrieve state for. This field contains 32 bytes of data that
828 // looks essentially random to the server. It may be generated e.g. by running
829 // a concatenation of suitable device identifiers through a cryptographic hash
830 // algorithm such as SHA-256.
831 optional bytes server_backed_state_key = 1;
834 // Sent by the client to the server when in registered state to update the
835 // device-determined device state keys.
836 message DeviceStateKeyUpdateRequest {
837 // The client-determined state keys. To the server, these look like 32 bytes
838 // of random data. The client should generate these keys using a deterministic
839 // algorithm that takes stable device identifiers as an input and produces a
840 // key as the output, possibly by running the identifiers through a
841 // cryptographic hash function such as SHA-256.
842 repeated bytes server_backed_state_key = 1;
845 // Server to client message carrying the device state response. Because the
846 // request is not authenticated, the only protection against state extraction
847 // from server is the unpredictability of the server-backed state ID. Thus, the
848 // response should not contain any sensitive data. If the server doesn't know
849 // the requested identifier, it just return a message with restore_mode set to
850 // RESTORE_MODE_NONE.
851 message DeviceStateRetrievalResponse {
852 // Restorative action to take after device reset.
854 // No state restoration.
855 RESTORE_MODE_NONE = 0;
856 // Enterprise enrollment requested, but user may skip.
857 RESTORE_MODE_REENROLLMENT_REQUESTED = 1;
858 // Enterprise enrollment is enforced and cannot be skipped.
859 RESTORE_MODE_REENROLLMENT_ENFORCED = 2;
860 // The device has been disabled by its owner. The device will show a warning
861 // screen and prevent the user from proceeding further.
862 RESTORE_MODE_DISABLED = 3;
864 // The server-indicated restore mode.
865 optional RestoreMode restore_mode = 1 [default = RESTORE_MODE_NONE];
867 // Primary domain the device is associated with.
868 optional string management_domain = 2;
870 // State that is relevant only when the |restore_mode| is
871 // |RESTORE_MODE_DISABLED|.
872 optional DisabledState disabled_state = 3;
875 // Sent by the client to the server to pair the Host device with the Controller
876 // device. The HTTP request contains an end-user OAuth token and only succeeds
877 // if both Host and Controller devices belong to the end-user domain.
878 message DevicePairingRequest {
880 // The device ID of the Host device.
881 optional string host_device_id = 1;
883 // The device ID of the Controller device.
884 optional string controller_device_id = 2;
887 // Response from the server to the device pairing request.
888 message DevicePairingResponse {
890 // The client should check HTTP status code first. If HTTP status code is not
891 // 200 (e.g. 500 internal error), then it means the pairing fails. If HTTP
892 // status code is 200, then the client should check the status code within the
897 // A generic failure code for pairing.
900 // The Host device cannot be found in the user's domain.
901 HOST_DEVICE_NOT_FOUND = 2;
903 // The Controller device cannot be found in the user's domain.
904 CONTROLLER_DEVICE_NOT_FOUND = 3;
906 // The Host device is deprovisioned.
907 HOST_DEVICE_DEPROVISIONED = 4;
909 // The Controller device is deprovisioned.
910 CONTROLLER_DEVICE_DEPROVISIONED = 5;
913 optional StatusCode status_code = 1 [default = FAILED];
916 // Sent by the client to the server to check if the devices are paired. The HTTP
917 // request contains controller service account OAuth token as well as the
918 // DMToken from the Host device.
919 message CheckDevicePairingRequest {
921 // The device ID of the Host device.
922 optional string host_device_id = 1;
924 // The device ID of the Controller device.
925 optional string controller_device_id = 2;
928 // Response from the server to the check device pairing request.
929 message CheckDevicePairingResponse {
931 // The client should check HTTP status code first. If HTTP status code is not
932 // 200 (e.g. 500 internal error), then it means the pairing status is unknown.
933 // If HTTP status code is 200, then the client should check the status code
934 // within the response.
938 // The Host and Controller devices are not paired.
941 // The Host device cannot be found in the Host device domain.
942 HOST_DEVICE_NOT_FOUND = 2;
944 // The Controller device cannot be found in the Host device domain.
945 CONTROLLER_DEVICE_NOT_FOUND = 3;
947 // The Host device is deprovisioned.
948 HOST_DEVICE_DEPROVISIONED = 4;
950 // The Controller device is deprovisioned.
951 CONTROLLER_DEVICE_DEPROVISIONED = 5;
953 // Invalid controller identity.
954 INVALID_CONTROLLER_DEVICE_IDENTITY = 6;
957 optional StatusCode status_code = 1 [default = NOT_PAIRED];
960 // Sent by the client to the server to check if the current user is allowed
961 // to update attributes (asset id and location). The HTTP request contains an
962 // end-user OAuth token.
963 message DeviceAttributeUpdatePermissionRequest {
966 // Response from the server specifying whether the current user is allowed to
967 // update attributes (asset id and location).
968 message DeviceAttributeUpdatePermissionResponse {
970 ATTRIBUTE_UPDATE_DISALLOWED = 0;
971 ATTRIBUTE_UPDATE_ALLOWED = 1;
974 optional ResultType result = 1;
977 // Sent by the client to the server to update device attributes (asset id and
978 // location). The HTTP request contains an end-user OAuth token.
979 message DeviceAttributeUpdateRequest {
980 // The user-generated asset identifier.
981 optional string asset_id = 1;
983 // The user input device location.
984 optional string location = 2;
987 // Response from the server to update device attributes (asset id and location).
988 message DeviceAttributeUpdateResponse {
990 ATTRIBUTE_UPDATE_ERROR = 0;
991 ATTRIBUTE_UPDATE_SUCCESS = 1;
994 optional ResultType result = 1;
997 // Request from the DMAgent on the device to the DMServer. This is
998 // container for all requests from device to server. The overall HTTP
999 // request MUST be in the following format:
1001 // * HTTP method is POST
1002 // * Data mime type is application/x-protobuffer
1003 // * HTTP parameters are (all required, all case sensitive):
1004 // * request: MUST BE one of
1005 // * api_authorization
1007 // * check_device_pairing
1009 // * device_state_retrieval
1010 // * enterprise_check
1016 // * remote_commands
1017 // * attribute_update_permission
1018 // * attribute_update
1020 // * devicetype: MUST BE "1" for Android or "2" for Chrome OS.
1021 // * apptype: MUST BE Android or Chrome.
1022 // * deviceid: MUST BE no more than 64-char in [\x21-\x7E].
1023 // * agent: MUST BE a string of characters.
1024 // * HTTP Authorization header MUST be in the following formats:
1025 // * For register and ping requests
1026 // Authorization: GoogleLogin auth=<auth cookie for Mobile Sync>
1028 // * For unregister, policy, status, cert_upload and remote commands requests
1029 // Authorization: GoogleDMToken token=<dm token from register>
1031 // * The Authorization header isn't used for enterprise_check
1032 // request, nor for register requests using OAuth. In the latter case,
1033 // the OAuth token is passed in the "oauth" parameter.
1035 // DeviceManagementRequest should only contain one request which matches the
1036 // HTTP query parameter - request, as listed below. Other requests within the
1037 // container will be ignored.
1038 // cert_upload: cert_upload_request
1039 // check_device_pairing: check_device_pairing_request
1040 // device_pairing: device_pairing_request
1041 // device_state_retrieval: device_state_retrieval_request
1042 // enterprise_check: auto_enrollment_request
1043 // ping: policy_request
1044 // policy: policy_request
1045 // register: register_request
1046 // status: device_status_report_request or session_status_report_request
1047 // unregister: unregister_request
1048 // remote_commands: remote_command_request
1049 // attribute_update_permission: device_attribute_update_permission_request
1050 // attribute_update: device_attribute_update_request
1052 message DeviceManagementRequest {
1053 // Register request.
1054 optional DeviceRegisterRequest register_request = 1;
1056 // Unregister request.
1057 optional DeviceUnregisterRequest unregister_request = 2;
1060 optional DevicePolicyRequest policy_request = 3;
1063 optional DeviceStatusReportRequest device_status_report_request = 4;
1064 optional SessionStatusReportRequest session_status_report_request = 5;
1066 // Auto-enrollment detection.
1067 optional DeviceAutoEnrollmentRequest auto_enrollment_request = 6;
1069 // EMCert upload (for remote attestation)
1070 optional DeviceCertUploadRequest cert_upload_request = 7;
1072 // Request for OAuth2 authorization codes to access Google services.
1073 optional DeviceServiceApiAccessRequest service_api_access_request = 8;
1075 // Device-state retrieval.
1076 optional DeviceStateRetrievalRequest device_state_retrieval_request = 9;
1078 // Device state key update.
1079 optional DeviceStateKeyUpdateRequest device_state_key_update_request = 10;
1081 // Pair two devices.
1082 optional DevicePairingRequest device_pairing_request = 11;
1084 // Check if two devices are paired.
1085 optional CheckDevicePairingRequest check_device_pairing_request = 12;
1087 // Remote command fetching.
1088 optional DeviceRemoteCommandRequest remote_command_request = 13;
1090 // Check permission for updating device attribute.
1091 optional DeviceAttributeUpdatePermissionRequest
1092 device_attribute_update_permission_request = 14;
1094 // Update device attribute.
1095 optional DeviceAttributeUpdateRequest device_attribute_update_request
1099 // Response from server to device.
1101 // The server uses the following numbers as HTTP status codes
1102 // to report top-level errors.
1104 // 200 OK: valid response is returned to client.
1105 // 400 Bad Request: invalid argument.
1106 // 401 Unauthorized: invalid auth cookie or DM token.
1107 // 403 Forbidden: device management is not allowed.
1108 // 404 Not Found: the request URL is invalid.
1109 // 410 Device Not Found: the device id is not found.
1110 // 491 Request Pending: the request is pending approval.
1111 // 500 Internal Server Error: most likely a bug in DM server.
1112 // 503 Service Unavailable: most likely a backend error.
1113 // 901 Device Not Found: the device id is not found.
1114 // 902 Policy Not Found: the policy is not found.
1115 message DeviceManagementResponse {
1117 optional string error_message = 2;
1119 // Register response
1120 optional DeviceRegisterResponse register_response = 3;
1122 // Unregister response
1123 optional DeviceUnregisterResponse unregister_response = 4;
1126 optional DevicePolicyResponse policy_response = 5;
1128 // Device status report response.
1129 optional DeviceStatusReportResponse device_status_report_response = 6;
1131 // Session status report response.
1132 optional SessionStatusReportResponse session_status_report_response = 7;
1134 // Auto-enrollment detection response.
1135 optional DeviceAutoEnrollmentResponse auto_enrollment_response = 8;
1137 // EMCert upload response.
1138 optional DeviceCertUploadResponse cert_upload_response = 9;
1140 // Response to OAuth2 authorization code request.
1141 optional DeviceServiceApiAccessResponse service_api_access_response = 10;
1143 // Device-state retrieval.
1144 optional DeviceStateRetrievalResponse device_state_retrieval_response = 11;
1146 // Response to device pairing request.
1147 optional DevicePairingResponse device_pairing_response = 12;
1149 // Response to check device pairing request.
1150 optional CheckDevicePairingResponse check_device_pairing_response = 13;
1152 // Response to remote command request.
1153 optional DeviceRemoteCommandResponse remote_command_response = 14;
1155 // Response to check device attribute update permission.
1156 optional DeviceAttributeUpdatePermissionResponse
1157 device_attribute_update_permission_response = 15;
1159 // Response to update device attribute.
1160 optional DeviceAttributeUpdateResponse device_attribute_update_response = 16;