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

Unified Diff: chromeos/network/onc/onc_validator.h

Issue 11578052: Replace OncNetworkParser by the new ONC translator. (Closed) Base URL: http://git.chromium.org/chromium/src.git@extend_onc_to_shill
Patch Set: Rebased. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_test_utils.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_validator.h
diff --git a/chromeos/network/onc/onc_validator.h b/chromeos/network/onc/onc_validator.h
index 974cb54b1b0be7dd581c6f698054ca5e338fb139..f928f3d823f517f556f0c299b3b6bf4a3a79b3d5 100644
--- a/chromeos/network/onc/onc_validator.h
+++ b/chromeos/network/onc/onc_validator.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "chromeos/chromeos_export.h"
+#include "chromeos/network/onc/onc_constants.h"
#include "chromeos/network/onc/onc_mapper.h"
namespace base {
@@ -67,6 +68,15 @@ class CHROMEOS_EXPORT Validator : public Mapper {
virtual ~Validator();
+ // Sets the ONC source to |source|. If not set, defaults to ONC_SOURCE_NONE.
+ // If the source is set to ONC_SOURCE_DEVICE_POLICY, validation additionally
+ // checks:
+ // - only the network types Wifi and Ethernet are allowed
+ // - client certificate patterns are disallowed
+ void SetOncSource(ONCSource source) {
+ onc_source_ = source;
+ }
+
// Validate the given |onc_object| according to |object_signature|. The
// |object_signature| has to be a pointer to one of the signatures in
// |onc_signature.h|. If an error is found, the function returns NULL and sets
@@ -202,6 +212,8 @@ class CHROMEOS_EXPORT Validator : public Mapper {
bool RequireField(const base::DictionaryValue& dict, const std::string& key);
+ bool CertPatternInDevicePolicy(const std::string& cert_type);
+
std::string WarningHeader();
std::string ErrorHeader();
std::string MessageHeader(bool is_error);
@@ -211,6 +223,8 @@ class CHROMEOS_EXPORT Validator : public Mapper {
const bool error_on_missing_field_;
const bool managed_onc_;
+ ONCSource onc_source_;
+
// The path of field names and indices to the current value. Indices
// are stored as strings in decimal notation.
std::vector<std::string> path_;
« no previous file with comments | « chromeos/network/onc/onc_test_utils.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698