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_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 5 #ifndef REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
6 #define REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 6 #define REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class PairingRegistry; | 25 class PairingRegistry; |
26 | 26 |
27 class Me2MeHostAuthenticatorFactory : public AuthenticatorFactory { | 27 class Me2MeHostAuthenticatorFactory : public AuthenticatorFactory { |
28 public: | 28 public: |
29 // Create a factory that dispenses shared secret authenticators. | 29 // Create a factory that dispenses shared secret authenticators. |
30 static scoped_ptr<AuthenticatorFactory> CreateWithSharedSecret( | 30 static scoped_ptr<AuthenticatorFactory> CreateWithSharedSecret( |
31 bool use_service_account, | 31 bool use_service_account, |
32 const std::string& host_owner, | 32 const std::string& host_owner, |
33 const std::string& local_cert, | 33 const std::string& local_cert, |
34 scoped_refptr<RsaKeyPair> key_pair, | 34 scoped_refptr<RsaKeyPair> key_pair, |
| 35 const std::string& required_client_domain, |
35 const SharedSecretHash& shared_secret_hash, | 36 const SharedSecretHash& shared_secret_hash, |
36 scoped_refptr<PairingRegistry> pairing_registry); | 37 scoped_refptr<PairingRegistry> pairing_registry); |
37 | 38 |
38 // Create a factory that dispenses third party authenticators. | 39 // Create a factory that dispenses third party authenticators. |
39 static scoped_ptr<AuthenticatorFactory> CreateWithThirdPartyAuth( | 40 static scoped_ptr<AuthenticatorFactory> CreateWithThirdPartyAuth( |
40 bool use_service_account, | 41 bool use_service_account, |
41 const std::string& host_owner, | 42 const std::string& host_owner, |
42 const std::string& local_cert, | 43 const std::string& local_cert, |
43 scoped_refptr<RsaKeyPair> key_pair, | 44 scoped_refptr<RsaKeyPair> key_pair, |
| 45 const std::string& required_client_domain, |
44 scoped_ptr<TokenValidatorFactory> token_validator_factory); | 46 scoped_ptr<TokenValidatorFactory> token_validator_factory); |
45 | 47 |
46 Me2MeHostAuthenticatorFactory(); | 48 Me2MeHostAuthenticatorFactory(); |
47 ~Me2MeHostAuthenticatorFactory() override; | 49 ~Me2MeHostAuthenticatorFactory() override; |
48 | 50 |
49 // AuthenticatorFactory interface. | 51 // AuthenticatorFactory interface. |
50 scoped_ptr<Authenticator> CreateAuthenticator( | 52 scoped_ptr<Authenticator> CreateAuthenticator( |
51 const std::string& local_jid, | 53 const std::string& local_jid, |
52 const std::string& remote_jid, | 54 const std::string& remote_jid, |
53 const buzz::XmlElement* first_message) override; | 55 const buzz::XmlElement* first_message) override; |
54 | 56 |
55 private: | 57 private: |
56 // Used for all host authenticators. | 58 // Used for all host authenticators. |
57 bool use_service_account_; | 59 bool use_service_account_; |
58 std::string host_owner_; | 60 std::string host_owner_; |
59 std::string local_cert_; | 61 std::string local_cert_; |
60 scoped_refptr<RsaKeyPair> key_pair_; | 62 scoped_refptr<RsaKeyPair> key_pair_; |
| 63 std::string required_client_domain_; |
61 | 64 |
62 // Used only for shared secret host authenticators. | 65 // Used only for shared secret host authenticators. |
63 SharedSecretHash shared_secret_hash_; | 66 SharedSecretHash shared_secret_hash_; |
64 | 67 |
65 // Used only for third party host authenticators. | 68 // Used only for third party host authenticators. |
66 scoped_ptr<TokenValidatorFactory> token_validator_factory_; | 69 scoped_ptr<TokenValidatorFactory> token_validator_factory_; |
67 | 70 |
68 // Used only for pairing host authenticators. | 71 // Used only for pairing host authenticators. |
69 scoped_refptr<PairingRegistry> pairing_registry_; | 72 scoped_refptr<PairingRegistry> pairing_registry_; |
70 | 73 |
71 DISALLOW_COPY_AND_ASSIGN(Me2MeHostAuthenticatorFactory); | 74 DISALLOW_COPY_AND_ASSIGN(Me2MeHostAuthenticatorFactory); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace protocol | 77 } // namespace protocol |
75 } // namespace remoting | 78 } // namespace remoting |
76 | 79 |
77 #endif // REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 80 #endif // REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
OLD | NEW |