Chromium Code Reviews| Index: remoting/host/third_party_auth_config.h |
| diff --git a/remoting/host/third_party_auth_config.h b/remoting/host/third_party_auth_config.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9030c3da00359190b8d45a7eed5e5a1d2d728d94 |
| --- /dev/null |
| +++ b/remoting/host/third_party_auth_config.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2015 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_HOST_THIRD_PARTY_AUTH_CONFIG_H_ |
| +#define REMOTING_HOST_THIRD_PARTY_AUTH_CONFIG_H_ |
| + |
| +#include <ostream> |
| +#include <string> |
| + |
| +#include "url/gurl.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} // namespace base |
| + |
| +namespace remoting { |
| + |
| +struct ThirdPartyAuthConfig { |
| + GURL token_url; |
| + GURL token_validation_url; |
| + std::string token_validation_cert_issuer; |
| + |
| + inline bool is_null() const { |
| + return token_url.is_empty() && token_validation_url.is_empty(); |
| + } |
| + |
| + // Returns false and doesn't modify |result| if parsing fails (i.e. some input |
| + // values are invalid). |
| + static bool Parse(const std::string& token_url, |
| + const std::string& token_validation_url, |
| + const std::string& token_validation_cert_issuer, |
| + ThirdPartyAuthConfig* result); |
| + |
| + // Extracts raw (raw = as strings) policy values from |policy_dict|. |
| + // Missing policy values are set to an empty string. |
| + // Returns false if no ThirdPartyAuthConfig-related policies were present. |
| + static bool ExtractPolicyValues(const base::DictionaryValue& policy_dict, |
|
rmsousa
2015/02/27 23:56:14
We always call these two together, having them sep
Łukasz Anforowicz
2015/03/02 17:34:47
Done. OTOH, note that a single bool (as a return
|
| + std::string* token_url, |
| + std::string* token_validation_url, |
| + std::string* token_validation_cert_issuer); |
| +}; |
| + |
| +std::ostream& operator<<(std::ostream& os, const ThirdPartyAuthConfig& cfg); |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_THIRD_PARTY_AUTH_CONFIG_H_ |