| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // support of the returned AuthorizationResult. If no headers were used for | 154 // support of the returned AuthorizationResult. If no headers were used for |
| 155 // the result (for example, all headers have unknown authentication schemes), | 155 // the result (for example, all headers have unknown authentication schemes), |
| 156 // the value is cleared. | 156 // the value is cleared. |
| 157 static AuthorizationResult HandleChallengeResponse( | 157 static AuthorizationResult HandleChallengeResponse( |
| 158 HttpAuthHandler* handler, | 158 HttpAuthHandler* handler, |
| 159 const HttpResponseHeaders* headers, | 159 const HttpResponseHeaders* headers, |
| 160 Target target, | 160 Target target, |
| 161 const std::set<Scheme>& disabled_schemes, | 161 const std::set<Scheme>& disabled_schemes, |
| 162 std::string* challenge_used); | 162 std::string* challenge_used); |
| 163 | 163 |
| 164 // Check whether cached credentials should be invalidated following |
| 165 // a rejected pre-emptive authentication attempt. |
| 166 // |
| 167 // |headers| must be non-NULL and contain the new HTTP response. |
| 168 // |
| 169 // |target| specifies whether the authentication challenge response |
| 170 // came from a proxy or a server. |
| 171 // |
| 172 // |handler| must be non-NULL and specifies the handler used to |
| 173 // generate the preemptive authentication header. |
| 174 static bool ShouldInvalidateRejectedAuth( |
| 175 const HttpResponseHeaders* headers, |
| 176 Target target, |
| 177 HttpAuthHandler* handler); |
| 178 |
| 164 // Breaks up a challenge string into the the auth scheme and parameter list, | 179 // Breaks up a challenge string into the the auth scheme and parameter list, |
| 165 // according to RFC 2617 Sec 1.2: | 180 // according to RFC 2617 Sec 1.2: |
| 166 // challenge = auth-scheme 1*SP 1#auth-param | 181 // challenge = auth-scheme 1*SP 1#auth-param |
| 167 // | 182 // |
| 168 // Depending on the challenge scheme, it may be appropriate to interpret the | 183 // Depending on the challenge scheme, it may be appropriate to interpret the |
| 169 // parameters as either a base-64 encoded string or a comma-delimited list | 184 // parameters as either a base-64 encoded string or a comma-delimited list |
| 170 // of name-value pairs. param_pairs() and base64_param() methods are provided | 185 // of name-value pairs. param_pairs() and base64_param() methods are provided |
| 171 // to support either usage. | 186 // to support either usage. |
| 172 class ChallengeTokenizer { | 187 class ChallengeTokenizer { |
| 173 public: | 188 public: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 std::string::const_iterator scheme_end_; | 223 std::string::const_iterator scheme_end_; |
| 209 | 224 |
| 210 std::string::const_iterator params_begin_; | 225 std::string::const_iterator params_begin_; |
| 211 std::string::const_iterator params_end_; | 226 std::string::const_iterator params_end_; |
| 212 }; | 227 }; |
| 213 }; | 228 }; |
| 214 | 229 |
| 215 } // namespace net | 230 } // namespace net |
| 216 | 231 |
| 217 #endif // NET_HTTP_HTTP_AUTH_H_ | 232 #endif // NET_HTTP_HTTP_AUTH_H_ |
| OLD | NEW |