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

Unified Diff: remoting/host/gnubby_auth_handler.h

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address latest review comments Created 6 years, 10 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: remoting/host/gnubby_auth_handler.h
diff --git a/remoting/host/gnubby_auth_handler.h b/remoting/host/gnubby_auth_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..96fa5aaf721f5c82797182de5e0bf848aa4da252
--- /dev/null
+++ b/remoting/host/gnubby_auth_handler.h
@@ -0,0 +1,55 @@
+// Copyright 2014 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 REMOTING_HOST_GNUBBY_AUTH_HANDLER_H_
+#define REMOTING_HOST_GNUBBY_AUTH_HANDLER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/files/file_path.h"
Sergey Ulanov 2014/02/11 08:20:38 nit: FilePath can be forward-declared.
psj 2014/02/12 09:01:01 Done.
+#include "base/logging.h"
Sergey Ulanov 2014/02/11 08:20:38 This can be remove if you remove DCHECK below - se
psj 2014/02/12 09:01:01 Done.
+#include "base/memory/scoped_ptr.h"
+
+namespace remoting {
+namespace protocol {
Sergey Ulanov 2014/02/11 08:20:38 nit: empty line above this one
psj 2014/02/12 09:01:01 Done.
+class ClientStub;
+} // namespace protocol
+
+// Class responsible for proxying authentication data between a local gnubbyd
+// and the client.
+class GnubbyAuthHandler {
+ public:
+ virtual ~GnubbyAuthHandler() {}
+
+ // Creates a platform-specific GnubbyAuthHandler.
+ static scoped_ptr<GnubbyAuthHandler> Create(
+ protocol::ClientStub* client_stub);
+
+ // Specify the name of the socket to listen to gnubby requests on.
+ static void SetGnubbySocketName(const base::FilePath& gnubby_socket_name);
+
+ // A message was received from the client.
+ virtual void DeliverClientMessage(const std::string& message) = 0;
+
+ // Send data to client.
+ virtual void DeliverHostDataMessage(int connection_id,
+ const std::string& data) const = 0;
+
+ protected:
+ explicit GnubbyAuthHandler(protocol::ClientStub* client_stub)
+ : client_stub_(client_stub) {
+ DCHECK(client_stub_);
+ }
+
+ // Interface through which communication with the client occurs.
+ protocol::ClientStub* client_stub_;
Sergey Ulanov 2014/02/11 08:20:38 Please move this to GnubbyAuthHandlerPosix. Gnubby
psj 2014/02/12 09:01:01 Done.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GnubbyAuthHandler);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_GNUBBY_AUTH_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698