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_FACTORY_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // |digest_nonce_count| is specifically intended for the Digest authentication | 67 // |digest_nonce_count| is specifically intended for the Digest authentication |
68 // scheme, and indicates the number of handlers generated for a particular | 68 // scheme, and indicates the number of handlers generated for a particular |
69 // server nonce challenge. | 69 // server nonce challenge. |
70 // | 70 // |
71 // For the NTLM and Negotiate handlers: | 71 // For the NTLM and Negotiate handlers: |
72 // If |origin| does not match the authentication method's filters for | 72 // If |origin| does not match the authentication method's filters for |
73 // the specified |target|, ERR_INVALID_AUTH_CREDENTIALS is returned. | 73 // the specified |target|, ERR_INVALID_AUTH_CREDENTIALS is returned. |
74 // NOTE: This will apply to ALL |origin| values if the filters are empty. | 74 // NOTE: This will apply to ALL |origin| values if the filters are empty. |
75 // | 75 // |
76 // |*challenge| should not be reused after a call to |CreateAuthHandler()|, | 76 // |*challenge| should not be reused after a call to |CreateAuthHandler()|, |
77 virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 77 virtual int CreateAuthHandler(const HttpAuthChallengeTokenizer& challenge, |
78 HttpAuth::Target target, | 78 HttpAuth::Target target, |
79 const GURL& origin, | 79 const GURL& origin, |
80 CreateReason create_reason, | 80 CreateReason create_reason, |
81 int digest_nonce_count, | 81 int digest_nonce_count, |
82 const BoundNetLog& net_log, | 82 const BoundNetLog& net_log, |
83 scoped_ptr<HttpAuthHandler>* handler) = 0; | 83 scoped_ptr<HttpAuthHandler>* handler) = 0; |
84 | 84 |
85 // Creates an HTTP authentication handler based on the authentication | 85 // Creates an HTTP authentication handler based on the authentication |
86 // challenge string |challenge|. | 86 // challenge string |challenge|. |
87 // This is a convenience function which creates a ChallengeTokenizer for | 87 // This is a convenience function which creates a ChallengeTokenizer for |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 const std::vector<std::string>& supported_schemes, | 183 const std::vector<std::string>& supported_schemes, |
184 URLSecurityManager* security_manager, | 184 URLSecurityManager* security_manager, |
185 HostResolver* host_resolver, | 185 HostResolver* host_resolver, |
186 const std::string& gssapi_library_name, | 186 const std::string& gssapi_library_name, |
187 const std::string& auth_android_negotiate_account_type, | 187 const std::string& auth_android_negotiate_account_type, |
188 bool negotiate_disable_cname_lookup, | 188 bool negotiate_disable_cname_lookup, |
189 bool negotiate_enable_port); | 189 bool negotiate_enable_port); |
190 | 190 |
191 // Create an auth handler by dispatching the CreateAuthHandler() call to the | 191 // Create an auth handler by dispatching the CreateAuthHandler() call to the |
192 // factory registered to handle challenge->scheme(). | 192 // factory registered to handle challenge->scheme(). |
193 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 193 int CreateAuthHandler(const HttpAuthChallengeTokenizer& challenge, |
194 HttpAuth::Target target, | 194 HttpAuth::Target target, |
195 const GURL& origin, | 195 const GURL& origin, |
196 CreateReason reason, | 196 CreateReason reason, |
197 int digest_nonce_count, | 197 int digest_nonce_count, |
198 const BoundNetLog& net_log, | 198 const BoundNetLog& net_log, |
199 scoped_ptr<HttpAuthHandler>* handler) override; | 199 scoped_ptr<HttpAuthHandler>* handler) override; |
200 | 200 |
201 private: | 201 private: |
202 typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap; | 202 typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap; |
203 | 203 |
204 FactoryMap factory_map_; | 204 FactoryMap factory_map_; |
205 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); | 205 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); |
206 }; | 206 }; |
207 | 207 |
208 } // namespace net | 208 } // namespace net |
209 | 209 |
210 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ | 210 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
OLD | NEW |