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 free-text location info the admin enters to associate the device
355 optional string annotated_location = 20;
357 // The free-text asset identifier the admin enters to associate the device
358 // with a user-generated identifier.
359 optional string annotated_asset_id = 21;
361 // The unique directory api ID of the device which was generated on the
363 optional string directory_api_id = 22;
366 message PolicyFetchResponse {
367 // Since a single policy request may ask for multiple policies, we
368 // provide separate error code for each individual policy fetch.
370 // We will use standard HTTP Status Code as error code.
371 optional int32 error_code = 1;
373 // Human readable error message for customer support purpose.
374 optional string error_message = 2;
376 // This is a serialized |PolicyData| protobuf (defined above).
377 optional bytes policy_data = 3;
379 // Signature of the policy data above.
380 optional bytes policy_data_signature = 4;
382 // If the public key has been rotated on the server, the new public
383 // key is sent here. It is already used for |policy_data_signature|
384 // above, whereas |new_public_key_signature| is created using the
385 // old key (so the client can trust the new key). If this is the
386 // first time when the client requests policies (so it doesn't have
387 // on old public key), then |new_public_key_signature| is empty.
388 optional bytes new_public_key = 5;
389 optional bytes new_public_key_signature = 6;
391 // If new_public_key is specified, this field contains a signature
392 // of a PolicyPublicKeyAndDomain protobuf, signed using a key only
393 // available to DMServer. The public key portion of this well-known key is
394 // embedded into the Chrome binary. The hash of that embedded key is passed
395 // to DMServer as verification_key_hash field in PolicyFetchRequest. DMServer
396 // will pick a private key on the server which matches the hash (matches
397 // public key on the client). If DMServer is unable to find matching key, it
398 // will return an error instead of policy data.
399 // In case hash was not specified, DMServer will leave verification signature
400 // field empty (legacy behavior).
401 // In addition to the checks between new_public_key
402 // and new_public_key_signature described above, Chrome also verifies
403 // new_public_key with the embedded public key and
404 // new_public_key_verification_signature.
405 optional bytes new_public_key_verification_signature = 7;
408 // Protobuf used to generate the new_public_key_verification_signature field.
409 message PolicyPublicKeyAndDomain {
410 // The public key to sign (taken from the |new_public_key| field in
411 // PolicyFetchResponse).
412 optional bytes new_public_key = 1;
414 // The domain associated with this key (should match the domain portion of
415 // the username field of the policy).
416 optional string domain = 2;
419 // This protobuf defines a single remote command from server to client for
421 message RemoteCommand {
423 // Simple echo command for testing, will be ignored in production code.
424 COMMAND_ECHO_TEST = -1;
426 // Reboot the device.
431 optional Type type = 1;
433 // An opaque unique identifier for the command.
434 optional int64 unique_id = 2;
436 // The time at which the command was issued, in milliseconds.
437 optional int64 timestamp = 3;
439 // Extra parameters for this command, might be a serialization of another
441 optional bytes payload = 4;
444 // This protobuf defines the execution result of a single remote command
445 // which will be sent back to the server.
446 message RemoteCommandResult {
448 RESULT_IGNORED = 0; // The command was ignored as obsolete.
449 RESULT_FAILURE = 1; // The command could not be executed.
450 RESULT_SUCCESS = 2; // The command was successfully executed.
453 // The result of the command.
454 optional ResultType result = 1;
456 // The opaque unique identifier of the command. This value is copied from the
457 // RemoteCommand protobuf that contained the command.
458 optional int64 unique_id = 2;
460 // The time at which the command was executed, if the the result is
462 optional int64 timestamp = 3;
464 // Extra information sent to server as result of execution, might be a
465 // serialization of another protobuf.
466 optional bytes payload = 4;
469 message DeviceRemoteCommandRequest {
470 // The command ID of the last command received from the server until
471 // now. Omitted if no commands have been received yet.
472 optional int64 last_command_unique_id = 1;
474 // The execution results of previously fetched commands.
475 // The client should send back a command result whenever possible.
476 repeated RemoteCommandResult command_results = 2;
479 message DeviceRemoteCommandResponse {
480 // The queue of pending commands.
481 repeated RemoteCommand commands = 1;
484 // Request from device to server for reading policies.
485 message DevicePolicyRequest {
486 // The policy fetch request. If this field exists, the request must
487 // comes from a non-TT client. The repeated field allows client to
488 // request multiple policies for better performance.
489 repeated PolicyFetchRequest request = 3;
492 // Response from server to device for reading policies.
493 message DevicePolicyResponse {
494 // The policy fetch response.
495 repeated PolicyFetchResponse response = 3;
499 // [timestamp] is milli seconds since Epoch in UTC timezone.
500 optional int64 start_timestamp = 1;
501 optional int64 end_timestamp = 2;
504 message ActiveTimePeriod {
505 optional TimePeriod time_period = 1;
507 // The active duration during the above time period.
508 // The unit is milli-second.
509 optional int32 active_duration = 2;
512 // This captures launch events for one app/extension or other installments.
513 message InstallableLaunch {
514 optional string install_id = 1;
516 // Time duration where this report covers. These are required
517 // and the record will be ignored if not set.
518 optional TimePeriod duration = 2;
520 // Client will send at most 50 timestamps to DM. All the rest
521 // launch activities will be summed into the total count.
522 // We will distribute the count evenly among the time span when
523 // doing time based aggregation.
524 repeated int64 timestamp = 3;
525 optional int64 total_count = 4;
528 // Used to report the device location.
529 message DeviceLocation {
532 ERROR_CODE_POSITION_UNAVAILABLE = 1;
535 // Latitude in decimal degrees north (WGS84 coordinate frame).
536 optional double latitude = 1;
538 // Longitude in decimal degrees west (WGS84 coordinate frame).
539 optional double longitude = 2;
541 // Altitude in meters (above WGS84 datum).
542 optional double altitude = 3;
544 // Accuracy of horizontal position in meters.
545 optional double accuracy = 4;
547 // Accuracy of altitude in meters.
548 optional double altitude_accuracy = 5;
550 // Heading in decimal degrees clockwise from true north.
551 optional double heading = 6;
553 // Horizontal component of device velocity in meters per second.
554 optional double speed = 7;
556 // Time of position measurement in milisecons since Epoch in UTC time.
557 optional int64 timestamp = 8;
559 // Error code, see enum above.
560 optional ErrorCode error_code = 9;
562 // Human-readable error message.
563 optional string error_message = 10;
566 // Details about a network interface.
567 message NetworkInterface {
568 // Indicates the type of network device.
569 enum NetworkDeviceType {
577 // Network device type.
578 optional NetworkDeviceType type = 1;
580 // MAC address (if applicable) of the corresponding network device. This is
581 // formatted as an ASCII string with 12 hex digits. Example: A0B1C2D3E4F5.
582 optional string mac_address = 2;
584 // MEID (if applicable) of the corresponding network device. Formatted as
585 // ASCII string composed of 14 hex digits. Example: A10000009296F2.
586 optional string meid = 3;
588 // IMEI (if applicable) of the corresponding network device. 15-16 decimal
589 // digits encoded as ASCII string. Example: 355402040158759.
590 optional string imei = 4;
592 // The device path associated with this network interface.
593 optional string device_path = 5;
597 // Information about configured/visible networks - this is separate from
598 // NetworkInterface because a configured network may not be associated with
599 // any specific interface, or may be visible across multiple interfaces.
600 message NetworkState {
601 // The current state of this network.
602 enum ConnectionState {
613 ACTIVATION_FAILURE = 10;
617 // For networks associated with a device, the path of the device.
618 optional string device_path = 1;
620 // Current state of this connection as reported by shill.
621 optional ConnectionState connection_state = 2;
623 // For wireless networks, the signal_strength in dBm.
624 optional int32 signal_strength = 3;
626 // The IP address this interface is bound to, if any.
627 optional string ip_address = 4;
629 // The gateway IP for this interface, if any.
630 optional string gateway = 5;
633 // Details about a device user.
635 // Types of device users which can be reported.
637 // A user managed by the same domain as the device.
638 USER_TYPE_MANAGED = 0;
640 // A user not managed by the same domain as the device.
641 USER_TYPE_UNMANAGED = 1;
644 // The type of the user.
645 required UserType type = 1;
647 // Email address of the user. Present only if the user type is managed.
648 optional string email = 2;
651 // Information about a single disk volume.
653 optional string volume_id = 1;
654 optional int64 storage_total = 2;
655 optional int64 storage_free = 3;
658 // Report device level status.
659 message DeviceStatusReportRequest {
660 // The OS version reported by the device is a platform version
661 // e.g. 1435.0.2011_12_16_1635.
662 optional string os_version = 1;
663 optional string firmware_version = 2;
665 // "Verified", "Dev". Same as verified mode.
666 // If the mode is unknown, this field should not be set.
667 optional string boot_mode = 3;
669 // Device active times collection since last report rpc call.
670 // No longer used -- use active_period instead.
671 repeated TimePeriod active_time = 4 [deprecated = true];
673 // The browser version string as shown in the About dialog.
675 optional string browser_version = 5;
677 // A list of periods when the device was active, aggregated by day.
678 repeated ActiveTimePeriod active_period = 6;
680 // The device location.
681 optional DeviceLocation device_location = 7;
683 // List of network interfaces.
684 repeated NetworkInterface network_interface = 8;
686 // List of recent device users, in descending order by last login time.
687 repeated DeviceUser user = 9;
689 // Disk space + other info about mounted/connected volumes.
690 repeated VolumeInfo volume_info = 10;
692 // List of visible/configured networks
693 repeated NetworkState network_state = 11;
695 // Samples of CPU utilization (0-100), sampled once every 120 seconds.
696 repeated int32 cpu_utilization_pct = 12;
698 // Free RAM (unreliable due to GC).
699 optional int64 deprecated_system_ram_free = 13 [deprecated = true];
701 // Total RAM on the device.
702 optional int64 system_ram_total = 14;
704 // Samples of free RAM [in bytes] (unreliable due to GC).
705 repeated int64 system_ram_free = 15;
708 // Provides status information for an installed app/extension.
710 // ID of the installed app/extension
711 required string app_id = 1;
713 // Currently installed version of the app.
714 required string extension_version = 2;
716 // Self-reported status summary (via chrome.reporting APIs)
717 optional string status = 3;
719 // If true, the application is currently in a self-reported error state.
720 optional bool error = 4;
723 // Report session (a user on one device) level status.
724 message SessionStatusReportRequest {
725 // Installed apps for this user on this device.
726 // No longer used -- use installed_apps instead.
727 repeated string installed_app_id = 1 [deprecated = true];
729 // Installed extensions for this user on this device.
730 // No longer used -- use installed_extensions instead.
731 repeated string installed_extension_id = 2 [deprecated = true];
733 // One stat per app for top 30 apps.
734 repeated InstallableLaunch app_launch_stat = 3;
736 // If this is a kiosk session, this is the device local account ID.
737 optional string device_local_account_id = 4;
739 // Information about installed apps for this user on this device.
740 repeated AppStatus installed_apps = 5;
742 // Information about installed extensions for this user on this device.
743 repeated AppStatus installed_extensions = 6;
746 // Response from DMServer to update devices' status.
747 // It is possible that status report fails but policy request succeed. In such
748 // case, the DeviceStatusReportResponse will contain an error code and the
749 // device should re-send status report data in the next policy request. The
750 // device should re-send report data if policy request fails, even if
751 // DeviceStatusReportResponse contains no error code.
752 message DeviceStatusReportResponse {
753 optional int32 error_code = 1;
755 // Human readable error message for customer support purpose.
756 optional string error_message = 2;
759 // Response from DMServer to update user devices' status.
760 // It is possible that status report fails but policy request succeed. In such
761 // case, the SessionStatusReportResponse will contain an error code and the
762 // device should re-send status report data in the next policy request. The
763 // device should re-send report data if policy request fails, even if
764 // SessionStatusReportResponse contains no error code.
765 message SessionStatusReportResponse {
766 optional int32 error_code = 1;
768 // Human readable error message for customer support purpose.
769 optional string error_message = 2;
772 // Request from device to server to determine whether the device should
773 // go through enterprise enrollment. Unlike the other requests, this request is
774 // not authenticated.
775 message DeviceAutoEnrollmentRequest {
776 // SHA-256 hash of the device's serial number, mod |modulus|.
777 // Should always be present.
778 optional int64 remainder = 1;
780 // Modulus of the hash used by the client. Should always be present. This
781 // is the number of buckets the client thinks the server has. For now,
782 // it is a power of 2, but due to the strict constraint on how many serial
783 // numbers a bucket can contain, it may become non power of 2. If that
784 // happens, client-side needs to change its assumption.
785 optional int64 modulus = 2;
788 // Response from server to auto-enrollment detection request.
789 message DeviceAutoEnrollmentResponse {
790 // If this field is present, the other fields are ignored and the client
791 // should send a new DeviceAutoEnrollmentRequest with a new |remainder|
792 // computed using this new |modulus|. If this field is empty, the client's
793 // request was accepted.
794 // DMServer guarantees that if the modulus sent by client in
795 // DeviceAutoEnrollmentRequest matches server's expectation, this field
797 optional int64 expected_modulus = 1;
799 // List of hashes in the client's hash bucket. If the client's hash matches
800 // any in this list, the client device should do enterprise enrollment.
801 // If it matches none, enrollment should be optional.
802 // Each entry has exactly 256 bits (32 bytes).
803 repeated bytes hash = 2;
806 // Sent by the client to the server. The device management server keeps a
807 // mapping of device identifiers to device state. Devices query this table after
808 // hard reset in order recover state. This request is keyed just by the opaque
809 // server-backed state key; there is no further authentication.
810 message DeviceStateRetrievalRequest {
811 // Opaque, client-determined, unpredictable, stable and unique device
812 // identifier to retrieve state for. This field contains 32 bytes of data that
813 // looks essentially random to the server. It may be generated e.g. by running
814 // a concatenation of suitable device identifiers through a cryptographic hash
815 // algorithm such as SHA-256.
816 optional bytes server_backed_state_key = 1;
819 // Sent by the client to the server when in registered state to update the
820 // device-determined device state keys.
821 message DeviceStateKeyUpdateRequest {
822 // The client-determined state keys. To the server, these look like 32 bytes
823 // of random data. The client should generate these keys using a deterministic
824 // algorithm that takes stable device identifiers as an input and produces a
825 // key as the output, possibly by running the identifiers through a
826 // cryptographic hash function such as SHA-256.
827 repeated bytes server_backed_state_key = 1;
830 // Server to client message carrying the device state response. Because the
831 // request is not authenticated, the only protection against state extraction
832 // from server is the unpredictability of the server-backed state ID. Thus, the
833 // response should not contain any sensitive data. If the server doesn't know
834 // the requested identifier, it just return a message with restore_mode set to
835 // RESTORE_MODE_NONE.
836 message DeviceStateRetrievalResponse {
837 // Restorative action to take after device reset.
839 // No state restoration.
840 RESTORE_MODE_NONE = 0;
841 // Enterprise enrollment requested, but user may skip.
842 RESTORE_MODE_REENROLLMENT_REQUESTED = 1;
843 // Enterprise enrollment is enforced and cannot be skipped.
844 RESTORE_MODE_REENROLLMENT_ENFORCED = 2;
845 // The device has been disabled by its owner. The device will show a warning
846 // screen and prevent the user from proceeding further.
847 RESTORE_MODE_DISABLED = 3;
849 // The server-indicated restore mode.
850 optional RestoreMode restore_mode = 1 [default = RESTORE_MODE_NONE];
852 // Primary domain the device is associated with.
853 optional string management_domain = 2;
855 // State that is relevant only when the |restore_mode| is
856 // |RESTORE_MODE_DISABLED|.
857 optional DisabledState disabled_state = 3;
860 // Sent by the client to the server to pair the Host device with the Controller
861 // device. The HTTP request contains an end-user OAuth token and only succeeds
862 // if both Host and Controller devices belong to the end-user domain.
863 message DevicePairingRequest {
865 // The device ID of the Host device.
866 optional string host_device_id = 1;
868 // The device ID of the Controller device.
869 optional string controller_device_id = 2;
872 // Response from the server to the device pairing request.
873 message DevicePairingResponse {
875 // The client should check HTTP status code first. If HTTP status code is not
876 // 200 (e.g. 500 internal error), then it means the pairing fails. If HTTP
877 // status code is 200, then the client should check the status code within the
882 // A generic failure code for pairing.
885 // The Host device cannot be found in the user's domain.
886 HOST_DEVICE_NOT_FOUND = 2;
888 // The Controller device cannot be found in the user's domain.
889 CONTROLLER_DEVICE_NOT_FOUND = 3;
891 // The Host device is deprovisioned.
892 HOST_DEVICE_DEPROVISIONED = 4;
894 // The Controller device is deprovisioned.
895 CONTROLLER_DEVICE_DEPROVISIONED = 5;
898 optional StatusCode status_code = 1 [default = FAILED];
901 // Sent by the client to the server to check if the devices are paired. The HTTP
902 // request contains controller service account OAuth token as well as the
903 // DMToken from the Host device.
904 message CheckDevicePairingRequest {
906 // The device ID of the Host device.
907 optional string host_device_id = 1;
909 // The device ID of the Controller device.
910 optional string controller_device_id = 2;
913 // Response from the server to the check device pairing request.
914 message CheckDevicePairingResponse {
916 // The client should check HTTP status code first. If HTTP status code is not
917 // 200 (e.g. 500 internal error), then it means the pairing status is unknown.
918 // If HTTP status code is 200, then the client should check the status code
919 // within the response.
923 // The Host and Controller devices are not paired.
926 // The Host device cannot be found in the Host device domain.
927 HOST_DEVICE_NOT_FOUND = 2;
929 // The Controller device cannot be found in the Host device domain.
930 CONTROLLER_DEVICE_NOT_FOUND = 3;
932 // The Host device is deprovisioned.
933 HOST_DEVICE_DEPROVISIONED = 4;
935 // The Controller device is deprovisioned.
936 CONTROLLER_DEVICE_DEPROVISIONED = 5;
938 // Invalid controller identity.
939 INVALID_CONTROLLER_DEVICE_IDENTITY = 6;
942 optional StatusCode status_code = 1 [default = NOT_PAIRED];
945 // Sent by the client to the server to check if the current user is allowed
946 // to update attributes (asset id and location). The HTTP request contains an
947 // end-user OAuth token.
948 message DeviceAttributeUpdatePermissionRequest {
951 // Response from the server specifying whether the current user is allowed to
952 // update attributes (asset id and location).
953 message DeviceAttributeUpdatePermissionResponse {
955 ATTRIBUTE_UPDATE_DISALLOWED = 0;
956 ATTRIBUTE_UPDATE_ALLOWED = 1;
959 optional ResultType result = 1;
962 // Sent by the client to the server to update device attributes (asset id and
963 // location). The HTTP request contains an end-user OAuth token.
964 message DeviceAttributeUpdateRequest {
965 // The user-generated asset identifier.
966 optional string asset_id = 1;
968 // The user input device location.
969 optional string location = 2;
972 // Response from the server to update device attributes (asset id and location).
973 message DeviceAttributeUpdateResponse {
975 ATTRIBUTE_UPDATE_ERROR = 0;
976 ATTRIBUTE_UPDATE_SUCCESS = 1;
979 optional ResultType result = 1;
982 // Request from the DMAgent on the device to the DMServer. This is
983 // container for all requests from device to server. The overall HTTP
984 // request MUST be in the following format:
986 // * HTTP method is POST
987 // * Data mime type is application/x-protobuffer
988 // * HTTP parameters are (all required, all case sensitive):
989 // * request: MUST BE one of
990 // * api_authorization
992 // * check_device_pairing
994 // * device_state_retrieval
995 // * enterprise_check
1001 // * remote_commands
1002 // * attribute_update_permission
1003 // * attribute_update
1005 // * devicetype: MUST BE "1" for Android or "2" for Chrome OS.
1006 // * apptype: MUST BE Android or Chrome.
1007 // * deviceid: MUST BE no more than 64-char in [\x21-\x7E].
1008 // * agent: MUST BE a string of characters.
1009 // * HTTP Authorization header MUST be in the following formats:
1010 // * For register and ping requests
1011 // Authorization: GoogleLogin auth=<auth cookie for Mobile Sync>
1013 // * For unregister, policy, status, cert_upload and remote commands requests
1014 // Authorization: GoogleDMToken token=<dm token from register>
1016 // * The Authorization header isn't used for enterprise_check
1017 // request, nor for register requests using OAuth. In the latter case,
1018 // the OAuth token is passed in the "oauth" parameter.
1020 // DeviceManagementRequest should only contain one request which matches the
1021 // HTTP query parameter - request, as listed below. Other requests within the
1022 // container will be ignored.
1023 // cert_upload: cert_upload_request
1024 // check_device_pairing: check_device_pairing_request
1025 // device_pairing: device_pairing_request
1026 // device_state_retrieval: device_state_retrieval_request
1027 // enterprise_check: auto_enrollment_request
1028 // ping: policy_request
1029 // policy: policy_request
1030 // register: register_request
1031 // status: device_status_report_request or session_status_report_request
1032 // unregister: unregister_request
1033 // remote_commands: remote_command_request
1034 // attribute_update_permission: device_attribute_update_permission_request
1035 // attribute_update: device_attribute_update_request
1037 message DeviceManagementRequest {
1038 // Register request.
1039 optional DeviceRegisterRequest register_request = 1;
1041 // Unregister request.
1042 optional DeviceUnregisterRequest unregister_request = 2;
1045 optional DevicePolicyRequest policy_request = 3;
1048 optional DeviceStatusReportRequest device_status_report_request = 4;
1049 optional SessionStatusReportRequest session_status_report_request = 5;
1051 // Auto-enrollment detection.
1052 optional DeviceAutoEnrollmentRequest auto_enrollment_request = 6;
1054 // EMCert upload (for remote attestation)
1055 optional DeviceCertUploadRequest cert_upload_request = 7;
1057 // Request for OAuth2 authorization codes to access Google services.
1058 optional DeviceServiceApiAccessRequest service_api_access_request = 8;
1060 // Device-state retrieval.
1061 optional DeviceStateRetrievalRequest device_state_retrieval_request = 9;
1063 // Device state key update.
1064 optional DeviceStateKeyUpdateRequest device_state_key_update_request = 10;
1066 // Pair two devices.
1067 optional DevicePairingRequest device_pairing_request = 11;
1069 // Check if two devices are paired.
1070 optional CheckDevicePairingRequest check_device_pairing_request = 12;
1072 // Remote command fetching.
1073 optional DeviceRemoteCommandRequest remote_command_request = 13;
1075 // Check permission for updating device attribute.
1076 optional DeviceAttributeUpdatePermissionRequest
1077 device_attribute_update_permission_request = 14;
1079 // Update device attribute.
1080 optional DeviceAttributeUpdateRequest device_attribute_update_request
1084 // Response from server to device.
1086 // The server uses the following numbers as HTTP status codes
1087 // to report top-level errors.
1089 // 200 OK: valid response is returned to client.
1090 // 400 Bad Request: invalid argument.
1091 // 401 Unauthorized: invalid auth cookie or DM token.
1092 // 403 Forbidden: device management is not allowed.
1093 // 404 Not Found: the request URL is invalid.
1094 // 410 Device Not Found: the device id is not found.
1095 // 491 Request Pending: the request is pending approval.
1096 // 500 Internal Server Error: most likely a bug in DM server.
1097 // 503 Service Unavailable: most likely a backend error.
1098 // 901 Device Not Found: the device id is not found.
1099 // 902 Policy Not Found: the policy is not found.
1100 message DeviceManagementResponse {
1102 optional string error_message = 2;
1104 // Register response
1105 optional DeviceRegisterResponse register_response = 3;
1107 // Unregister response
1108 optional DeviceUnregisterResponse unregister_response = 4;
1111 optional DevicePolicyResponse policy_response = 5;
1113 // Device status report response.
1114 optional DeviceStatusReportResponse device_status_report_response = 6;
1116 // Session status report response.
1117 optional SessionStatusReportResponse session_status_report_response = 7;
1119 // Auto-enrollment detection response.
1120 optional DeviceAutoEnrollmentResponse auto_enrollment_response = 8;
1122 // EMCert upload response.
1123 optional DeviceCertUploadResponse cert_upload_response = 9;
1125 // Response to OAuth2 authorization code request.
1126 optional DeviceServiceApiAccessResponse service_api_access_response = 10;
1128 // Device-state retrieval.
1129 optional DeviceStateRetrievalResponse device_state_retrieval_response = 11;
1131 // Response to device pairing request.
1132 optional DevicePairingResponse device_pairing_response = 12;
1134 // Response to check device pairing request.
1135 optional CheckDevicePairingResponse check_device_pairing_response = 13;
1137 // Response to remote command request.
1138 optional DeviceRemoteCommandResponse remote_command_response = 14;
1140 // Response to check device attribute update permission.
1141 optional DeviceAttributeUpdatePermissionResponse
1142 device_attribute_update_permission_response = 15;
1144 // Response to update device attribute.
1145 optional DeviceAttributeUpdateResponse device_attribute_update_response = 16;