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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "net/base/net_api.h" | 14 #include "net/base/net_export.h" |
15 #include "net/http/http_util.h" | 15 #include "net/http/http_util.h" |
16 | 16 |
17 template <class T> class scoped_refptr; | 17 template <class T> class scoped_refptr; |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 class BoundNetLog; | 21 class BoundNetLog; |
22 class HttpAuthHandler; | 22 class HttpAuthHandler; |
23 class HttpAuthHandlerFactory; | 23 class HttpAuthHandlerFactory; |
24 class HttpResponseHeaders; | 24 class HttpResponseHeaders; |
25 | 25 |
26 // Utility class for http authentication. | 26 // Utility class for http authentication. |
27 class NET_TEST 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. |
31 enum Target { | 31 enum Target { |
32 AUTH_NONE = -1, | 32 AUTH_NONE = -1, |
33 // We depend on the valid targets (!= AUTH_NONE) being usable as indexes | 33 // We depend on the valid targets (!= AUTH_NONE) being usable as indexes |
34 // in an array, so start from 0. | 34 // in an array, so start from 0. |
35 AUTH_PROXY = 0, | 35 AUTH_PROXY = 0, |
36 AUTH_SERVER = 1, | 36 AUTH_SERVER = 1, |
37 AUTH_NUM_TARGETS = 2, | 37 AUTH_NUM_TARGETS = 2, |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 std::string* challenge_used); | 170 std::string* challenge_used); |
171 | 171 |
172 // Breaks up a challenge string into the the auth scheme and parameter list, | 172 // Breaks up a challenge string into the the auth scheme and parameter list, |
173 // according to RFC 2617 Sec 1.2: | 173 // according to RFC 2617 Sec 1.2: |
174 // challenge = auth-scheme 1*SP 1#auth-param | 174 // challenge = auth-scheme 1*SP 1#auth-param |
175 // | 175 // |
176 // Depending on the challenge scheme, it may be appropriate to interpret the | 176 // Depending on the challenge scheme, it may be appropriate to interpret the |
177 // parameters as either a base-64 encoded string or a comma-delimited list | 177 // parameters as either a base-64 encoded string or a comma-delimited list |
178 // of name-value pairs. param_pairs() and base64_param() methods are provided | 178 // of name-value pairs. param_pairs() and base64_param() methods are provided |
179 // to support either usage. | 179 // to support either usage. |
180 class NET_TEST ChallengeTokenizer { | 180 class NET_EXPORT_PRIVATE ChallengeTokenizer { |
181 public: | 181 public: |
182 ChallengeTokenizer(std::string::const_iterator begin, | 182 ChallengeTokenizer(std::string::const_iterator begin, |
183 std::string::const_iterator end) | 183 std::string::const_iterator end) |
184 : begin_(begin), | 184 : begin_(begin), |
185 end_(end), | 185 end_(end), |
186 scheme_begin_(begin), | 186 scheme_begin_(begin), |
187 scheme_end_(begin), | 187 scheme_end_(begin), |
188 params_begin_(end), | 188 params_begin_(end), |
189 params_end_(end) { | 189 params_end_(end) { |
190 Init(begin, end); | 190 Init(begin, end); |
(...skipping 25 matching lines...) Expand all Loading... |
216 std::string::const_iterator scheme_end_; | 216 std::string::const_iterator scheme_end_; |
217 | 217 |
218 std::string::const_iterator params_begin_; | 218 std::string::const_iterator params_begin_; |
219 std::string::const_iterator params_end_; | 219 std::string::const_iterator params_end_; |
220 }; | 220 }; |
221 }; | 221 }; |
222 | 222 |
223 } // namespace net | 223 } // namespace net |
224 | 224 |
225 #endif // NET_HTTP_HTTP_AUTH_H_ | 225 #endif // NET_HTTP_HTTP_AUTH_H_ |
OLD | NEW |