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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 // |digest_nonce_count| is specifically intended for the Digest authentication | 72 // |digest_nonce_count| is specifically intended for the Digest authentication |
73 // scheme, and indicates the number of handlers generated for a particular | 73 // scheme, and indicates the number of handlers generated for a particular |
74 // server nonce challenge. | 74 // server nonce challenge. |
75 // | 75 // |
76 // For the NTLM and Negotiate handlers: | 76 // For the NTLM and Negotiate handlers: |
77 // If |origin| does not match the authentication method's filters for | 77 // If |origin| does not match the authentication method's filters for |
78 // the specified |target|, ERR_INVALID_AUTH_CREDENTIALS is returned. | 78 // the specified |target|, ERR_INVALID_AUTH_CREDENTIALS is returned. |
79 // NOTE: This will apply to ALL |origin| values if the filters are empty. | 79 // NOTE: This will apply to ALL |origin| values if the filters are empty. |
80 // | 80 // |
81 // |*challenge| should not be reused after a call to |CreateAuthHandler()|, | 81 // |*challenge| should not be reused after a call to |CreateAuthHandler()|, |
82 // | |
83 // TODO(asanka): Update comment. | |
Ryan Sleevi
2016/03/18 21:27:40
*cough*? ;)
asanka
2016/03/23 04:51:30
:-P
Comments updated here and elsewhere.
| |
82 virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 84 virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
83 HttpAuth::Target target, | 85 HttpAuth::Target target, |
86 const HttpResponseInfo& response_info, | |
84 const GURL& origin, | 87 const GURL& origin, |
85 CreateReason create_reason, | 88 CreateReason create_reason, |
86 int digest_nonce_count, | 89 int digest_nonce_count, |
87 const BoundNetLog& net_log, | 90 const BoundNetLog& net_log, |
88 scoped_ptr<HttpAuthHandler>* handler) = 0; | 91 scoped_ptr<HttpAuthHandler>* handler) = 0; |
89 | 92 |
90 // Creates an HTTP authentication handler based on the authentication | 93 // Creates an HTTP authentication handler based on the authentication |
91 // challenge string |challenge|. | 94 // challenge string |challenge|. |
92 // This is a convenience function which creates a ChallengeTokenizer for | 95 // This is a convenience function which creates a ChallengeTokenizer for |
93 // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for | 96 // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for |
94 // more details on return values. | 97 // more details on return values. |
98 // | |
99 // TODO(asanka): Update comment. | |
Ryan Sleevi
2016/03/18 21:27:40
*cough* ;)
| |
95 int CreateAuthHandlerFromString(const std::string& challenge, | 100 int CreateAuthHandlerFromString(const std::string& challenge, |
96 HttpAuth::Target target, | 101 HttpAuth::Target target, |
102 const HttpResponseInfo& response_info, | |
97 const GURL& origin, | 103 const GURL& origin, |
98 const BoundNetLog& net_log, | 104 const BoundNetLog& net_log, |
99 scoped_ptr<HttpAuthHandler>* handler); | 105 scoped_ptr<HttpAuthHandler>* handler); |
100 | 106 |
101 // Creates an HTTP authentication handler based on the authentication | 107 // Creates an HTTP authentication handler based on the authentication |
102 // challenge string |challenge|. | 108 // challenge string |challenge|. |
103 // This is a convenience function which creates a ChallengeTokenizer for | 109 // This is a convenience function which creates a ChallengeTokenizer for |
104 // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for | 110 // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for |
105 // more details on return values. | 111 // more details on return values. |
106 int CreatePreemptiveAuthHandlerFromString( | 112 int CreatePreemptiveAuthHandlerFromString( |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 // CNAME lookups to generate a Kerberos SPN for the server. If the "negotiate" | 176 // CNAME lookups to generate a Kerberos SPN for the server. If the "negotiate" |
171 // scheme is used and |negotiate_disable_cname_lookup| is false, | 177 // scheme is used and |negotiate_disable_cname_lookup| is false, |
172 // |host_resolver| must not be NULL. | 178 // |host_resolver| must not be NULL. |
173 static scoped_ptr<HttpAuthHandlerRegistryFactory> Create( | 179 static scoped_ptr<HttpAuthHandlerRegistryFactory> Create( |
174 const HttpAuthPreferences* prefs, | 180 const HttpAuthPreferences* prefs, |
175 HostResolver* host_resolver); | 181 HostResolver* host_resolver); |
176 // Creates an auth handler by dispatching out to the registered factories | 182 // Creates an auth handler by dispatching out to the registered factories |
177 // based on the first token in |challenge|. | 183 // based on the first token in |challenge|. |
178 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 184 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
179 HttpAuth::Target target, | 185 HttpAuth::Target target, |
186 const HttpResponseInfo& response_info, | |
180 const GURL& origin, | 187 const GURL& origin, |
181 CreateReason reason, | 188 CreateReason reason, |
182 int digest_nonce_count, | 189 int digest_nonce_count, |
183 const BoundNetLog& net_log, | 190 const BoundNetLog& net_log, |
184 scoped_ptr<HttpAuthHandler>* handler) override; | 191 scoped_ptr<HttpAuthHandler>* handler) override; |
185 | 192 |
186 private: | 193 private: |
187 using FactoryMap = std::map<std::string, scoped_ptr<HttpAuthHandlerFactory>>; | 194 using FactoryMap = std::map<std::string, scoped_ptr<HttpAuthHandlerFactory>>; |
188 | 195 |
189 FactoryMap factory_map_; | 196 FactoryMap factory_map_; |
190 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); | 197 DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory); |
191 }; | 198 }; |
192 | 199 |
193 } // namespace net | 200 } // namespace net |
194 | 201 |
195 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ | 202 #endif // NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_ |
OLD | NEW |