| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "remoting/host/third_party_auth_config.h" | 5 #include "remoting/host/third_party_auth_config.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "policy/policy_constants.h" | 9 #include "policy/policy_constants.h" |
| 10 | 10 |
| 11 namespace remoting { | 11 namespace remoting { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 bool ParseUrlPolicy(const std::string& str, GURL* out) { | 15 bool ParseUrlPolicy(const std::string& str, GURL* out) { |
| 16 if (str.empty()) { | 16 if (str.empty()) { |
| 17 *out = GURL(); | 17 *out = GURL(); |
| 18 return true; | 18 return true; |
| 19 } | 19 } |
| 20 | 20 |
| 21 GURL gurl(str); | 21 GURL gurl(str); |
| 22 if (!gurl.is_valid()) { | 22 if (!gurl.is_valid()) { |
| 23 LOG(ERROR) << "Not a valid URL: " << str; | 23 LOG(ERROR) << "Not a valid URL: " << str; |
| 24 return false; | 24 return false; |
| 25 } | 25 } |
| 26 // We validate https-vs-http only on Release builds to help with manual testing. | 26 // We validate https-vs-http only on Release builds to help with manual testing. |
| 27 #if defined(NDEBUG) | 27 #if defined(NDEBUG) |
| 28 if (!gurl.SchemeIsSecure()) { | 28 if (!gurl.SchemeIsCryptographic()) { |
| 29 LOG(ERROR) << "Not a secure URL: " << str; | 29 LOG(ERROR) << "Not a secure URL: " << str; |
| 30 return false; | 30 return false; |
| 31 } | 31 } |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 *out = gurl; | 34 *out = gurl; |
| 35 return true; | 35 return true; |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } else { | 129 } else { |
| 130 os << "TokenUrl = <" << cfg.token_url << ">, "; | 130 os << "TokenUrl = <" << cfg.token_url << ">, "; |
| 131 os << "TokenValidationUrl = <" << cfg.token_validation_url << ">, "; | 131 os << "TokenValidationUrl = <" << cfg.token_validation_url << ">, "; |
| 132 os << "TokenValidationCertificateIssuer = <" | 132 os << "TokenValidationCertificateIssuer = <" |
| 133 << cfg.token_validation_cert_issuer << ">"; | 133 << cfg.token_validation_cert_issuer << ">"; |
| 134 } | 134 } |
| 135 return os; | 135 return os; |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace remoting | 138 } // namespace remoting |
| OLD | NEW |