Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: remoting/test/host_info.cc

Issue 1768383004: Cleanup AuthenticatorMethod usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/test/connection_setup_info.h ('k') | remoting/test/protocol_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/protocol/authentication_method.h"
6 #include "remoting/test/host_info.h" 5 #include "remoting/test/host_info.h"
7 6
8 #include "base/logging.h" 7 #include "base/logging.h"
9 8
10 namespace remoting { 9 namespace remoting {
11 namespace test { 10 namespace test {
12 11
13 HostInfo::HostInfo() { 12 HostInfo::HostInfo() {}
14 }
15
16 HostInfo::HostInfo(const HostInfo& other) = default; 13 HostInfo::HostInfo(const HostInfo& other) = default;
17 14
18 HostInfo::~HostInfo() { 15 HostInfo::~HostInfo() {}
19 }
20 16
21 bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) { 17 bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
22 const base::ListValue* list_value = nullptr; 18 const base::ListValue* list_value = nullptr;
23 19
24 // Add TokenUrlPatterns to HostInfo. 20 // Add TokenUrlPatterns to HostInfo.
25 if (host_info.GetList("tokenUrlPatterns", &list_value)) { 21 if (host_info.GetList("tokenUrlPatterns", &list_value)) {
26 if (!list_value->empty()) { 22 if (!list_value->empty()) {
27 for (base::Value* item : *list_value) { 23 for (base::Value* item : *list_value) {
28 std::string token_url_pattern; 24 std::string token_url_pattern;
29 if (!item->GetAsString(&token_url_pattern)) { 25 if (!item->GetAsString(&token_url_pattern)) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const std::string& user_name, 78 const std::string& user_name,
83 const std::string& pin) const { 79 const std::string& pin) const {
84 ConnectionSetupInfo connection_setup_info; 80 ConnectionSetupInfo connection_setup_info;
85 connection_setup_info.access_token = access_token; 81 connection_setup_info.access_token = access_token;
86 connection_setup_info.host_id = host_id; 82 connection_setup_info.host_id = host_id;
87 connection_setup_info.host_jid = host_jid; 83 connection_setup_info.host_jid = host_jid;
88 connection_setup_info.host_name = host_name; 84 connection_setup_info.host_name = host_name;
89 connection_setup_info.pin = pin; 85 connection_setup_info.pin = pin;
90 connection_setup_info.public_key = public_key; 86 connection_setup_info.public_key = public_key;
91 connection_setup_info.user_name = user_name; 87 connection_setup_info.user_name = user_name;
92
93 connection_setup_info.auth_methods.push_back(
94 protocol::AuthenticationMethod::SPAKE2_PAIR);
95 connection_setup_info.auth_methods.push_back(
96 protocol::AuthenticationMethod::SPAKE2_SHARED_SECRET_PLAIN);
97 connection_setup_info.auth_methods.push_back(
98 protocol::AuthenticationMethod::SPAKE2_SHARED_SECRET_HMAC);
99 connection_setup_info.auth_methods.push_back(
100 protocol::AuthenticationMethod::THIRD_PARTY);
101
102 return connection_setup_info; 88 return connection_setup_info;
103 } 89 }
104 90
105 } // namespace test 91 } // namespace test
106 } // namespace remoting 92 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/connection_setup_info.h ('k') | remoting/test/protocol_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698