| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: add user auth engine abstraction layer Introduce an IUserAuthEngine interface between the userauth service and the auth execution backend so core/context/ipc/load_mode no longer depend on HDI types. Service layers use Eng* DTO types and ResultCode; all HDI/HDF dependencies consolidate into the engine source_set, and HDF codes convert to ResultCode at the engine boundary. The default HdiEngineImpl forwards to the user_auth HDI driver; a TEE Trust Application backend can be linked in instead. Backend status subscription and dynamic load/unload move into the engine. Rename INVALID_HDI_INTERFACE (1006) to ENGINE_UNAVAILABLE to distinguish a down backend from a generic error while keeping the numeric IPC code unchanged. Keep the engine DTO header free of engine internals by dropping the unused accesstoken_kit.h include. The client impl headers drop the legacy user_auth_types.h HDI include; user_auth_napi_client_impl.h keeps a reference to the engine DTO header where its types are referenced. Move the HDI external_deps (libuser_auth_proxy, hdf_core) and hdi_wrapper into the engine source_set so it is link-self-contained; the engine target reaches services/base headers via include_dirs. Move EnrolledInfo to iam_common_defines.h to drop the engine DTO's reverse dependency on the client defines header. Address review findings on the abstraction: - Propagate the engine return code on the credential/user-management database paths (GetCredentialInfo, DeleteUser, DeleteUserEnforce, GetAllExtUserInfo, GetCredentialInfoById, ClearUnavailableCredential). The first four preserve the pre-abstraction IPC code 1006 (formerly returned as INVALID_HDI_INTERFACE); GetCredentialInfoById and ClearUnavailableCredential now return ENGINE_UNAVAILABLE (1006) instead of GENERAL_ERROR (2) when the backend is down -- callers branch only on ret != SUCCESS, so behavior is unchanged. - Fix an uninitialized-read UB in AuthenticationImpl::Update by returning early when the engine call fails, instead of reading the unfilled result struct. - Copy the GlobalConfigValue union by its active member (enableStatus / pinExpiredPeriod) instead of always copying the inactive pinExpiredPeriod. - Restore an explicit ATokenType->EngCallerType mapping (new EngCallerType enum) so the callerType value no longer relies on ATokenType numerics coinciding with the driver contract. - Document the low bug-finding ROI of hdiwrapper_fuzzer. Add engine fuzz harnesses and align unit tests with the new types and ResultCode expectations. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%] Change-Id: Ida34723771373f77d8b70febc5e26f408ca6582c Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> | 1 天前 |