summaryrefslogtreecommitdiffstats
path: root/net/base/auth.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 13:12:04 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 13:12:04 +0000
commit79cb5c1739afa979cb0d5aa3701f128c6a50dde5 (patch)
tree8e46e6ee56d1b0a8b339a358a2418a83f354a436 /net/base/auth.h
parent89b1769644f8a140ef663db69156a651422f50db (diff)
downloadchromium_src-79cb5c1739afa979cb0d5aa3701f128c6a50dde5.zip
chromium_src-79cb5c1739afa979cb0d5aa3701f128c6a50dde5.tar.gz
chromium_src-79cb5c1739afa979cb0d5aa3701f128c6a50dde5.tar.bz2
Change AuthChallengeInfo to better represent underlying encodings.
* Use a HostPortPair to indicate the challenger info. This may be a punycode-encoded host. * scheme is always ASCII encoded and a string * realm is converted to UTF-16 rather than a wstring. Over the wire this is usually ASCII, can be ISO-8859-1 encoded as it's a quoted string, and could potentially be other encodings as specified by RFC 2047. BUG=95692 TEST=http://greenbytes.de/tech/tc/httpauth/simplebasicrealmiso88591.asis should display an a with an umlaut. Review URL: http://codereview.chromium.org/7569015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100676 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/auth.h')
-rw-r--r--net/base/auth.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/net/base/auth.h b/net/base/auth.h
index 834d9b5..51f8db9 100644
--- a/net/base/auth.h
+++ b/net/base/auth.h
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/string16.h"
+#include "net/base/host_port_pair.h"
#include "net/base/net_export.h"
namespace net {
@@ -21,17 +22,21 @@ class NET_EXPORT AuthChallengeInfo :
public:
AuthChallengeInfo();
- bool operator==(const AuthChallengeInfo& that) const;
+ // Determines whether two AuthChallengeInfo's are equivalent.
+ bool Equals(const AuthChallengeInfo& other) const;
- bool operator!=(const AuthChallengeInfo& that) const {
- return !(*this == that);
- }
+ // Whether this came from a server or a proxy.
+ bool is_proxy;
- bool is_proxy; // true for Proxy-Authenticate, false for WWW-Authenticate.
- std::wstring host_and_port; // <host>:<port> of the server asking for auth
- // (could be the proxy).
- std::wstring scheme; // "Basic", "Digest", or whatever other method is used.
- std::wstring realm; // the realm provided by the server, if there is one.
+ // The service issuing the challenge.
+ HostPortPair challenger;
+
+ // The authentication scheme used, such as "basic" or "digest". If the
+ // |source| is FTP_SERVER, this is an empty string. The encoding is ASCII.
+ std::string scheme;
+
+ // The realm of the challenge. May be empty. The encoding is UTF-8.
+ std::string realm;
private:
friend class base::RefCountedThreadSafe<AuthChallengeInfo>;
@@ -49,7 +54,6 @@ enum AuthState {
class AuthData : public base::RefCountedThreadSafe<AuthData> {
public:
AuthState state; // whether we need, have, or gave up on authentication.
- std::wstring scheme; // the authentication scheme.
string16 username; // the username supplied to us for auth.
string16 password; // the password supplied to us for auth.