Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5001)

Unified Diff: chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h

Issue 10913238: SPDY proxy authentication support. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: IWYU Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h
diff --git a/chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h b/chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..c89b026591235bf578e6f8e90489b6d5ca4bf688
--- /dev/null
+++ b/chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h
@@ -0,0 +1,79 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NET_SPDYPROXY_HTTP_AUTH_HANDLER_SPDYPROXY_H_
+#define CHROME_BROWSER_NET_SPDYPROXY_HTTP_AUTH_HANDLER_SPDYPROXY_H_
+
+#include <string>
+
+#include "base/gtest_prod_util.h"
+#include "net/http/http_auth_handler.h"
+#include "net/http/http_auth_handler_factory.h"
+
+namespace spdyproxy {
+
+// Code for handling http SpdyProxy authentication.
+class HttpAuthHandlerSpdyProxy : public net::HttpAuthHandler {
+ public:
+ class Factory : public net::HttpAuthHandlerFactory {
+ public:
+ // Constructs a new spdyproxy handler factory which mints handlers that
+ // respond to challenges only from the given |authorized_spdyproxy_origin|.
+ explicit Factory(const GURL& authorized_spdyproxy_origin);
+ virtual ~Factory();
+
+ virtual int CreateAuthHandler(
+ net::HttpAuth::ChallengeTokenizer* challenge,
+ net::HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
+ const net::BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+
+ private:
+ // The origin for which we will respond to SpdyProxy auth challenges.
+ GURL authorized_spdyproxy_origin_;
+ };
+
+ // Constructs a new spdyproxy handler which responds to challenges
+ // from the given |authorized_spdyproxy_origin|.
+ explicit HttpAuthHandlerSpdyProxy(
+ const GURL& authorized_spdyproxy_origin);
+
+ virtual net::HttpAuth::AuthorizationResult HandleAnotherChallenge(
sky 2012/09/28 17:14:30 Keep all your overrides grouped together with no n
Michael Piatek 2012/09/28 17:51:30 Done.
+ net::HttpAuth::ChallengeTokenizer* challenge) OVERRIDE;
+
+ virtual bool NeedsIdentity() OVERRIDE;
+ virtual bool AllowsDefaultCredentials() OVERRIDE;
+
+ virtual bool AllowsExplicitCredentials() OVERRIDE;
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerSpdyProxyTest, ParseChallenge);
+
+ virtual ~HttpAuthHandlerSpdyProxy() {}
+
+ virtual bool Init(net::HttpAuth::ChallengeTokenizer* challenge) OVERRIDE;
+
+ virtual int GenerateAuthTokenImpl(const net::AuthCredentials* credentials,
+ const net::HttpRequestInfo* request,
+ const net::CompletionCallback& callback,
+ std::string* auth_token) OVERRIDE;
+
+ bool ParseChallenge(net::HttpAuth::ChallengeTokenizer* challenge);
+
+ bool ParseChallengeProperty(const std::string& name,
+ const std::string& value);
+
+ // The origin for which we will respond to SpdyProxy auth challenges.
+ GURL authorized_spdyproxy_origin_;
+
+ // The ps token, encoded as UTF-8.
+ std::string ps_token_;
+};
sky 2012/09/28 17:14:30 DISALLOW_CO..
Michael Piatek 2012/09/28 17:51:30 Done.
+
+} // namespace spdyproxy
+
+#endif // CHROME_BROWSER_NET_SPDYPROXY_HTTP_AUTH_HANDLER_SPDYPROXY_H_

Powered by Google App Engine
This is Rietveld 408576698