| 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_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 "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // invoked, but |credentials| is only used during the initial call. | 70 // invoked, but |credentials| is only used during the initial call. |
| 71 // | 71 // |
| 72 // All other return codes indicate that there was a problem generating a | 72 // All other return codes indicate that there was a problem generating a |
| 73 // token, and the value of |*auth_token| is unspecified. | 73 // token, and the value of |*auth_token| is unspecified. |
| 74 int GenerateAuthToken(const AuthCredentials* credentials, | 74 int GenerateAuthToken(const AuthCredentials* credentials, |
| 75 const HttpRequestInfo* request, | 75 const HttpRequestInfo* request, |
| 76 const CompletionCallback& callback, | 76 const CompletionCallback& callback, |
| 77 std::string* auth_token); | 77 std::string* auth_token); |
| 78 | 78 |
| 79 // The authentication scheme as an enumerated value. | 79 // The authentication scheme as an enumerated value. |
| 80 HttpAuth::Scheme auth_scheme() const { | 80 HttpAuth::Scheme auth_scheme() const { return auth_scheme_; } |
| 81 return auth_scheme_; | |
| 82 } | |
| 83 | 81 |
| 84 // The realm, encoded as UTF-8. This may be empty. | 82 // The realm, encoded as UTF-8. This may be empty. |
| 85 const std::string& realm() const { | 83 const std::string& realm() const { return realm_; } |
| 86 return realm_; | |
| 87 } | |
| 88 | 84 |
| 89 // The challenge which was issued when creating the handler. | 85 // The challenge which was issued when creating the handler. |
| 90 const std::string challenge() const { | 86 const std::string challenge() const { return auth_challenge_; } |
| 91 return auth_challenge_; | |
| 92 } | |
| 93 | 87 |
| 94 // Numeric rank based on the challenge's security level. Higher | 88 // Numeric rank based on the challenge's security level. Higher |
| 95 // numbers are better. Used by HttpAuth::ChooseBestChallenge(). | 89 // numbers are better. Used by HttpAuth::ChooseBestChallenge(). |
| 96 int score() const { | 90 int score() const { return score_; } |
| 97 return score_; | |
| 98 } | |
| 99 | 91 |
| 100 HttpAuth::Target target() const { | 92 HttpAuth::Target target() const { return target_; } |
| 101 return target_; | |
| 102 } | |
| 103 | 93 |
| 104 // Returns the proxy or server which issued the authentication challenge | 94 // Returns the proxy or server which issued the authentication challenge |
| 105 // that this HttpAuthHandler is handling. The URL includes scheme, host, and | 95 // that this HttpAuthHandler is handling. The URL includes scheme, host, and |
| 106 // port, but does not include path. | 96 // port, but does not include path. |
| 107 const GURL& origin() const { | 97 const GURL& origin() const { return origin_; } |
| 108 return origin_; | |
| 109 } | |
| 110 | 98 |
| 111 // Returns true if the authentication scheme does not send the username and | 99 // Returns true if the authentication scheme does not send the username and |
| 112 // password in the clear. | 100 // password in the clear. |
| 113 bool encrypts_identity() const { | 101 bool encrypts_identity() const { |
| 114 return (properties_ & ENCRYPTS_IDENTITY) != 0; | 102 return (properties_ & ENCRYPTS_IDENTITY) != 0; |
| 115 } | 103 } |
| 116 | 104 |
| 117 // Returns true if the authentication scheme is connection-based, for | 105 // Returns true if the authentication scheme is connection-based, for |
| 118 // example, NTLM. A connection-based authentication scheme does not support | 106 // example, NTLM. A connection-based authentication scheme does not support |
| 119 // preemptive authentication, and must use the same handler object | 107 // preemptive authentication, and must use the same handler object |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 private: | 178 private: |
| 191 void OnGenerateAuthTokenComplete(int rv); | 179 void OnGenerateAuthTokenComplete(int rv); |
| 192 void FinishGenerateAuthToken(); | 180 void FinishGenerateAuthToken(); |
| 193 | 181 |
| 194 CompletionCallback callback_; | 182 CompletionCallback callback_; |
| 195 }; | 183 }; |
| 196 | 184 |
| 197 } // namespace net | 185 } // namespace net |
| 198 | 186 |
| 199 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ | 187 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ |
| OLD | NEW |