| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 5 #ifndef REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| 6 #define REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 6 #define REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "remoting/protocol/authenticator.h" | 14 #include "remoting/protocol/authenticator.h" |
| 15 #include "remoting/protocol/validating_authenticator.h" |
| 15 | 16 |
| 16 namespace remoting { | 17 namespace remoting { |
| 17 | 18 |
| 18 class RsaKeyPair; | 19 class RsaKeyPair; |
| 19 | 20 |
| 20 namespace protocol { | 21 namespace protocol { |
| 21 | 22 |
| 22 // It2MeHostAuthenticatorFactory implements AuthenticatorFactory and | 23 // It2MeHostAuthenticatorFactory implements AuthenticatorFactory and |
| 23 // understands both the V2 and legacy V1 authentication mechanisms. | 24 // understands both the V2 and legacy V1 authentication mechanisms. |
| 24 class It2MeHostAuthenticatorFactory : public AuthenticatorFactory { | 25 class It2MeHostAuthenticatorFactory : public AuthenticatorFactory { |
| 25 public: | 26 public: |
| 26 It2MeHostAuthenticatorFactory(const std::string& local_cert, | 27 It2MeHostAuthenticatorFactory( |
| 27 scoped_refptr<RsaKeyPair> key_pair, | 28 const std::string& local_cert, |
| 28 const std::string& access_code, | 29 scoped_refptr<RsaKeyPair> key_pair, |
| 29 const std::string& required_client_domain); | 30 const std::string& access_code, |
| 31 const ValidatingAuthenticator::ValidationCallback& callback); |
| 30 ~It2MeHostAuthenticatorFactory() override; | 32 ~It2MeHostAuthenticatorFactory() override; |
| 31 | 33 |
| 32 // AuthenticatorFactory interface. | 34 // AuthenticatorFactory interface. |
| 33 std::unique_ptr<Authenticator> CreateAuthenticator( | 35 std::unique_ptr<Authenticator> CreateAuthenticator( |
| 34 const std::string& local_jid, | 36 const std::string& local_jid, |
| 35 const std::string& remote_jid) override; | 37 const std::string& remote_jid) override; |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 std::string local_cert_; | 40 std::string local_cert_; |
| 39 scoped_refptr<RsaKeyPair> key_pair_; | 41 scoped_refptr<RsaKeyPair> key_pair_; |
| 40 std::string access_code_hash_; | 42 std::string access_code_hash_; |
| 41 std::string required_client_domain_; | 43 ValidatingAuthenticator::ValidationCallback validation_callback_; |
| 42 | 44 |
| 43 DISALLOW_COPY_AND_ASSIGN(It2MeHostAuthenticatorFactory); | 45 DISALLOW_COPY_AND_ASSIGN(It2MeHostAuthenticatorFactory); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 } // namespace protocol | 48 } // namespace protocol |
| 47 } // namespace remoting | 49 } // namespace remoting |
| 48 | 50 |
| 49 #endif // REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 51 #endif // REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| OLD | NEW |