OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_HTTP_HTTP_AUTH_PREFERENCES_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_PREFERENCES_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 #include "base/macros.h" |
| 11 #include "base/prefs/pref_member.h" |
| 12 #include "base/prefs/pref_registry_simple.h" |
| 13 #include "net/base/net_export.h" |
| 14 #include "url/gurl.h" |
| 15 |
| 16 namespace net { |
| 17 |
| 18 class URLSecurityManager; |
| 19 /* |
| 20 * Manage the preferences needed for authentication, and provide a cache of them |
| 21 * accessible from the IO thread. |
| 22 */ |
| 23 class NET_EXPORT HttpAuthPreferences { |
| 24 public: |
| 25 HttpAuthPreferences(); |
| 26 virtual ~HttpAuthPreferences(); |
| 27 |
| 28 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 29 |
| 30 void Init(PrefService* local_state, |
| 31 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 32 |
| 33 virtual std::vector<std::string> auth_schemes() const; |
| 34 virtual bool negotiate_disable_cname_lookup() const; |
| 35 virtual bool negotiate_enable_port() const; |
| 36 #if defined(OS_ANDROID) |
| 37 virtual std::string auth_android_negotiate_account_type() const; |
| 38 #endif |
| 39 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
| 40 virtual std::string gssapi_library_name() const; |
| 41 #endif |
| 42 virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const; |
| 43 virtual bool CanDelegate(const GURL& auth_origin) const; |
| 44 |
| 45 private: |
| 46 void UpdateServerWhitelist(); |
| 47 void UpdateDelegateWhitelist(); |
| 48 |
| 49 // TODO(aberent) Make the list of auth schemes a PrefMember, so that the |
| 50 // policy can change after startup (https://crbug/549273). |
| 51 std::vector<std::string> auth_schemes_; |
| 52 BooleanPrefMember negotiate_disable_cname_lookup_; |
| 53 BooleanPrefMember negotiate_enable_port_; |
| 54 |
| 55 StringPrefMember server_whitelist_; |
| 56 StringPrefMember delegate_whitelist_; |
| 57 #if defined(OS_ANDROID) |
| 58 StringPrefMember auth_android_negotiate_account_type_; |
| 59 #endif |
| 60 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
| 61 // No PrefMember for the GSSAPI library name, since changing it after startup |
| 62 // requires unloading the existing GSSAPI library, which could cause all sorts |
| 63 // of problems for, for example, active Negotiate transactions. |
| 64 std::string gssapi_library_name_; |
| 65 #endif |
| 66 scoped_ptr<URLSecurityManager> security_manager_; |
| 67 DISALLOW_COPY_AND_ASSIGN(HttpAuthPreferences); |
| 68 }; |
| 69 } |
| 70 // namespace net |
| 71 #endif // NET_HTTP_HTTP_AUTH_PREFERENCES_H_ |
OLD | NEW |