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 CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 enum ValidateDMTokenOption { | 72 enum ValidateDMTokenOption { |
73 // The policy must have a non-empty DMToken. | 73 // The policy must have a non-empty DMToken. |
74 DM_TOKEN_REQUIRED, | 74 DM_TOKEN_REQUIRED, |
75 | 75 |
76 // The policy may have an empty or missing DMToken, if the expected token | 76 // The policy may have an empty or missing DMToken, if the expected token |
77 // is also empty. | 77 // is also empty. |
78 DM_TOKEN_NOT_REQUIRED, | 78 DM_TOKEN_NOT_REQUIRED, |
79 }; | 79 }; |
80 | 80 |
81 enum ValidateTimestampOption { | 81 enum ValidateTimestampOption { |
82 // The policy must have a timestamp field. | 82 // The policy must have a timestamp field and it should be checked against |
83 // both the start and end times. | |
83 TIMESTAMP_REQUIRED, | 84 TIMESTAMP_REQUIRED, |
84 | 85 |
86 // The system time is unreliable so we should not validate against the | |
87 // system timestamp. | |
88 TIMESTAMP_REQUIRED_BUT_SYSTEM_TIME_UNRELIABLE, | |
Mattias Nissler (ping if slow)
2013/09/09 08:00:41
Naming here is a bit unfortunate given that this c
| |
89 | |
85 // No timestamp field is required. | 90 // No timestamp field is required. |
86 TIMESTAMP_NOT_REQUIRED, | 91 TIMESTAMP_NOT_REQUIRED, |
87 }; | 92 }; |
88 | 93 |
89 virtual ~CloudPolicyValidatorBase(); | 94 virtual ~CloudPolicyValidatorBase(); |
90 | 95 |
91 // Validation status which can be read after completion has been signaled. | 96 // Validation status which can be read after completion has been signaled. |
92 Status status() const { return status_; } | 97 Status status() const { return status_; } |
93 bool success() const { return status_ == VALIDATION_OK; } | 98 bool success() const { return status_ == VALIDATION_OK; } |
94 | 99 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 }; | 282 }; |
278 | 283 |
279 typedef CloudPolicyValidator<enterprise_management::CloudPolicySettings> | 284 typedef CloudPolicyValidator<enterprise_management::CloudPolicySettings> |
280 UserCloudPolicyValidator; | 285 UserCloudPolicyValidator; |
281 typedef CloudPolicyValidator<enterprise_management::ExternalPolicyData> | 286 typedef CloudPolicyValidator<enterprise_management::ExternalPolicyData> |
282 ComponentCloudPolicyValidator; | 287 ComponentCloudPolicyValidator; |
283 | 288 |
284 } // namespace policy | 289 } // namespace policy |
285 | 290 |
286 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_ | 291 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_VALIDATOR_H_ |
OLD | NEW |