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.
150 // The server may send a successful response but not set this field or set an
151 // empty string to reject the auth code request and instruct the client to
152 // skip robot account auth setup.
153 optional string auth_code = 1;
156 message PolicyFetchRequest {
157 // This is the policy type, which maps to D3 policy type internally.
158 // By convention, we use "/" as separator to create policy namespace.
159 // The policy type names are case insensitive.
161 // Possible values for Chrome OS are:
162 // google/chromeos/device => ChromeDeviceSettingsProto
163 // google/chromeos/user => ChromeSettingsProto
164 // google/chromeos/publicaccount => ChromeSettingsProto
165 // google/chrome/extension => ExternalPolicyData
166 // google/android/user => ChromeSettingsProto
167 // google/ios/user => ChromeSettingsProto
168 optional string policy_type = 1;
170 // This is the last policy timestamp that client received from server.
171 optional int64 timestamp = 2;
173 // Tell server what kind of security signature is required.
178 optional SignatureType signature_type = 3 [default = NONE];
180 // The version number of the public key that is currently stored
181 // on the client. This should be the last number the server had
182 // supplied as new_public_key_version in PolicyData.
183 // This field is unspecified if the client does not yet have a
185 optional int32 public_key_version = 4;
187 // Machine hardware id, such as serial number.
188 // This field is should be set only if the serial number for the device is
189 // missing from the server, as indicated by the valid_serial_number_missing
190 // field in the last policy fetch response.
191 optional string machine_id = 5;
193 // This field is used for devices to send the additional ID to fetch settings.
194 // Retrieving some settings requires more than just device or user ID.
195 // For example, to retrieve public account, devices need to pass in
196 // public account ID in addition to device ID. To retrieve extension or
197 // plug-in settings, devices need to pass in extension/plug-in ID in
198 // addition to user ID.
199 // policy_type represents the type of settings (e.g. public account,
200 // extension) devices request to fetch.
201 optional string settings_entity_id = 6;
203 // If this fetch is due to a policy invalidation, this field contains the
204 // version provided with the invalidation. The server interprets this value
205 // and the value of invalidation_payload to fetch the up-to-date policy.
206 optional int64 invalidation_version = 7;
208 // If this fetch is due to a policy invalidation, this field contains the
209 // payload delivered with the invalidation. The server interprets this value
210 // and the value of invalidation_version to fetch the up-to-date policy.
211 optional bytes invalidation_payload = 8;
213 // Hash string for the chrome policy verification public key which is embedded
214 // into Chrome binary. Matching private key will be used by the server
215 // to sign per-domain policy keys during key rotation. If server does not
216 // have the key which matches this hash string, that could indicate malicious
217 // or out-of-date Chrome client.
218 optional string verification_key_hash = 9;
221 // This message customizes how the device behaves when it is disabled by its
222 // owner. The message will be sent as part of the DeviceState fetched during
223 // normal operation and as part of the DeviceStateRetrievalResponse fetched when
224 // the device is wiped/reinstalled.
225 message DisabledState {
226 // A message to the finder/thief that should be shown on the screen.
227 optional string message = 1;
230 message DeviceState {
231 // Modes of operation that the device can be in.
233 // The device is operating normally. Sessions can be started and the device
235 DEVICE_MODE_NORMAL = 0;
236 // The device has been disabled by its owner. The device will show a warning
237 // screen and will not allow any sessions to be started.
238 DEVICE_MODE_DISABLED = 1;
240 // The mode of operation that the device should be in.
241 optional DeviceMode device_mode = 1 [default = DEVICE_MODE_NORMAL];
243 // State that is relevant only when the |device_mode| is
244 // |DEVICE_MODE_DISABLED|.
245 optional DisabledState disabled_state = 2;
248 // This message is included in serialized form in PolicyFetchResponse
249 // below. It may also be signed, with the signature being created for
250 // the serialized form.
252 // See PolicyFetchRequest.policy_type.
253 optional string policy_type = 1;
255 // [timestamp] is milliseconds since Epoch in UTC timezone. It is
256 // included here so that the time at which the server issued this
257 // response cannot be faked (as protection against replay attacks).
258 // It is the timestamp generated by DMServer, NOT the time admin
259 // last updated the policy or anything like that.
260 optional int64 timestamp = 2;
262 // The DM token that was used by the client in the HTTP POST header
263 // for authenticating the request. It is included here again so that
264 // the client can verify that the response is meant for him (and not
265 // issued by a replay or man-in-the-middle attack).
266 optional string request_token = 3;
268 // The serialized value of the actual policy protobuf. This can be
269 // deserialized to an instance of, for example, ChromeSettingsProto,
270 // ChromeDeviceSettingsProto, or ExternalPolicyData.
271 optional bytes policy_value = 4;
273 // The device display name assigned by the server. It is only
274 // filled if the display name is available.
276 // The display name of the machine as generated by the server or set
277 // by the Administrator in the CPanel GUI. This is the same thing as
278 // |machine_name| in DeviceRegisterResponse but it might have
279 // changed since then.
280 optional string machine_name = 5;
282 // Version number of the server's current public key. (The key that
283 // was used to sign this response. Numbering should start at 1 and be
284 // increased by 1 at each key rotation.)
285 optional int32 public_key_version = 6;
287 // The user this policy is intended for. In case of device policy, the name
288 // of the owner (who registered the device).
289 optional string username = 7;
291 // In this field the DMServer should echo back the "deviceid" HTTP parameter
293 optional string device_id = 8;
295 // Indicates which state this association with DMServer is in. This can be
296 // used to tell the client that it is not receiving policy even though the
297 // registration with the server is kept active.
298 enum AssociationState {
299 // Association is active and policy is pushed.
301 // Association is alive, but the corresponding domain is not managed.
303 // Client got dropped on the server side.
306 optional AssociationState state = 9 [default = ACTIVE];
308 // Indicates if the the server cannot find a valid serial number for the
309 // device. If this flag is set, the device should send the valid serial
310 // number with a device policy fetch request. Note that this only
311 // applies to device policy.
312 optional bool valid_serial_number_missing = 10;
314 // Indicates which public account or extension/plug-in this policy data is
315 // for. See PolicyFetchRequest.settings_entity_id for more details.
316 optional string settings_entity_id = 11;
318 // Indicates the identity the device service account is associated with.
319 // This is only sent as part of device policy fetch.
320 optional string service_account_identity = 12;
322 // The object source which hosts policy objects within the invalidation
323 // service. This value is combined with invalidation_name to form the object
324 // id used to register for invalidations to this policy.
325 optional int32 invalidation_source = 13;
327 // The name which uniquely identifies this policy within the invalidation
328 // service object source. This value is combined with invalidation_source to
329 // form the object id used to register for invalidations to this policy.
330 optional bytes invalidation_name = 14;
332 // Server-provided identifier of the fetched policy. This is to be used
333 // by the client when requesting Policy Posture assertion through an API
334 // call or SAML flow.
335 optional string policy_token = 15;
337 // Indicates the management mode of the device. Note that old policies do not
338 // have this field. If this field is not set but request_token is set, assume
339 // the management mode is ENTERPRISE_MANAGED. If both this field and
340 // request_token are not set, assume the management mode is LOCAL_OWNER.
341 enum ManagementMode {
342 // The device is owned locally. The policies are set by the local owner of
345 // The device is enterprise-managed. The policies come from the enterprise
346 // server. See the comment above for backward compatibility.
347 ENTERPRISE_MANAGED = 1;
348 // The device is consumer-managed. The policies currently can only be set
349 // by the local owner of the device.
350 CONSUMER_MANAGED = 2;
352 optional ManagementMode management_mode = 16;
354 // Indicates the state that the device should be in.
355 optional DeviceState device_state = 17;
357 // The object source which hosts command queue objects within the
358 // invalidation service. This value is combined with
359 // command_invalidation_name to form the object ID used to
360 // register for invalidations to the command queue.
361 optional int32 command_invalidation_source = 18;
363 // The name which uniquely identifies this device’s queue within
364 // the invalidation service object source. This value is combined
365 // with command_invalidation_source to form the object ID used to
366 // register for invalidations to the command queue.
367 optional bytes command_invalidation_name = 19;
369 // The free-text location info the admin enters to associate the device
371 optional string annotated_location = 20;
373 // The free-text asset identifier the admin enters to associate the device
374 // with a user-generated identifier.
375 optional string annotated_asset_id = 21;
377 // The unique directory api ID of the device which was generated on the
379 optional string directory_api_id = 22;
381 // List of device affiliation IDs. If exists overlap between user
382 // affiliation IDs and device affiliation IDs, we consider that the user is
383 // affiliated on the device. Otherwise the user is not affiliated on the
384 // device. Should be fetched with device policy. Ignored if fetched with
386 repeated string device_affiliation_ids = 23;
388 // List of user affiliation IDs. The list is used to define if current user
389 // is affiliated on the device. See device_affiliation_ids for details.
390 // Should be fetched with user policy. Ignored if fetched with other polices.
391 repeated string user_affiliation_ids = 24;
394 message PolicyFetchResponse {
395 // Since a single policy request may ask for multiple policies, we
396 // provide separate error code for each individual policy fetch.
398 // We will use standard HTTP Status Code as error code.
399 optional int32 error_code = 1;
401 // Human readable error message for customer support purpose.
402 optional string error_message = 2;
404 // This is a serialized |PolicyData| protobuf (defined above).
405 optional bytes policy_data = 3;
407 // Signature of the policy data above.
408 optional bytes policy_data_signature = 4;
410 // If the public key has been rotated on the server, the new public
411 // key is sent here. It is already used for |policy_data_signature|
412 // above, whereas |new_public_key_signature| is created using the
413 // old key (so the client can trust the new key). If this is the
414 // first time when the client requests policies (so it doesn't have
415 // on old public key), then |new_public_key_signature| is empty.
416 optional bytes new_public_key = 5;
417 optional bytes new_public_key_signature = 6;
419 // If new_public_key is specified, this field contains a signature
420 // of a PolicyPublicKeyAndDomain protobuf, signed using a key only
421 // available to DMServer. The public key portion of this well-known key is
422 // embedded into the Chrome binary. The hash of that embedded key is passed
423 // to DMServer as verification_key_hash field in PolicyFetchRequest. DMServer
424 // will pick a private key on the server which matches the hash (matches
425 // public key on the client). If DMServer is unable to find matching key, it
426 // will return an error instead of policy data.
427 // In case hash was not specified, DMServer will leave verification signature
428 // field empty (legacy behavior).
429 // In addition to the checks between new_public_key
430 // and new_public_key_signature described above, Chrome also verifies
431 // new_public_key with the embedded public key and
432 // new_public_key_verification_signature.
433 optional bytes new_public_key_verification_signature = 7;
436 // Protobuf used to generate the new_public_key_verification_signature field.
437 message PolicyPublicKeyAndDomain {
438 // The public key to sign (taken from the |new_public_key| field in
439 // PolicyFetchResponse).
440 optional bytes new_public_key = 1;
442 // The domain associated with this key (should match the domain portion of
443 // the username field of the policy).
444 optional string domain = 2;
447 // This protobuf defines a single remote command from server to client for
449 message RemoteCommand {
451 // Simple echo command for testing, will be ignored in production code.
452 COMMAND_ECHO_TEST = -1;
454 // Reboot the device.
457 // Take a screenshot.
458 DEVICE_SCREENSHOT = 1;
462 optional Type type = 1;
464 // An opaque unique identifier for the command.
465 optional int64 unique_id = 2;
467 // The age of the command (in milliseconds) when it is sent from server to
468 // client, defined as current_server_time - command_generated_time.
469 optional int64 age_of_command = 3;
471 // Extra parameters for this command, expected to be a JSON string.
472 optional string payload = 4;
475 // This protobuf defines the execution result of a single remote command
476 // which will be sent back to the server.
477 message RemoteCommandResult {
479 RESULT_IGNORED = 0; // The command was ignored as obsolete.
480 RESULT_FAILURE = 1; // The command could not be executed.
481 RESULT_SUCCESS = 2; // The command was successfully executed.
484 // The result of the command.
485 optional ResultType result = 1;
487 // The opaque unique identifier of the command. This value is copied from the
488 // RemoteCommand protobuf that contained the command.
489 optional int64 unique_id = 2;
491 // The time at which the command was executed, if the the result is
493 optional int64 timestamp = 3;
495 // Extra information sent to server as result of execution, expected to be a
497 optional string payload = 4;
500 message DeviceRemoteCommandRequest {
501 // The command ID of the last command received from the server until
502 // now. Omitted if no commands have been received yet.
503 optional int64 last_command_unique_id = 1;
505 // The execution results of previously fetched commands.
506 // The client should send back a command result whenever possible.
507 repeated RemoteCommandResult command_results = 2;
510 message DeviceRemoteCommandResponse {
511 // The queue of pending commands.
512 repeated RemoteCommand commands = 1;
515 // Request from device to server for reading policies.
516 message DevicePolicyRequest {
517 // The policy fetch request. If this field exists, the request must
518 // comes from a non-TT client. The repeated field allows client to
519 // request multiple policies for better performance.
520 repeated PolicyFetchRequest request = 3;
523 // Response from server to device for reading policies.
524 message DevicePolicyResponse {
525 // The policy fetch response.
526 repeated PolicyFetchResponse response = 3;
530 // [timestamp] is milli seconds since Epoch in UTC timezone.
531 optional int64 start_timestamp = 1;
532 optional int64 end_timestamp = 2;
535 message ActiveTimePeriod {
536 optional TimePeriod time_period = 1;
538 // The active duration during the above time period.
539 // The unit is milli-second.
540 optional int32 active_duration = 2;
543 // This captures launch events for one app/extension or other installments.
544 message InstallableLaunch {
545 optional string install_id = 1;
547 // Time duration where this report covers. These are required
548 // and the record will be ignored if not set.
549 optional TimePeriod duration = 2;
551 // Client will send at most 50 timestamps to DM. All the rest
552 // launch activities will be summed into the total count.
553 // We will distribute the count evenly among the time span when
554 // doing time based aggregation.
555 repeated int64 timestamp = 3;
556 optional int64 total_count = 4;
559 // Used to report the device location.
560 message DeviceLocation {
563 ERROR_CODE_POSITION_UNAVAILABLE = 1;
566 // Latitude in decimal degrees north (WGS84 coordinate frame).
567 optional double latitude = 1;
569 // Longitude in decimal degrees west (WGS84 coordinate frame).
570 optional double longitude = 2;
572 // Altitude in meters (above WGS84 datum).
573 optional double altitude = 3;
575 // Accuracy of horizontal position in meters.
576 optional double accuracy = 4;
578 // Accuracy of altitude in meters.
579 optional double altitude_accuracy = 5;
581 // Heading in decimal degrees clockwise from true north.
582 optional double heading = 6;
584 // Horizontal component of device velocity in meters per second.
585 optional double speed = 7;
587 // Time of position measurement in milisecons since Epoch in UTC time.
588 optional int64 timestamp = 8;
590 // Error code, see enum above.
591 optional ErrorCode error_code = 9;
593 // Human-readable error message.
594 optional string error_message = 10;
597 // Details about a network interface.
598 message NetworkInterface {
599 // Indicates the type of network device.
600 enum NetworkDeviceType {
608 // Network device type.
609 optional NetworkDeviceType type = 1;
611 // MAC address (if applicable) of the corresponding network device. This is
612 // formatted as an ASCII string with 12 hex digits. Example: A0B1C2D3E4F5.
613 optional string mac_address = 2;
615 // MEID (if applicable) of the corresponding network device. Formatted as
616 // ASCII string composed of 14 hex digits. Example: A10000009296F2.
617 optional string meid = 3;
619 // IMEI (if applicable) of the corresponding network device. 15-16 decimal
620 // digits encoded as ASCII string. Example: 355402040158759.
621 optional string imei = 4;
623 // The device path associated with this network interface.
624 optional string device_path = 5;
628 // Information about configured/visible networks - this is separate from
629 // NetworkInterface because a configured network may not be associated with
630 // any specific interface, or may be visible across multiple interfaces.
631 message NetworkState {
632 // The current state of this network.
633 enum ConnectionState {
644 ACTIVATION_FAILURE = 10;
648 // For networks associated with a device, the path of the device.
649 optional string device_path = 1;
651 // Current state of this connection as reported by shill.
652 optional ConnectionState connection_state = 2;
654 // For wireless networks, the signal_strength in dBm.
655 optional int32 signal_strength = 3;
657 // The IP address this interface is bound to, if any.
658 optional string ip_address = 4;
660 // The gateway IP for this interface, if any.
661 optional string gateway = 5;
664 // Details about a device user.
666 // Types of device users which can be reported.
668 // A user managed by the same domain as the device.
669 USER_TYPE_MANAGED = 0;
671 // A user not managed by the same domain as the device.
672 USER_TYPE_UNMANAGED = 1;
675 // The type of the user.
676 required UserType type = 1;
678 // Email address of the user. Present only if the user type is managed.
679 optional string email = 2;
682 // Information about a single disk volume.
684 optional string volume_id = 1;
685 optional int64 storage_total = 2;
686 optional int64 storage_free = 3;
689 // Information about a single CPU temperature channel.
690 message CPUTempInfo {
691 // Temperature channel label.
692 optional string cpu_label = 1;
693 // CPU temperature in Celsius.
694 optional int32 cpu_temp = 2;
697 // Report device level status.
698 message DeviceStatusReportRequest {
699 // The OS version reported by the device is a platform version
700 // e.g. 1435.0.2011_12_16_1635.
701 optional string os_version = 1;
702 optional string firmware_version = 2;
704 // "Verified", "Dev". Same as verified mode.
705 // If the mode is unknown, this field should not be set.
706 optional string boot_mode = 3;
708 // Device active times collection since last report rpc call.
709 // No longer used -- use active_period instead.
710 repeated TimePeriod active_time = 4 [deprecated = true];
712 // The browser version string as shown in the About dialog.
714 optional string browser_version = 5;
716 // A list of periods when the device was active, aggregated by day.
717 repeated ActiveTimePeriod active_period = 6;
719 // The device location.
720 optional DeviceLocation device_location = 7;
722 // List of network interfaces.
723 repeated NetworkInterface network_interface = 8;
725 // List of recent device users, in descending order by last login time.
726 repeated DeviceUser user = 9;
728 // Disk space + other info about mounted/connected volumes.
729 repeated VolumeInfo volume_info = 10;
731 // List of visible/configured networks
732 repeated NetworkState network_state = 11;
734 // Samples of CPU utilization (0-100), sampled once every 120 seconds.
735 repeated int32 cpu_utilization_pct = 12;
737 // Free RAM (unreliable due to GC).
738 optional int64 deprecated_system_ram_free = 13 [deprecated = true];
740 // Total RAM on the device.
741 optional int64 system_ram_total = 14;
743 // Samples of free RAM [in bytes] (unreliable due to GC).
744 repeated int64 system_ram_free = 15;
746 // CPU temp information.
747 repeated CPUTempInfo cpu_temp_info = 16;
750 // Provides status information for an installed app/extension.
752 // ID of the installed app/extension
753 optional string app_id = 1;
755 // Currently installed version of the app.
756 optional string extension_version = 2;
758 // Self-reported status summary (via chrome.reporting APIs)
759 optional string status = 3;
761 // If true, the application is currently in a self-reported error state.
762 optional bool error = 4;
765 // Report session (a user on one device) level status.
766 message SessionStatusReportRequest {
767 // Installed apps for this user on this device.
768 // No longer used -- use installed_apps instead.
769 repeated string installed_app_id = 1 [deprecated = true];
771 // Installed extensions for this user on this device.
772 // No longer used -- use installed_extensions instead.
773 repeated string installed_extension_id = 2 [deprecated = true];
775 // One stat per app for top 30 apps.
776 repeated InstallableLaunch app_launch_stat = 3;
778 // If this is a kiosk session, this is the device local account ID.
779 optional string device_local_account_id = 4;
781 // Information about installed apps for this user on this device.
782 repeated AppStatus installed_apps = 5;
784 // Information about installed extensions for this user on this device.
785 repeated AppStatus installed_extensions = 6;
788 // Response from DMServer to update devices' status.
789 // It is possible that status report fails but policy request succeed. In such
790 // case, the DeviceStatusReportResponse will contain an error code and the
791 // device should re-send status report data in the next policy request. The
792 // device should re-send report data if policy request fails, even if
793 // DeviceStatusReportResponse contains no error code.
794 message DeviceStatusReportResponse {
795 optional int32 error_code = 1;
797 // Human readable error message for customer support purpose.
798 optional string error_message = 2;
801 // Response from DMServer to update user devices' status.
802 // It is possible that status report fails but policy request succeed. In such
803 // case, the SessionStatusReportResponse will contain an error code and the
804 // device should re-send status report data in the next policy request. The
805 // device should re-send report data if policy request fails, even if
806 // SessionStatusReportResponse contains no error code.
807 message SessionStatusReportResponse {
808 optional int32 error_code = 1;
810 // Human readable error message for customer support purpose.
811 optional string error_message = 2;
814 // Request from device to server to determine whether the device should
815 // go through enterprise enrollment. Unlike the other requests, this request is
816 // not authenticated.
817 message DeviceAutoEnrollmentRequest {
818 // SHA-256 hash of the device's serial number, mod |modulus|.
819 // Should always be present.
820 optional int64 remainder = 1;
822 // Modulus of the hash used by the client. Should always be present. This
823 // is the number of buckets the client thinks the server has. For now,
824 // it is a power of 2, but due to the strict constraint on how many serial
825 // numbers a bucket can contain, it may become non power of 2. If that
826 // happens, client-side needs to change its assumption.
827 optional int64 modulus = 2;
830 // Response from server to auto-enrollment detection request.
831 message DeviceAutoEnrollmentResponse {
832 // If this field is present, the other fields are ignored and the client
833 // should send a new DeviceAutoEnrollmentRequest with a new |remainder|
834 // computed using this new |modulus|. If this field is empty, the client's
835 // request was accepted.
836 // DMServer guarantees that if the modulus sent by client in
837 // DeviceAutoEnrollmentRequest matches server's expectation, this field
839 optional int64 expected_modulus = 1;
841 // List of hashes in the client's hash bucket. If the client's hash matches
842 // any in this list, the client device should do enterprise enrollment.
843 // If it matches none, enrollment should be optional.
844 // Each entry has exactly 256 bits (32 bytes).
845 repeated bytes hash = 2;
848 // Sent by the client to the server. The device management server keeps a
849 // mapping of device identifiers to device state. Devices query this table after
850 // hard reset in order recover state. This request is keyed just by the opaque
851 // server-backed state key; there is no further authentication.
852 message DeviceStateRetrievalRequest {
853 // Opaque, client-determined, unpredictable, stable and unique device
854 // identifier to retrieve state for. This field contains 32 bytes of data that
855 // looks essentially random to the server. It may be generated e.g. by running
856 // a concatenation of suitable device identifiers through a cryptographic hash
857 // algorithm such as SHA-256.
858 optional bytes server_backed_state_key = 1;
861 // Sent by the client to the server when in registered state to update the
862 // device-determined device state keys.
863 message DeviceStateKeyUpdateRequest {
864 // The client-determined state keys. To the server, these look like 32 bytes
865 // of random data. The client should generate these keys using a deterministic
866 // algorithm that takes stable device identifiers as an input and produces a
867 // key as the output, possibly by running the identifiers through a
868 // cryptographic hash function such as SHA-256.
869 repeated bytes server_backed_state_key = 1;
872 // Server to client message carrying the device state response. Because the
873 // request is not authenticated, the only protection against state extraction
874 // from server is the unpredictability of the server-backed state ID. Thus, the
875 // response should not contain any sensitive data. If the server doesn't know
876 // the requested identifier, it just return a message with restore_mode set to
877 // RESTORE_MODE_NONE.
878 message DeviceStateRetrievalResponse {
879 // Restorative action to take after device reset.
881 // No state restoration.
882 RESTORE_MODE_NONE = 0;
883 // Enterprise enrollment requested, but user may skip.
884 RESTORE_MODE_REENROLLMENT_REQUESTED = 1;
885 // Enterprise enrollment is enforced and cannot be skipped.
886 RESTORE_MODE_REENROLLMENT_ENFORCED = 2;
887 // The device has been disabled by its owner. The device will show a warning
888 // screen and prevent the user from proceeding further.
889 RESTORE_MODE_DISABLED = 3;
891 // The server-indicated restore mode.
892 optional RestoreMode restore_mode = 1 [default = RESTORE_MODE_NONE];
894 // Primary domain the device is associated with.
895 optional string management_domain = 2;
897 // State that is relevant only when the |restore_mode| is
898 // |RESTORE_MODE_DISABLED|.
899 optional DisabledState disabled_state = 3;
902 // Sent by the client to the server to pair the Host device with the Controller
903 // device. The HTTP request contains an end-user OAuth token and only succeeds
904 // if both Host and Controller devices belong to the end-user domain.
905 message DevicePairingRequest {
907 // The device ID of the Host device.
908 optional string host_device_id = 1;
910 // The device ID of the Controller device.
911 optional string controller_device_id = 2;
914 // Response from the server to the device pairing request.
915 message DevicePairingResponse {
917 // The client should check HTTP status code first. If HTTP status code is not
918 // 200 (e.g. 500 internal error), then it means the pairing fails. If HTTP
919 // status code is 200, then the client should check the status code within the
924 // A generic failure code for pairing.
927 // The Host device cannot be found in the user's domain.
928 HOST_DEVICE_NOT_FOUND = 2;
930 // The Controller device cannot be found in the user's domain.
931 CONTROLLER_DEVICE_NOT_FOUND = 3;
933 // The Host device is deprovisioned.
934 HOST_DEVICE_DEPROVISIONED = 4;
936 // The Controller device is deprovisioned.
937 CONTROLLER_DEVICE_DEPROVISIONED = 5;
940 optional StatusCode status_code = 1 [default = FAILED];
943 // Sent by the client to the server to check if the devices are paired. The HTTP
944 // request contains controller service account OAuth token as well as the
945 // DMToken from the Host device.
946 message CheckDevicePairingRequest {
948 // The device ID of the Host device.
949 optional string host_device_id = 1;
951 // The device ID of the Controller device.
952 optional string controller_device_id = 2;
955 // Response from the server to the check device pairing request.
956 message CheckDevicePairingResponse {
958 // The client should check HTTP status code first. If HTTP status code is not
959 // 200 (e.g. 500 internal error), then it means the pairing status is unknown.
960 // If HTTP status code is 200, then the client should check the status code
961 // within the response.
965 // The Host and Controller devices are not paired.
968 // The Host device cannot be found in the Host device domain.
969 HOST_DEVICE_NOT_FOUND = 2;
971 // The Controller device cannot be found in the Host device domain.
972 CONTROLLER_DEVICE_NOT_FOUND = 3;
974 // The Host device is deprovisioned.
975 HOST_DEVICE_DEPROVISIONED = 4;
977 // The Controller device is deprovisioned.
978 CONTROLLER_DEVICE_DEPROVISIONED = 5;
980 // Invalid controller identity.
981 INVALID_CONTROLLER_DEVICE_IDENTITY = 6;
984 optional StatusCode status_code = 1 [default = NOT_PAIRED];
987 // Sent by the client to the server to check if the current user is allowed
988 // to update attributes (asset id and location). The HTTP request contains an
989 // end-user OAuth token.
990 message DeviceAttributeUpdatePermissionRequest {
993 // Response from the server specifying whether the current user is allowed to
994 // update attributes (asset id and location).
995 message DeviceAttributeUpdatePermissionResponse {
997 ATTRIBUTE_UPDATE_DISALLOWED = 0;
998 ATTRIBUTE_UPDATE_ALLOWED = 1;
1001 optional ResultType result = 1;
1004 // Sent by the client to the server to update device attributes (asset id and
1005 // location). The HTTP request contains an end-user OAuth token.
1006 message DeviceAttributeUpdateRequest {
1007 // The user-generated asset identifier.
1008 optional string asset_id = 1;
1010 // The user input device location.
1011 optional string location = 2;
1014 // Response from the server to update device attributes (asset id and location).
1015 message DeviceAttributeUpdateResponse {
1017 ATTRIBUTE_UPDATE_ERROR = 0;
1018 ATTRIBUTE_UPDATE_SUCCESS = 1;
1021 optional ResultType result = 1;
1024 // Sent by the client to server to update the mapping from GCM id to device_id
1025 // on the server side.
1026 message GcmIdUpdateRequest {
1027 optional string gcm_id = 1;
1030 // Response for GcmIdUpdateRequest, an empty message for now.
1031 message GcmIdUpdateResponse {}
1033 // Request from the DMAgent on the device to the DMServer. This is
1034 // container for all requests from device to server. The overall HTTP
1035 // request MUST be in the following format:
1037 // * HTTP method is POST
1038 // * Data mime type is application/x-protobuffer
1039 // * HTTP parameters are (all required, all case sensitive):
1040 // * request: MUST BE one of
1041 // * api_authorization
1043 // * check_device_pairing
1045 // * device_state_retrieval
1046 // * enterprise_check
1052 // * remote_commands
1053 // * attribute_update_permission
1054 // * attribute_update
1057 // * devicetype: MUST BE "1" for Android or "2" for Chrome OS.
1058 // * apptype: MUST BE Android or Chrome.
1059 // * deviceid: MUST BE no more than 64-char in [\x21-\x7E].
1060 // * agent: MUST BE a string of characters.
1061 // * HTTP Authorization header MUST be in the following formats:
1062 // * For register and ping requests
1063 // Authorization: GoogleLogin auth=<auth cookie for Mobile Sync>
1065 // * For unregister, policy, status, cert_upload, remote commands requests,
1066 // and gcm id update requests
1067 // Authorization: GoogleDMToken token=<dm token from register>
1069 // * The Authorization header isn't used for enterprise_check
1070 // request, nor for register requests using OAuth. In the latter case,
1071 // the OAuth token is passed in the "oauth" parameter.
1073 // DeviceManagementRequest should only contain one request which matches the
1074 // HTTP query parameter - request, as listed below. Other requests within the
1075 // container will be ignored.
1076 // cert_upload: cert_upload_request
1077 // check_device_pairing: check_device_pairing_request
1078 // device_pairing: device_pairing_request
1079 // device_state_retrieval: device_state_retrieval_request
1080 // enterprise_check: auto_enrollment_request
1081 // ping: policy_request
1082 // policy: policy_request
1083 // register: register_request
1084 // status: device_status_report_request or session_status_report_request
1085 // unregister: unregister_request
1086 // remote_commands: remote_command_request
1087 // attribute_update_permission: device_attribute_update_permission_request
1088 // attribute_update: device_attribute_update_request
1089 // gcm_id_update: gcm_id_update_request
1091 message DeviceManagementRequest {
1092 // Register request.
1093 optional DeviceRegisterRequest register_request = 1;
1095 // Unregister request.
1096 optional DeviceUnregisterRequest unregister_request = 2;
1099 optional DevicePolicyRequest policy_request = 3;
1102 optional DeviceStatusReportRequest device_status_report_request = 4;
1103 optional SessionStatusReportRequest session_status_report_request = 5;
1105 // Auto-enrollment detection.
1106 optional DeviceAutoEnrollmentRequest auto_enrollment_request = 6;
1108 // EMCert upload (for remote attestation)
1109 optional DeviceCertUploadRequest cert_upload_request = 7;
1111 // Request for OAuth2 authorization codes to access Google services.
1112 optional DeviceServiceApiAccessRequest service_api_access_request = 8;
1114 // Device-state retrieval.
1115 optional DeviceStateRetrievalRequest device_state_retrieval_request = 9;
1117 // Device state key update.
1118 optional DeviceStateKeyUpdateRequest device_state_key_update_request = 10;
1120 // Pair two devices.
1121 optional DevicePairingRequest device_pairing_request = 11;
1123 // Check if two devices are paired.
1124 optional CheckDevicePairingRequest check_device_pairing_request = 12;
1126 // Remote command fetching.
1127 optional DeviceRemoteCommandRequest remote_command_request = 13;
1129 // Check permission for updating device attribute.
1130 optional DeviceAttributeUpdatePermissionRequest
1131 device_attribute_update_permission_request = 14;
1133 // Update device attribute.
1134 optional DeviceAttributeUpdateRequest device_attribute_update_request
1137 // Update the GCM id to device_id mapping.
1138 optional GcmIdUpdateRequest gcm_id_update_request = 16;
1141 // Response from server to device.
1143 // The server uses the following numbers as HTTP status codes
1144 // to report top-level errors.
1146 // 200 OK: valid response is returned to client.
1147 // 400 Bad Request: invalid argument.
1148 // 401 Unauthorized: invalid auth cookie or DM token.
1149 // 403 Forbidden: device management is not allowed.
1150 // 404 Not Found: the request URL is invalid.
1151 // 410 Device Not Found: the device id is not found.
1152 // 491 Request Pending: the request is pending approval.
1153 // 500 Internal Server Error: most likely a bug in DM server.
1154 // 503 Service Unavailable: most likely a backend error.
1155 // 901 Device Not Found: the device id is not found.
1156 // 902 Policy Not Found: the policy is not found.
1157 message DeviceManagementResponse {
1159 optional string error_message = 2;
1161 // Register response
1162 optional DeviceRegisterResponse register_response = 3;
1164 // Unregister response
1165 optional DeviceUnregisterResponse unregister_response = 4;
1168 optional DevicePolicyResponse policy_response = 5;
1170 // Device status report response.
1171 optional DeviceStatusReportResponse device_status_report_response = 6;
1173 // Session status report response.
1174 optional SessionStatusReportResponse session_status_report_response = 7;
1176 // Auto-enrollment detection response.
1177 optional DeviceAutoEnrollmentResponse auto_enrollment_response = 8;
1179 // EMCert upload response.
1180 optional DeviceCertUploadResponse cert_upload_response = 9;
1182 // Response to OAuth2 authorization code request.
1183 optional DeviceServiceApiAccessResponse service_api_access_response = 10;
1185 // Device-state retrieval.
1186 optional DeviceStateRetrievalResponse device_state_retrieval_response = 11;
1188 // Response to device pairing request.
1189 optional DevicePairingResponse device_pairing_response = 12;
1191 // Response to check device pairing request.
1192 optional CheckDevicePairingResponse check_device_pairing_response = 13;
1194 // Response to remote command request.
1195 optional DeviceRemoteCommandResponse remote_command_response = 14;
1197 // Response to check device attribute update permission.
1198 optional DeviceAttributeUpdatePermissionResponse
1199 device_attribute_update_permission_response = 15;
1201 // Response to update device attribute.
1202 optional DeviceAttributeUpdateResponse device_attribute_update_response = 16;
1204 // Response to GCM id update request.
1205 optional GcmIdUpdateResponse gcm_id_update_response = 17;