Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: chrome/browser/policy/proto/device_management_backend.proto

Issue 6161007: New protocol and testserver for the Chrome-DMServer protocol (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments + some cleanup Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 syntax = "proto2"; 5 syntax = "proto2";
6 6
7 import "cloud_policy.proto";
8
7 option optimize_for = LITE_RUNTIME; 9 option optimize_for = LITE_RUNTIME;
8 10
9 package enterprise_management; 11 package enterprise_management;
10 12
13 // Protocol buffers for the obsolete protocol:
14 // -------------------------------------------
15 // GenericValue, GenericNamedValue, GenericSetting, DevicePolicySetting,
16 // DevicePolicySettingRequest, DevicePolicyRequest, DevicePolicyResponse
17 // TODO(gfeher): Remove these when both Chrome and DMServer is switched to
18 // using the new protocol.
19
11 // Generic value container. 20 // Generic value container.
12 message GenericValue { 21 message GenericValue {
13 enum ValueType { 22 enum ValueType {
14 VALUE_TYPE_BOOL = 1; 23 VALUE_TYPE_BOOL = 1;
15 VALUE_TYPE_INT64 = 2; 24 VALUE_TYPE_INT64 = 2;
16 VALUE_TYPE_STRING = 3; 25 VALUE_TYPE_STRING = 3;
17 VALUE_TYPE_DOUBLE = 4; 26 VALUE_TYPE_DOUBLE = 4;
18 VALUE_TYPE_BYTES = 5; 27 VALUE_TYPE_BYTES = 5;
19 VALUE_TYPE_BOOL_ARRAY = 6; 28 VALUE_TYPE_BOOL_ARRAY = 6;
20 VALUE_TYPE_INT64_ARRAY = 7; 29 VALUE_TYPE_INT64_ARRAY = 7;
(...skipping 29 matching lines...) Expand all
50 // Identify a single device policy setting key/value pair. 59 // Identify a single device policy setting key/value pair.
51 message DevicePolicySetting { 60 message DevicePolicySetting {
52 // key of the policy setting 61 // key of the policy setting
53 required string policy_key = 1; 62 required string policy_key = 1;
54 // value of the setting 63 // value of the setting
55 optional GenericSetting policy_value = 2; 64 optional GenericSetting policy_value = 2;
56 // watermark for setting value. 65 // watermark for setting value.
57 optional string watermark = 3; 66 optional string watermark = 3;
58 } 67 }
59 68
69 // Request for a setting or with optional watermark on client side.
70 message DevicePolicySettingRequest {
71 // setting key
72 required string key = 1;
73 // watermark last read from server if available.
74 optional string watermark = 2;
75 }
76
77 // Request from device to server to read device policies.
78 message DevicePolicyRequest {
79 // identify request scope: CrOS settings or other type of settings.
80 optional string policy_scope = 1;
81 // identify key to the settings: proxy etc.
82 repeated DevicePolicySettingRequest setting_request = 2;
83 }
84
85 // Response from server to agent for reading policies.
86 message DevicePolicyResponse {
87 // the result of the settings.
88 repeated DevicePolicySetting setting = 1;
89 }
90
91 // Protocol buffers for the new protocol:
92 // --------------------------------------
93
94 // Request from device to server to query if the authenticated user is in a
95 // managed domain.
96 message ManagedCheckRequest {
97 }
98
99 // Response from server to device indicating if the authenticated user is in a
100 // managed domain.
101 message ManagedCheckResponse {
102 enum Mode {
103 // The device must be enrolled for policies.
104 MANAGED = 1;
105 // The device is not automatically enrolled for policies, but the user
106 // may choose to try to enroll it.
107 UNMANAGED = 2;
108 }
109
110 optional Mode mode = 1;
111 }
112
60 // Request from device to server to register device. 113 // Request from device to server to register device.
61 message DeviceRegisterRequest { 114 message DeviceRegisterRequest {
62 // reregister device without erasing server state. 115 // reregister device without erasing server state.
63 // it can be used to refresh dmtoken etc. 116 // it can be used to refresh dmtoken etc.
64 optional bool reregister = 1; 117 optional bool reregister = 1;
65 } 118 }
66 119
67 // Response from server to device register request. 120 // Response from server to device register request.
68 message DeviceRegisterResponse { 121 message DeviceRegisterResponse {
69 // device mangement toke for this registration. 122 // device mangement toke for this registration.
70 required string device_management_token = 1; 123 required string device_management_token = 1;
124
125 // The name of the device, assigned by the server.
126 optional string device_name = 2;
71 } 127 }
72 128
73 // Request from device to server to unregister device. 129 // Request from device to server to unregister device.
74 message DeviceUnregisterRequest { 130 message DeviceUnregisterRequest {
75 } 131 }
76 132
77 // Response from server to device unregister request. 133 // Response from server to device unregister request.
78 message DeviceUnregisterResponse { 134 message DeviceUnregisterResponse {
79 } 135 }
80 136
81 // Request for a setting or with optional watermark on client side. 137 message CloudPolicyRequest {
82 message DevicePolicySettingRequest { 138 // Identify request scope: chromeos/device for device policies, chromeos/user
83 // setting key 139 // for user policies.
84 required string key = 1; 140 optional string policy_scope = 1;
85 // watermark last read from server if available. 141 // The device token of the owner of the device sending the request. In cases
86 optional string watermark = 2; 142 // the request was sent by the device owner or device policies were
143 // requested, this is the same as the token used for authentication.
144 // Otherwise (if the user policy is requested for someone else than the device
145 // owner) this token is different from the token used for authentication.
146 optional string device_token = 2;
87 } 147 }
88 148
89 // Request from device to server to read device policies. 149 // Response from server to device for reading policies.
90 message DevicePolicyRequest { 150 message CloudPolicyResponse {
91 // identify request scope: CrOS settings or other type of settings. 151 // Serialized SignedCloudPolicyResponse.
92 optional string policy_scope = 1; 152 optional bytes signed_response = 1;
93 // identify key to the settings: proxy etc. 153 // RSA signature of the SHA1 hash of the above data.
94 repeated DevicePolicySettingRequest setting_request = 2; 154 optional bytes signature = 2;
155 // The chain of DER-encoded X.509 certificates of the server's signing key.
156 // The first element should be the certificate whose private key was used
157 // for signing the response, and each of the following certificates signs the
158 // previous one.
159 repeated bytes certificate_chain = 3;
95 } 160 }
96 161 message SignedCloudPolicyResponse {
97 // Response from server to agent for reading policies. 162 // The following two are necessary against replay attacks.
98 message DevicePolicyResponse { 163 // |timestamp| is a unix timestamp (seconds since 1970).
99 // the result of the settings. 164 optional int64 timestamp = 1;
100 repeated DevicePolicySetting setting = 1; 165 // The token that was used for the request.
166 optional string request_token = 2;
167 // The name of the device, assigned by the server.
168 optional string device_name = 3;
169 // CloudPolicySettings is defined in cloud_policy.proto (which is
170 // auto-generated from chrome/app/policy_templates.json).
171 optional CloudPolicySettings settings = 4;
101 } 172 }
102 173
103 // Request from the DMAgent on the device to the DMServer. 174 // Request from the DMAgent on the device to the DMServer.
104 // This is container for all requests from client. 175 // This is container for all requests from client.
105 // 176 //
177 // Http Query parameters:
178 // Query parameters contain the following information in each request:
179 // request: register/unregister/policy/cloud_policy/managed_check etc.
180 // devicetype: CrOS/Android/Iphone etc.
181 // apptype: CrOS/AndroidDM etc.
182 // deviceid: unique id that identify the device.
183 // agent: identify agent on device.
184 //
106 // Authorization: 185 // Authorization:
107 // 1. If request is register_request, client must pass in GoogleLogin auth 186 // 1. If request is managed_check, client must pass in GoogleLogin auth
187 // cookie in Authorization header:
188 // Authorization: GoogleLogin auth=<auth cookie>
189 // This is the only case when the deviceid query parameter is set to empty.
190 // The response will contain a flag indicating if the user is in a managed
191 // domain or not. (We don't want to expose device ids of users not in
192 // managed domains.)
193 // 2. If request is register_request, client must pass in GoogleLogin auth
108 // cookie in Authorization header: 194 // cookie in Authorization header:
109 // Authorization: GoogleLogin auth=<auth cookie> 195 // Authorization: GoogleLogin auth=<auth cookie>
110 // The response will contain an unique DMToken for future requests. 196 // The response will contain an unique DMToken for future requests.
111 // Depending on domain policy, the request may need admin approval before 197 // Depending on domain policy, the request may need admin approval before
112 // DMToken is issued. 198 // DMToken is issued.
113 // 2. For other requests, client must pass in DMToken in Authorization header: 199 // 3. For other requests, client must pass in DMToken in Authorization header:
114 // Authorization: GoogleDMToken token=<google dm token> 200 // Authorization: GoogleDMToken token=<google dm token>
115 // 201 //
116 // Http Query parameters:
117 // Query parameters contain the following information in each request:
118 // request: register/unregister/policy etc.
119 // devicetype: CrOS/Android/Iphone etc.
120 // apptype: CrOS/AndroidDM etc.
121 // deviceid: unique id that identify the device.
122 // agent: identify agent on device.
123 message DeviceManagementRequest { 202 message DeviceManagementRequest {
124 // Register request. 203 // Register request.
125 optional DeviceRegisterRequest register_request = 1; 204 optional DeviceRegisterRequest register_request = 1;
126 205
127 // Unregister request. 206 // Unregister request.
128 optional DeviceUnregisterRequest unregister_request = 2; 207 optional DeviceUnregisterRequest unregister_request = 2;
129 208
130 // Data request. 209 // Data request.
131 optional DevicePolicyRequest policy_request = 3; 210 optional DevicePolicyRequest policy_request = 3;
211
212 // Data request (new protocol).
213 optional CloudPolicyRequest cloud_policy_request = 4;
214
215 // Request to check if a user is managed or not.
216 optional ManagedCheckRequest managed_check_request = 5;
132 } 217 }
133 218
134 // Response from server to device. 219 // Response from server to device.
135 message DeviceManagementResponse { 220 message DeviceManagementResponse {
136 // Error code to client. 221 // Error code to client.
137 enum ErrorCode { 222 enum ErrorCode {
138 SUCCESS = 0; 223 SUCCESS = 0;
139 // Returned for register request when device management is not supported 224 // Returned for register request when device management is not supported
140 // for the domain. 225 // for the domain.
141 DEVICE_MANAGEMENT_NOT_SUPPORTED = 1; 226 DEVICE_MANAGEMENT_NOT_SUPPORTED = 1;
(...skipping 15 matching lines...) Expand all
157 optional string error_message = 2; 242 optional string error_message = 2;
158 243
159 // Register response 244 // Register response
160 optional DeviceRegisterResponse register_response = 3; 245 optional DeviceRegisterResponse register_response = 3;
161 246
162 // Unregister response 247 // Unregister response
163 optional DeviceUnregisterResponse unregister_response = 4; 248 optional DeviceUnregisterResponse unregister_response = 4;
164 249
165 // Policy response. 250 // Policy response.
166 optional DevicePolicyResponse policy_response = 5; 251 optional DevicePolicyResponse policy_response = 5;
167 } 252
253 // Policy response (new protocol).
254 optional CloudPolicyResponse cloud_policy_response = 6;
255
256 // Response to managed check request.
257 optional ManagedCheckResponse managed_check_response = 7;
258 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/proto/cloud_policy.proto ('k') | chrome/browser/policy/proto/device_management_proto.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698