1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef DUMMY_AUTHENTICATION_H 17 #define DUMMY_AUTHENTICATION_H 18 19 #include "authentication.h" 20 21 #undef private 22 23 namespace OHOS { 24 namespace UserIam { 25 namespace UserAuth { 26 namespace { 27 class DummyAuthentication : public Authentication { 28 public: SetExecutor(uint32_t executorIndex)29 void SetExecutor(uint32_t executorIndex){}; SetChallenge(const std::vector<uint8_t> &challenge)30 void SetChallenge(const std::vector<uint8_t> &challenge){}; SetAccessTokenId(uint32_t tokenId)31 void SetAccessTokenId(uint32_t tokenId){}; SetEndAfterFirstFail(bool endAfterFirstFail)32 void SetEndAfterFirstFail(bool endAfterFirstFail){}; SetCollectorUdid(std::string &collectorUdid)33 void SetCollectorUdid(std::string &collectorUdid){}; SetLatestError(int32_t error)34 void SetLatestError(int32_t error){}; Start(std::vector<std::shared_ptr<ScheduleNode>> &scheduleList, std::shared_ptr<ScheduleNodeCallback> callback)35 bool Start(std::vector<std::shared_ptr<ScheduleNode>> &scheduleList, 36 std::shared_ptr<ScheduleNodeCallback> callback) 37 { 38 return true; 39 }; Update(const std::vector<uint8_t> &scheduleResult, AuthResultInfo &resultInfo)40 bool Update(const std::vector<uint8_t> &scheduleResult, AuthResultInfo &resultInfo) 41 { 42 return true; 43 }; GetAuthExecutorMsgs() const44 std::vector<Authentication::AuthExecutorMsg> GetAuthExecutorMsgs() const 45 { 46 return {}; 47 }; Cancel()48 bool Cancel() 49 { 50 return true; 51 }; GetAccessTokenId() const52 uint32_t GetAccessTokenId() const 53 { 54 return 0; 55 }; GetLatestError() const56 int32_t GetLatestError() const 57 { 58 return 0; 59 }; GetUserId() const60 int32_t GetUserId() const 61 { 62 return 0; 63 }; OnContextPoolInsert(const std::shared_ptr<Context> &context)64 void OnContextPoolInsert(const std::shared_ptr<Context> &context){}; OnContextPoolDelete(const std::shared_ptr<Context> &context)65 void OnContextPoolDelete(const std::shared_ptr<Context> &context){}; 66 }; 67 } 68 } // UserAuth 69 } // UserIam 70 } // OHOS 71 72 #endif // DUMMY_AUTHENICATION_H