| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_HANDLER_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool is_connection_based() const { | 61 bool is_connection_based() const { |
| 62 return (properties_ & IS_CONNECTION_BASED) != 0; | 62 return (properties_ & IS_CONNECTION_BASED) != 0; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Returns true if the response to the current authentication challenge | 65 // Returns true if the response to the current authentication challenge |
| 66 // requires an identity. | 66 // requires an identity. |
| 67 // TODO(wtc): Find a better way to handle a multi-round challenge-response | 67 // TODO(wtc): Find a better way to handle a multi-round challenge-response |
| 68 // sequence used by a connection-based authentication scheme. | 68 // sequence used by a connection-based authentication scheme. |
| 69 virtual bool NeedsIdentity() { return true; } | 69 virtual bool NeedsIdentity() { return true; } |
| 70 | 70 |
| 71 // Returns true if this is the final round of the authentication sequence. |
| 72 // For Basic and Digest, the method always returns true because they are |
| 73 // single-round schemes. |
| 74 virtual bool IsFinalRound() { return true; } |
| 75 |
| 71 // Generate the Authorization header value. | 76 // Generate the Authorization header value. |
| 72 virtual std::string GenerateCredentials(const std::wstring& username, | 77 virtual std::string GenerateCredentials(const std::wstring& username, |
| 73 const std::wstring& password, | 78 const std::wstring& password, |
| 74 const HttpRequestInfo* request, | 79 const HttpRequestInfo* request, |
| 75 const ProxyInfo* proxy) = 0; | 80 const ProxyInfo* proxy) = 0; |
| 76 | 81 |
| 77 protected: | 82 protected: |
| 78 enum Property { | 83 enum Property { |
| 79 ENCRYPTS_IDENTITY = 1 << 0, | 84 ENCRYPTS_IDENTITY = 1 << 0, |
| 80 IS_CONNECTION_BASED = 1 << 1, | 85 IS_CONNECTION_BASED = 1 << 1, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 99 // origin server. | 104 // origin server. |
| 100 HttpAuth::Target target_; | 105 HttpAuth::Target target_; |
| 101 | 106 |
| 102 // A bitmask of the properties of the authentication scheme. | 107 // A bitmask of the properties of the authentication scheme. |
| 103 int properties_; | 108 int properties_; |
| 104 }; | 109 }; |
| 105 | 110 |
| 106 } // namespace net | 111 } // namespace net |
| 107 | 112 |
| 108 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ | 113 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ |
| OLD | NEW |