Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_TEST_LOCAL_POLICY_TEST_SERVER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_ |
| 6 #define CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_ | 6 #define CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 explicit LocalPolicyTestServer(const std::string& test_name); | 37 explicit LocalPolicyTestServer(const std::string& test_name); |
| 38 | 38 |
| 39 ~LocalPolicyTestServer() override; | 39 ~LocalPolicyTestServer() override; |
| 40 | 40 |
| 41 // Sets the policy signing key and verification signature used by the server. | 41 // Sets the policy signing key and verification signature used by the server. |
| 42 // This must be called before starting the server, and only works when the | 42 // This must be called before starting the server, and only works when the |
| 43 // server serves from a temporary directory. | 43 // server serves from a temporary directory. |
| 44 bool SetSigningKeyAndSignature(const crypto::RSAPrivateKey* key, | 44 bool SetSigningKeyAndSignature(const crypto::RSAPrivateKey* key, |
| 45 const std::string& signature); | 45 const std::string& signature); |
| 46 | 46 |
| 47 // Enables the automatic rotation of the policy signing keys. This must be | |
| 48 // called before starting the server, and only works when the server serves | |
| 49 // from a temporary directory. | |
| 50 void SetSigningKeysAutomaticRotation(); | |
|
Andrew T Wilson (Slow)
2016/11/25 14:50:09
I think "EnableAutomaticRotationOfSigningKeys()" i
emaxx
2016/11/25 16:17:38
Done.
| |
| 51 | |
| 47 // Pre-configures a registered client so the server returns policy without the | 52 // Pre-configures a registered client so the server returns policy without the |
| 48 // client having to make a registration call. This must be called before | 53 // client having to make a registration call. This must be called before |
| 49 // starting the server, and only works when the server serves from a temporary | 54 // starting the server, and only works when the server serves from a temporary |
| 50 // directory. | 55 // directory. |
| 51 void RegisterClient(const std::string& dm_token, | 56 void RegisterClient(const std::string& dm_token, |
| 52 const std::string& device_id); | 57 const std::string& device_id); |
| 53 | 58 |
| 54 // Updates policy served by the server for a given (type, entity_id) pair. | 59 // Updates policy served by the server for a given (type, entity_id) pair. |
| 55 // This only works when the server serves from a temporary directory. | 60 // This only works when the server serves from a temporary directory. |
| 56 // | 61 // |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 86 base::DictionaryValue* arguments) const override; | 91 base::DictionaryValue* arguments) const override; |
| 87 | 92 |
| 88 private: | 93 private: |
| 89 std::string GetSelector(const std::string& type, | 94 std::string GetSelector(const std::string& type, |
| 90 const std::string& entity_id); | 95 const std::string& entity_id); |
| 91 | 96 |
| 92 base::FilePath config_file_; | 97 base::FilePath config_file_; |
| 93 base::FilePath policy_key_; | 98 base::FilePath policy_key_; |
| 94 base::DictionaryValue clients_; | 99 base::DictionaryValue clients_; |
| 95 base::ScopedTempDir server_data_dir_; | 100 base::ScopedTempDir server_data_dir_; |
| 101 bool signing_keys_automatic_rotation_ = false; | |
| 96 | 102 |
| 97 DISALLOW_COPY_AND_ASSIGN(LocalPolicyTestServer); | 103 DISALLOW_COPY_AND_ASSIGN(LocalPolicyTestServer); |
| 98 }; | 104 }; |
| 99 | 105 |
| 100 } // namespace policy | 106 } // namespace policy |
| 101 | 107 |
| 102 #endif // CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_ | 108 #endif // CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_ |
| OLD | NEW |