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

Unified Diff: remoting/protocol/rejecting_authenticator.h

Issue 1643793002: Add policy to restrict client domain for Me2Me. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remoting_perftests compile. Created 4 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
« no previous file with comments | « remoting/protocol/me2me_host_authenticator_factory.cc ('k') | remoting/protocol/rejecting_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/rejecting_authenticator.h
diff --git a/remoting/protocol/rejecting_authenticator.h b/remoting/protocol/rejecting_authenticator.h
new file mode 100644
index 0000000000000000000000000000000000000000..cced70dbc6fd129667fc9a4d22cf5d1a0d0e9e47
--- /dev/null
+++ b/remoting/protocol/rejecting_authenticator.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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_PROTOCOL_REJECTING_AUTHENTICATOR_FACTORY_H_
+#define REMOTING_PROTOCOL_REJECTING_AUTHENTICATOR_FACTORY_H_
+
+#include <string>
+
+#include "remoting/protocol/authenticator.h"
+
+namespace remoting {
+namespace protocol {
+
+// Authenticator that accepts one message and rejects connection after that.
+class RejectingAuthenticator : public Authenticator {
+ public:
+ RejectingAuthenticator(RejectionReason rejection_reason);
+ ~RejectingAuthenticator() override;
+
+ // Authenticator interface
+ State state() const override;
+ bool started() const override;
+ RejectionReason rejection_reason() const override;
+ void ProcessMessage(const buzz::XmlElement* message,
+ const base::Closure& resume_callback) override;
+ scoped_ptr<buzz::XmlElement> GetNextMessage() override;
+ const std::string& GetAuthKey() const override;
+ scoped_ptr<ChannelAuthenticator> CreateChannelAuthenticator() const override;
+
+ private:
+ RejectionReason rejection_reason_;
+ State state_ = WAITING_MESSAGE;
+ std::string auth_key_;
+
+ DISALLOW_COPY_AND_ASSIGN(RejectingAuthenticator);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_REJECTING_AUTHENTICATOR_FACTORY_H_
« no previous file with comments | « remoting/protocol/me2me_host_authenticator_factory.cc ('k') | remoting/protocol/rejecting_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698