OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, | 208 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, |
209 const std::string &field_name, | 209 const std::string &field_name, |
210 int lower_bound, | 210 int lower_bound, |
211 int upper_bound); | 211 int upper_bound); |
212 | 212 |
213 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, | 213 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, |
214 const std::string& field_name); | 214 const std::string& field_name); |
215 | 215 |
216 bool RequireField(const base::DictionaryValue& dict, const std::string& key); | 216 bool RequireField(const base::DictionaryValue& dict, const std::string& key); |
217 | 217 |
218 bool CertPatternInDevicePolicy(const std::string& cert_type); | 218 // Prohibit certificate patterns for device policy ONC so that an unmanaged |
| 219 // user won't have a certificate presented for them involuntarily. |
| 220 bool IsCertPatternInDevicePolicy(const std::string& cert_type); |
| 221 |
| 222 // Prohibit global network configuration in user ONC imports. |
| 223 bool IsGlobalNetworkConfigInUserImport( |
| 224 const base::DictionaryValue& onc_object); |
219 | 225 |
220 std::string MessageHeader(); | 226 std::string MessageHeader(); |
221 | 227 |
222 const bool error_on_unknown_field_; | 228 const bool error_on_unknown_field_; |
223 const bool error_on_wrong_recommended_; | 229 const bool error_on_wrong_recommended_; |
224 const bool error_on_missing_field_; | 230 const bool error_on_missing_field_; |
225 const bool managed_onc_; | 231 const bool managed_onc_; |
226 | 232 |
227 ::onc::ONCSource onc_source_; | 233 ::onc::ONCSource onc_source_; |
228 | 234 |
229 // The path of field names and indices to the current value. Indices | 235 // The path of field names and indices to the current value. Indices |
230 // are stored as strings in decimal notation. | 236 // are stored as strings in decimal notation. |
231 std::vector<std::string> path_; | 237 std::vector<std::string> path_; |
232 | 238 |
233 // Tracks if an error or warning occurred within validation initiated by | 239 // Tracks if an error or warning occurred within validation initiated by |
234 // function ValidateAndRepairObject. | 240 // function ValidateAndRepairObject. |
235 bool error_or_warning_found_; | 241 bool error_or_warning_found_; |
236 | 242 |
237 DISALLOW_COPY_AND_ASSIGN(Validator); | 243 DISALLOW_COPY_AND_ASSIGN(Validator); |
238 }; | 244 }; |
239 | 245 |
240 } // namespace onc | 246 } // namespace onc |
241 } // namespace chromeos | 247 } // namespace chromeos |
242 | 248 |
243 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 249 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
OLD | NEW |