Remove unused SecurityDelegate::IsValidPairingCode BUG=25768507 Change-Id: I5bec24332a53b95272e0e1370d5bbfe2e0df418c Reviewed-on: https://weave-review.googlesource.com/2061 Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/src/privet/mock_delegates.h b/src/privet/mock_delegates.h index 1586846..04ac338 100644 --- a/src/privet/mock_delegates.h +++ b/src/privet/mock_delegates.h
@@ -76,7 +76,6 @@ MOCK_CONST_METHOD0(GetCryptoTypes, std::set<CryptoType>()); MOCK_METHOD1(ClaimRootClientAuthToken, std::string(ErrorPtr*)); MOCK_METHOD2(ConfirmClientAuthToken, bool(const std::string&, ErrorPtr*)); - MOCK_CONST_METHOD1(IsValidPairingCode, bool(const std::string&)); MOCK_METHOD5( StartPairing, bool(PairingType, CryptoType, std::string*, std::string*, ErrorPtr*));
diff --git a/src/privet/privet_handler_unittest.cc b/src/privet/privet_handler_unittest.cc index 5c3c0d0..336be3b 100644 --- a/src/privet/privet_handler_unittest.cc +++ b/src/privet/privet_handler_unittest.cc
@@ -404,8 +404,6 @@ } TEST_F(PrivetHandlerTest, AuthPairing) { - EXPECT_CALL(security_, IsValidPairingCode("testToken")) - .WillRepeatedly(Return(true)); EXPECT_CALL(security_, CreateAccessToken(_, _, _, _, _, _, _)) .WillRepeatedly(DoAll(SetArgPointee<3>("OwnerAccessToken"), SetArgPointee<4>(AuthScope::kOwner), @@ -426,8 +424,6 @@ } TEST_F(PrivetHandlerTest, AuthLocalAuto) { - EXPECT_CALL(security_, IsValidPairingCode("testToken")) - .WillRepeatedly(Return(true)); EXPECT_CALL(security_, CreateAccessToken(_, _, _, _, _, _, _)) .WillRepeatedly(DoAll(SetArgPointee<3>("UserAccessToken"), SetArgPointee<4>(AuthScope::kUser), @@ -448,8 +444,6 @@ } TEST_F(PrivetHandlerTest, AuthLocal) { - EXPECT_CALL(security_, IsValidPairingCode("testToken")) - .WillRepeatedly(Return(true)); EXPECT_CALL(security_, CreateAccessToken(_, _, _, _, _, _, _)) .WillRepeatedly(DoAll(SetArgPointee<3>("ManagerAccessToken"), SetArgPointee<4>(AuthScope::kManager), @@ -470,8 +464,6 @@ } TEST_F(PrivetHandlerTest, AuthLocalHighScope) { - EXPECT_CALL(security_, IsValidPairingCode("testToken")) - .WillRepeatedly(Return(true)); EXPECT_CALL(security_, CreateAccessToken(_, _, _, _, _, _, _)) .WillRepeatedly(DoAll(SetArgPointee<3>("UserAccessToken"), SetArgPointee<4>(AuthScope::kUser),
diff --git a/src/privet/security_delegate.h b/src/privet/security_delegate.h index c07b782..42021fd 100644 --- a/src/privet/security_delegate.h +++ b/src/privet/security_delegate.h
@@ -49,10 +49,6 @@ virtual bool ConfirmClientAuthToken(const std::string& token, ErrorPtr* error) = 0; - // Returns true if |auth_code| provided by client is valid. Client should - // obtain |auth_code| during pairing process. - virtual bool IsValidPairingCode(const std::string& auth_code) const = 0; - virtual bool StartPairing(PairingType mode, CryptoType crypto, std::string* session_id,
diff --git a/src/privet/security_manager.h b/src/privet/security_manager.h index beb7955..b80f6e7 100644 --- a/src/privet/security_manager.h +++ b/src/privet/security_manager.h
@@ -75,7 +75,6 @@ std::string ClaimRootClientAuthToken(ErrorPtr* error) override; bool ConfirmClientAuthToken(const std::string& token, ErrorPtr* error) override; - bool IsValidPairingCode(const std::string& auth_code) const override; bool StartPairing(PairingType mode, CryptoType crypto, std::string* session_id, @@ -94,6 +93,7 @@ const PairingEndListener& on_end); private: + bool IsValidPairingCode(const std::string& auth_code) const; FRIEND_TEST_ALL_PREFIXES(SecurityManagerTest, ThrottlePairing); // Allows limited number of new sessions without successful authorization. bool CheckIfPairingAllowed(ErrorPtr* error);
diff --git a/src/privet/security_manager_unittest.cc b/src/privet/security_manager_unittest.cc index 6fc6b4c..f4a7b17 100644 --- a/src/privet/security_manager_unittest.cc +++ b/src/privet/security_manager_unittest.cc
@@ -96,8 +96,6 @@ std::string auth_code_base64{Base64Encode(auth_code)}; - EXPECT_TRUE(security_.IsValidPairingCode(auth_code_base64)); - std::string token; AuthScope scope; base::TimeDelta ttl;