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_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_H_ |
6 #define NET_HTTP_HTTP_AUTH_H_ | 6 #define NET_HTTP_HTTP_AUTH_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "net/base/auth.h" | 12 #include "net/base/auth.h" |
13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
14 #include "net/http/http_util.h" | 14 #include "net/http/http_util.h" |
15 | 15 |
16 template <class T> class scoped_refptr; | 16 template <class T> class scoped_refptr; |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 class BoundNetLog; | 20 class NetLogWithSource; |
21 class HttpAuthHandler; | 21 class HttpAuthHandler; |
22 class HttpAuthHandlerFactory; | 22 class HttpAuthHandlerFactory; |
23 class HttpResponseHeaders; | 23 class HttpResponseHeaders; |
24 class SSLInfo; | 24 class SSLInfo; |
25 | 25 |
26 // Utility class for http authentication. | 26 // Utility class for http authentication. |
27 class NET_EXPORT_PRIVATE HttpAuth { | 27 class NET_EXPORT_PRIVATE HttpAuth { |
28 public: | 28 public: |
29 // Http authentication can be done the the proxy server, origin server, | 29 // Http authentication can be done the the proxy server, origin server, |
30 // or both. This enum tracks who the target is. | 30 // or both. This enum tracks who the target is. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // | 135 // |
136 // |ssl_info| is passed through to the scheme specific authentication handlers | 136 // |ssl_info| is passed through to the scheme specific authentication handlers |
137 // to use as appropriate. | 137 // to use as appropriate. |
138 static void ChooseBestChallenge( | 138 static void ChooseBestChallenge( |
139 HttpAuthHandlerFactory* http_auth_handler_factory, | 139 HttpAuthHandlerFactory* http_auth_handler_factory, |
140 const HttpResponseHeaders& response_headers, | 140 const HttpResponseHeaders& response_headers, |
141 const SSLInfo& ssl_info, | 141 const SSLInfo& ssl_info, |
142 Target target, | 142 Target target, |
143 const GURL& origin, | 143 const GURL& origin, |
144 const std::set<Scheme>& disabled_schemes, | 144 const std::set<Scheme>& disabled_schemes, |
145 const BoundNetLog& net_log, | 145 const NetLogWithSource& net_log, |
146 std::unique_ptr<HttpAuthHandler>* handler); | 146 std::unique_ptr<HttpAuthHandler>* handler); |
147 | 147 |
148 // Handle a 401/407 response from a server/proxy after a previous | 148 // Handle a 401/407 response from a server/proxy after a previous |
149 // authentication attempt. For connection-based authentication schemes, the | 149 // authentication attempt. For connection-based authentication schemes, the |
150 // new response may be another round in a multi-round authentication sequence. | 150 // new response may be another round in a multi-round authentication sequence. |
151 // For request-based schemes, a 401/407 response is typically treated like a | 151 // For request-based schemes, a 401/407 response is typically treated like a |
152 // rejection of the previous challenge, except in the Digest case when a | 152 // rejection of the previous challenge, except in the Digest case when a |
153 // "stale" attribute is present. | 153 // "stale" attribute is present. |
154 // | 154 // |
155 // |handler| must be non-NULL, and is the HttpAuthHandler from the previous | 155 // |handler| must be non-NULL, and is the HttpAuthHandler from the previous |
(...skipping 14 matching lines...) Expand all Loading... |
170 HttpAuthHandler* handler, | 170 HttpAuthHandler* handler, |
171 const HttpResponseHeaders& response_headers, | 171 const HttpResponseHeaders& response_headers, |
172 Target target, | 172 Target target, |
173 const std::set<Scheme>& disabled_schemes, | 173 const std::set<Scheme>& disabled_schemes, |
174 std::string* challenge_used); | 174 std::string* challenge_used); |
175 }; | 175 }; |
176 | 176 |
177 } // namespace net | 177 } // namespace net |
178 | 178 |
179 #endif // NET_HTTP_HTTP_AUTH_H_ | 179 #endif // NET_HTTP_HTTP_AUTH_H_ |
OLD | NEW |