| feat: sync PIN freeze state and abort in-flight auth on lock/user switch Add BlockedStateSyncScheduler to keep companion-auth "blocked" state in sync with the user-auth PIN freezing time. Becoming blocked fans out a lock event that aborts in-flight MixAuth/ObtainToken requests and rejects SUCCESS results that race the lock or an active-user switch, so a locked or switched-away user can no longer complete companion auth. Centralize IssueToken/ObtainToken error replies through CompleteWithError so a failed PRE round unblocks the peer instead of waiting for timeout. Map the softbus peer-session-not-created error to a new PEER_SERVICE_NOT_AVAILABLE result code and treat it as terminal in the device-status and resync retry layers, stopping retry storms against devices without the CDA service. Add tests and a fuzz harness for the new paths. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[61%] 🔧 Human Fixed[0%] 🧑 Human[39%] 👌 AI Adopted[100%] Change-Id: I1d80925f4b0f05f1888540d7846333472776309b | 17 小时前 |
| refactor: extract service initialization and core logic into separate classes This commit refactors the service layer by extracting initialization and core logic from CompanionDeviceAuthService into two new classes: - BaseServiceInitializer: Table-driven initialization with dependency injection support - BaseServiceCore: Core service functionality including subscription and device management Key improvements: - Enhanced testability through dependency injection - Improved lambda capture safety using weak_from_this for async callbacks - Better separation of concerns and maintainability - Cleaned up low-value comments and unused dependencies Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: If7ea0dd5b34e4d2e1a283eeb7efcbe8d6edb5c3f | 5 个月前 |
| fix: harden request completion lifecycle and collector fields Make terminal completion (CompleteWithError/CompleteWithSuccess) a one-shot operation across request types to prevent double or re-entrant completion, fix moved-from callbacks retained by error guards and deferred tasks, propagate the correct error code on delegate-auth and issue-token send failures, and record callerUserId in interaction events. Construct encryptor and executor with nothrow allocation. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%] Co-authored-by: claude (glm-5.2) <ai@local> Change-Id: I014a484d6a923562bfbee871a83c8f712dd50691 | 3 天前 |
| feat: add passcode prompt callback for companion device authentication Add end-to-end passcode prompt callback support spanning IPC interface, service logic, client implementation, NAPI/ANI framework bindings, and RSA-OAEP encryption for secure passcode transmission. Also extract FFI array utility templates into a dedicated header and parameterize permission checking across all framework and service entry points. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: Id0989d3d30da14890bbe8e55026757c9697450ca | 1 个月前 |
| feat: add dynamic loading support and enhance capability verification Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: Ie7e59d859bb43c39ec2b75dd04db3f79e681d302 | 5 个月前 |
| refactor: simplify service architecture and enhance protocol validation - Remove dynamic load feature flag and related conditional code - Remove unused MCU/MCU_AP secure protocol IDs - Add safe arithmetic operations to prevent integer underflow - Enhance protocol and capability validation in companion device interactions - Improve API return types with std::optional for better error handling - Fix naming convention issues and clean up service entry code Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: I1ae540ffe6b143eadae171b9326e917a68d7fd2a | 4 个月前 |
| feat: sync PIN freeze state and abort in-flight auth on lock/user switch Add BlockedStateSyncScheduler to keep companion-auth "blocked" state in sync with the user-auth PIN freezing time. Becoming blocked fans out a lock event that aborts in-flight MixAuth/ObtainToken requests and rejects SUCCESS results that race the lock or an active-user switch, so a locked or switched-away user can no longer complete companion auth. Centralize IssueToken/ObtainToken error replies through CompleteWithError so a failed PRE round unblocks the peer instead of waiting for timeout. Map the softbus peer-session-not-created error to a new PEER_SERVICE_NOT_AVAILABLE result code and treat it as terminal in the device-status and resync retry layers, stopping retry storms against devices without the CDA service. Add tests and a fuzz harness for the new paths. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[61%] 🔧 Human Fixed[0%] 🧑 Human[39%] 👌 AI Adopted[100%] Change-Id: I1d80925f4b0f05f1888540d7846333472776309b | 17 小时前 |
| feat: sync PIN freeze state and abort in-flight auth on lock/user switch Add BlockedStateSyncScheduler to keep companion-auth "blocked" state in sync with the user-auth PIN freezing time. Becoming blocked fans out a lock event that aborts in-flight MixAuth/ObtainToken requests and rejects SUCCESS results that race the lock or an active-user switch, so a locked or switched-away user can no longer complete companion auth. Centralize IssueToken/ObtainToken error replies through CompleteWithError so a failed PRE round unblocks the peer instead of waiting for timeout. Map the softbus peer-session-not-created error to a new PEER_SERVICE_NOT_AVAILABLE result code and treat it as terminal in the device-status and resync retry layers, stopping retry storms against devices without the CDA service. Add tests and a fuzz harness for the new paths. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[61%] 🔧 Human Fixed[0%] 🧑 Human[39%] 👌 AI Adopted[100%] Change-Id: I1d80925f4b0f05f1888540d7846333472776309b | 17 小时前 |
| all code Signed-off-by: HelloMiracle123 <3299615082@qq.com> | 6 个月前 |
| refactor: extend log file-id tracing to common and frameworks modules Assign per-file LOG_FILE_ID values and add the matching LogTraceFileId enum entries for the common, ANI, NAPI and native client modules so log traces carry accurate per-file attribution. Correct the file-id used by the FFI array util header and add a build-order dependency for the ANI taihe IDL copy. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[17%] 🔧 Human Fixed[0%] 🧑 Human[83%] 👌 AI Adopted[100%] Change-Id: If0b6aa89da97843a5ccb24e1e08f174e9b64d9a5 | 20 天前 |
| feat: scope request mutual exclusion to per-device and trigger status refresh on subscribe - Change HostIssueTokenRequest/HostTokenAuthRequest mutual exclusion from global to per-device, allowing concurrent operations on different devices - Extract RefreshDeviceStatus/RefreshPhysicalDeviceStatus methods and trigger device status refresh after subscription operations - Remove HOST_MIX_AUTH_REQUEST preemption of HostSingleMixAuthRequest - Continue processing on CompanionProcessCheck failure instead of returning early - Remove unnecessary cross_device_comm_manager_impl.h includes from request files Change-Id: I605d8b648f2ba31d3ef7bbb17489fb3ffc648081 Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> | 3 个月前 |
| test: improve test infrastructure and code style - Improve test configuration in test_config.gni: - Separate coverage flags for unit tests and fuzz tests - Add explicit -O0 optimization flag for test builds - Use --coverage for fuzz test coverage (GCC-style) - Add namespace closing comments to fuzz test files for code clarity - Improve test teardown in request unit tests Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: Iaa15bef7bd1c04a0d02c4b1df0410ffdd824a0d9 | 5 个月前 |
| all code Signed-off-by: HelloMiracle123 <lihuayue1@huawei.com> | 6 个月前 |
| all code Signed-off-by: HelloMiracle123 <lihuayue1@huawei.com> | 6 个月前 |
| refactor: extract service initialization and core logic into separate classes This commit refactors the service layer by extracting initialization and core logic from CompanionDeviceAuthService into two new classes: - BaseServiceInitializer: Table-driven initialization with dependency injection support - BaseServiceCore: Core service functionality including subscription and device management Key improvements: - Enhanced testability through dependency injection - Improved lambda capture safety using weak_from_this for async callbacks - Better separation of concerns and maintainability - Cleaned up low-value comments and unused dependencies Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: If7ea0dd5b34e4d2e1a283eeb7efcbe8d6edb5c3f | 5 个月前 |
| !192 merge addTaiheToBundle into master 新增 taihe_ffi_gen 部件依赖 Created-by: LeechyLiang Commit-by: LeechyLiang Merged-by: openharmony_ci Description: ### 相关的Issue https://gitcode.com/openharmony/useriam_companion_device_auth/issues/157 ### 原因(目的、解决的问题等) taihe_ffi_gen 已独立为部件,需要补充 bundle.json 中的组件依赖,保证依赖关系完整。 ### 描述(做了什么,变更了什么) - 在 bundle.json 的 component.deps.components 中新增 taihe_ffi_gen。 ### 验证结果(新增、改动、可能影响的功能) 已验证:bundle.json 为合法 JSON,taihe_ffi_gen 已加入 component.deps.components。本次仅修改依赖配置,不涉及运行时代码变更。 ## 变更摘要 ## 影响范围 - **IRequest 接口**:新增 GetTemplateId() 虚方法,简化 ShouldCancelOnNewRequest 签名 - **BaseRequest**:新增 std::optional<TemplateId> templateId_ 成员及 getter 实现 - **cross_device_interaction 全部子模块**:适配新接口签名,移除冗余的 templateId_ 成员 - **RequestManagerImpl**:更新调用方式,传递 *request 而非拆解参数 - **测试代码**:unittest、fuzz test 及 MockIRequest 全部同步适配 ### 日志规范自检 不涉及。本次仅修改 bundle.json 依赖配置,没有新增或修改日志打印。 ### 安全编码自检 不涉及。本次仅修改 bundle.json 依赖配置,没有新增或修改代码逻辑;不涉及指针、内存、fd、锁、外部输入、敏感信息、整数运算或权限校验。 ### 是否已执行L0用例 已验证。不涉及新增运行时代码,已完成 bundle.json JSON 合法性和 deps.components 依赖项检查。 See merge request: openharmony/useriam_companion_device_auth!192 | 7 天前 |
| all code Signed-off-by: HelloMiracle123 <3299615082@qq.com> | 6 个月前 |
| refactor: improve subscription structure and add business id filtering - Restructure subscription directory layout for better organization - Add business id filtering in host mix auth request for template validation - Apply GET_MASKED_STR_CSTR for sensitive device info in logs - Simplify SystemParamManager subscription storage with unified struct - Fix userId type from uint32_t to int32_t in BeginDelegateAuth Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: Id2f6b3a1001a60916ed3260d518ce5105cc66e9f | 4 个月前 |
| feat: add timing breakdown telemetry for auth request flows Record per-stage timing (total wall-clock vs local processing, with softbus wait intervals excluded) for cross-device auth requests and report it via the INTERACTION_EVENT hisysevent (TOTAL_TIME/LOCAL_TIME plus a timeTrace segment in EXTRA_INFO). Also make InteractionEventCollector::Report idempotent so a delayed second report (e.g. a surviving subscription firing after completion) can neither emit a duplicate event nor inflate timing. Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> 🤖 AI[98%] 🔧 Human Fixed[0%] 🧑 Human[2%] 👌 AI Adopted[100%] Co-authored-by: claude (glm-5.2) <ai@local> Change-Id: I059b54cd094d3677aededa7bd274b5c554c33eeb | 3 天前 |