Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_URL_FETCHER_TOKEN_VALIDATOR_FACTORY_H_ | |
| 6 #define REMOTING_HOST_URL_FETCHER_TOKEN_VALIDATOR_FACTORY_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "net/url_request/url_request_context_getter.h" | |
| 13 #include "remoting/protocol/third_party_host_authenticator.h" | |
| 14 | |
| 15 namespace remoting { | |
| 16 | |
| 17 // This class dispenses |TokenValidator| implementations that use a UrlFetcher | |
| 18 // to contact a |token_validation_url| and exchange the |token| for a | |
| 19 // |shared_secret|. | |
| 20 class UrlFetcherTokenValidatorFactory | |
|
Wez
2013/04/05 22:46:12
nit: Could this just be TokenValidatorFactoryImpl,
rmsousa
2013/04/06 00:37:25
Done.
| |
| 21 : public protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory { | |
| 22 public: | |
| 23 // Creates a new factory. |token_url| and |token_validation_url| are the | |
| 24 // third party authentication service URLs, obtained via policy. |key_pair_| | |
| 25 // is used by the host to authenticate with the service by signing the token. | |
| 26 UrlFetcherTokenValidatorFactory( | |
| 27 const GURL& token_url, | |
| 28 const GURL& token_validation_url, | |
| 29 scoped_refptr<RsaKeyPair> key_pair, | |
| 30 scoped_refptr<net::URLRequestContextGetter> request_context_getter); | |
| 31 | |
| 32 virtual ~UrlFetcherTokenValidatorFactory(); | |
| 33 | |
| 34 // TokenValidatorFactory interface. | |
| 35 virtual scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidator> | |
| 36 CreateTokenValidator(const std::string& local_jid, | |
| 37 const std::string& remote_jid) OVERRIDE; | |
| 38 | |
|
Sergey Ulanov
2013/04/05 20:28:34
nit: remove empty line
rmsousa
2013/04/06 00:37:25
Done.
| |
| 39 virtual bool IsEnabled() const OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 GURL token_url_; | |
| 43 GURL token_validation_url_; | |
| 44 scoped_refptr<RsaKeyPair> key_pair_; | |
| 45 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | |
| 46 DISALLOW_COPY_AND_ASSIGN(UrlFetcherTokenValidatorFactory); | |
|
Sergey Ulanov
2013/04/05 20:28:34
not: empty line above this one.
rmsousa
2013/04/06 00:37:25
Done.
| |
| 47 }; | |
| 48 | |
| 49 } // namespace remoting | |
| 50 | |
| 51 #endif // REMOTING_HOST_URL_FETCHER_TOKEN_VALIDATOR_FACTORY_H_ | |
| OLD | NEW |