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 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 scoped_refptr<protocol::PairingRegistry> pairing_registry = NULL; | 509 scoped_refptr<protocol::PairingRegistry> pairing_registry = NULL; |
510 if (allow_pairing_) { | 510 if (allow_pairing_) { |
511 pairing_registry = CreatePairingRegistry(context_->file_task_runner()); | 511 pairing_registry = CreatePairingRegistry(context_->file_task_runner()); |
512 } | 512 } |
513 | 513 |
514 scoped_ptr<protocol::AuthenticatorFactory> factory; | 514 scoped_ptr<protocol::AuthenticatorFactory> factory; |
515 | 515 |
516 if (token_url_.is_empty() && token_validation_url_.is_empty()) { | 516 if (token_url_.is_empty() && token_validation_url_.is_empty()) { |
517 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( | 517 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( |
518 host_owner_, local_certificate, key_pair_, host_secret_hash_, | 518 use_service_account_, host_owner_, local_certificate, key_pair_, |
519 pairing_registry); | 519 host_secret_hash_, pairing_registry); |
520 | 520 |
521 } else if (token_url_.is_valid() && token_validation_url_.is_valid()) { | 521 } else if (token_url_.is_valid() && token_validation_url_.is_valid()) { |
522 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> | 522 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> |
523 token_validator_factory(new TokenValidatorFactoryImpl( | 523 token_validator_factory(new TokenValidatorFactoryImpl( |
524 token_url_, token_validation_url_, key_pair_, | 524 token_url_, token_validation_url_, key_pair_, |
525 context_->url_request_context_getter())); | 525 context_->url_request_context_getter())); |
526 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( | 526 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( |
527 host_owner_, local_certificate, key_pair_, | 527 use_service_account_, host_owner_, local_certificate, key_pair_, |
528 token_validator_factory.Pass()); | 528 token_validator_factory.Pass()); |
529 | 529 |
530 } else { | 530 } else { |
531 // TODO(rmsousa): If the policy is bad the host should not go online. It | 531 // TODO(rmsousa): If the policy is bad the host should not go online. It |
532 // should keep running, but not connected, until the policies are fixed. | 532 // should keep running, but not connected, until the policies are fixed. |
533 // Having it show up as online and then reject all clients is misleading. | 533 // Having it show up as online and then reject all clients is misleading. |
534 LOG(ERROR) << "One of the third-party token URLs is empty or invalid. " | 534 LOG(ERROR) << "One of the third-party token URLs is empty or invalid. " |
535 << "Host will reject all clients until policies are corrected. " | 535 << "Host will reject all clients until policies are corrected. " |
536 << "TokenUrl: " << token_url_ << ", " | 536 << "TokenUrl: " << token_url_ << ", " |
537 << "TokenValidationUrl: " << token_validation_url_; | 537 << "TokenValidationUrl: " << token_validation_url_; |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 return exit_code; | 1175 return exit_code; |
1176 } | 1176 } |
1177 | 1177 |
1178 } // namespace remoting | 1178 } // namespace remoting |
1179 | 1179 |
1180 #if !defined(OS_WIN) | 1180 #if !defined(OS_WIN) |
1181 int main(int argc, char** argv) { | 1181 int main(int argc, char** argv) { |
1182 return remoting::HostMain(argc, argv); | 1182 return remoting::HostMain(argc, argv); |
1183 } | 1183 } |
1184 #endif // !defined(OS_WIN) | 1184 #endif // !defined(OS_WIN) |
OLD | NEW |