Chromium Code Reviews| 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_CHROMEOS_POLICY_USER_CLOUD_POLICY_STORE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_STORE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_STORE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_STORE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace chromeos { | 26 namespace chromeos { |
| 27 class CryptohomeClient; | 27 class CryptohomeClient; |
| 28 class SessionManagerClient; | 28 class SessionManagerClient; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace policy { | 31 namespace policy { |
| 32 | 32 |
| 33 // Implements a cloud policy store backed by the Chrome OS' session_manager, | 33 // Implements a policy store backed by the Chrome OS' session_manager, which |
| 34 // which takes care of persisting policy to disk and is accessed via DBus calls | 34 // takes care of persisting policy to disk and is accessed via DBus calls |
| 35 // through SessionManagerClient. | 35 // through SessionManagerClient. |
| 36 class UserCloudPolicyStoreChromeOS : public UserCloudPolicyStoreBase { | 36 class UserCloudPolicyStoreChromeOS : public UserCloudPolicyStoreBase { |
|
emaxx
2016/12/28 19:09:20
nit: Is there a TODO somewhere to rename this clas
Thiemo Nagel
2016/12/29 15:08:27
Done.
| |
| 37 public: | 37 public: |
| 38 // Policy validation is relaxed when |is_active_directory| is set, most | |
| 39 // notably signature validation is disabled. It is essential that this flag | |
| 40 // is only set when install attributes are locked into Active Directory mode. | |
| 38 UserCloudPolicyStoreChromeOS( | 41 UserCloudPolicyStoreChromeOS( |
| 39 chromeos::CryptohomeClient* cryptohome_client, | 42 chromeos::CryptohomeClient* cryptohome_client, |
| 40 chromeos::SessionManagerClient* session_manager_client, | 43 chromeos::SessionManagerClient* session_manager_client, |
| 41 scoped_refptr<base::SequencedTaskRunner> background_task_runner, | 44 scoped_refptr<base::SequencedTaskRunner> background_task_runner, |
| 42 const AccountId& account_id, | 45 const AccountId& account_id, |
| 43 const base::FilePath& user_policy_key_dir); | 46 const base::FilePath& user_policy_key_dir, |
|
emaxx
2016/12/28 19:09:20
This argument is probably unused for the Active Di
Thiemo Nagel
2016/12/29 15:08:27
I've added this thought to the TODO above. (I hav
| |
| 47 bool is_active_directory); | |
| 44 ~UserCloudPolicyStoreChromeOS() override; | 48 ~UserCloudPolicyStoreChromeOS() override; |
| 45 | 49 |
| 46 // CloudPolicyStore: | 50 // CloudPolicyStore: |
| 47 void Store(const enterprise_management::PolicyFetchResponse& policy) override; | 51 void Store(const enterprise_management::PolicyFetchResponse& policy) override; |
| 48 void Load() override; | 52 void Load() override; |
| 49 | 53 |
| 50 // Loads the policy synchronously on the current thread. | 54 // Loads the policy synchronously on the current thread. |
| 51 void LoadImmediately(); | 55 void LoadImmediately(); |
| 52 | 56 |
| 53 private: | 57 private: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 chromeos::DBusMethodCallStatus call_status, | 97 chromeos::DBusMethodCallStatus call_status, |
| 94 const std::string& sanitized_username); | 98 const std::string& sanitized_username); |
| 95 | 99 |
| 96 std::unique_ptr<UserCloudPolicyValidator> CreateValidatorForLoad( | 100 std::unique_ptr<UserCloudPolicyValidator> CreateValidatorForLoad( |
| 97 std::unique_ptr<enterprise_management::PolicyFetchResponse> policy); | 101 std::unique_ptr<enterprise_management::PolicyFetchResponse> policy); |
| 98 | 102 |
| 99 chromeos::CryptohomeClient* cryptohome_client_; | 103 chromeos::CryptohomeClient* cryptohome_client_; |
| 100 chromeos::SessionManagerClient* session_manager_client_; | 104 chromeos::SessionManagerClient* session_manager_client_; |
| 101 const AccountId account_id_; | 105 const AccountId account_id_; |
| 102 base::FilePath user_policy_key_dir_; | 106 base::FilePath user_policy_key_dir_; |
| 107 bool is_active_directory_; | |
| 103 | 108 |
| 104 // The current key used to verify signatures of policy. This value is loaded | 109 // The current key used to verify signatures of policy. This value is loaded |
| 105 // from the key cache file (which is owned and kept up to date by the Chrome | 110 // from the key cache file (which is owned and kept up to date by the Chrome |
| 106 // OS session manager). This is, generally, different from | 111 // OS session manager). This is, generally, different from |
| 107 // |policy_signature_public_key_|, which always corresponds to the currently | 112 // |policy_signature_public_key_|, which always corresponds to the currently |
| 108 // effective policy. | 113 // effective policy. |
| 109 std::string cached_policy_key_; | 114 std::string cached_policy_key_; |
| 110 bool cached_policy_key_loaded_ = false; | 115 bool cached_policy_key_loaded_ = false; |
| 111 base::FilePath cached_policy_key_path_; | 116 base::FilePath cached_policy_key_path_; |
| 112 | 117 |
| 113 base::WeakPtrFactory<UserCloudPolicyStoreChromeOS> weak_factory_; | 118 base::WeakPtrFactory<UserCloudPolicyStoreChromeOS> weak_factory_; |
| 114 | 119 |
| 115 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyStoreChromeOS); | 120 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyStoreChromeOS); |
| 116 }; | 121 }; |
| 117 | 122 |
| 118 } // namespace policy | 123 } // namespace policy |
| 119 | 124 |
| 120 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_STORE_CHROMEOS_H_ | 125 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_STORE_CHROMEOS_H_ |
| OLD | NEW |