OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 #elif defined(OS_POSIX) | 45 #elif defined(OS_POSIX) |
46 typedef GSSAPILibrary AuthLibrary; | 46 typedef GSSAPILibrary AuthLibrary; |
47 typedef HttpAuthGSSAPI AuthSystem; | 47 typedef HttpAuthGSSAPI AuthSystem; |
48 #endif | 48 #endif |
49 | 49 |
50 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { | 50 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { |
51 public: | 51 public: |
52 Factory(); | 52 Factory(); |
53 ~Factory() override; | 53 ~Factory() override; |
54 | 54 |
55 // |disable_cname_lookup()| and |set_disable_cname_lookup()| get/set whether | 55 // |disable_cname_lookup()| gets whether |
56 // the auth handlers generated by this factory should skip looking up the | 56 // the auth handlers generated by this factory should skip looking up the |
57 // canonical DNS name of the the host that they are authenticating to when | 57 // canonical DNS name of the the host that they are authenticating to when |
58 // generating the SPN. The default value is false. | 58 // generating the SPN. The default value is false. |
59 bool disable_cname_lookup() const { return disable_cname_lookup_; } | 59 bool disable_cname_lookup() const { return disable_cname_lookup_; } |
60 void set_disable_cname_lookup(bool disable_cname_lookup) { | |
61 disable_cname_lookup_ = disable_cname_lookup; | |
62 } | |
63 | 60 |
64 // |use_port()| and |set_use_port()| get/set whether the auth handlers | 61 // |use_port()| gets whether the auth handlers |
65 // generated by this factory should include the port number of the server | 62 // generated by this factory should include the port number of the server |
66 // they are authenticating to when constructing a Kerberos SPN. The default | 63 // they are authenticating to when constructing a Kerberos SPN. The default |
67 // value is false. | 64 // value is false. |
68 bool use_port() const { return use_port_; } | 65 bool use_port() const { return use_port_; } |
69 void set_use_port(bool use_port) { use_port_ = use_port; } | |
70 | 66 |
71 void set_host_resolver(HostResolver* host_resolver); | 67 void set_host_resolver(HostResolver* host_resolver); |
72 | 68 |
73 // Sets the system library to use, thereby assuming ownership of | 69 // Sets the system library to use, thereby assuming ownership of |
74 // |auth_library|. | 70 // |auth_library|. |
75 void set_library(AuthLibrary* auth_provider) { | 71 void set_library(scoped_ptr<AuthLibrary> auth_provider) { |
76 auth_library_.reset(auth_provider); | 72 auth_library_ = auth_provider.Pass(); |
77 } | 73 } |
78 | 74 |
75 #if defined(OS_ANDROID) | |
76 // Only used for testing. | |
77 AuthLibrary* library() { return auth_library_.get(); } | |
78 #endif | |
79 | |
80 // HttpAuthHandlerFactory overrides | |
81 void SetNegotiateDisableCnameLookup(bool disable_cname_lookup) override; | |
82 void SetNegotiateEnablePort(bool use_port) override; | |
83 #if defined(OS_ANDROID) | |
84 void SetAndroidAuthNegotiateAccountType( | |
85 const std::string& account_type) override; | |
86 | |
asanka
2015/11/10 15:48:05
Nit: extra space
| |
87 #endif | |
88 | |
79 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 89 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
80 HttpAuth::Target target, | 90 HttpAuth::Target target, |
81 const GURL& origin, | 91 const GURL& origin, |
82 CreateReason reason, | 92 CreateReason reason, |
83 int digest_nonce_count, | 93 int digest_nonce_count, |
84 const BoundNetLog& net_log, | 94 const BoundNetLog& net_log, |
85 scoped_ptr<HttpAuthHandler>* handler) override; | 95 scoped_ptr<HttpAuthHandler>* handler) override; |
86 | 96 |
87 private: | 97 private: |
88 bool disable_cname_lookup_; | 98 bool disable_cname_lookup_; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 std::string* auth_token_; | 174 std::string* auth_token_; |
165 | 175 |
166 State next_state_; | 176 State next_state_; |
167 | 177 |
168 const URLSecurityManager* url_security_manager_; | 178 const URLSecurityManager* url_security_manager_; |
169 }; | 179 }; |
170 | 180 |
171 } // namespace net | 181 } // namespace net |
172 | 182 |
173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 183 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
OLD | NEW |