fix llt Created-by: gxmm Commit-by: gxmm Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony-sig/applications_applications_cangjie_wrapper/issues/27 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无" 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无" * 3.4 其他技术优化内容(做了什么,变更了什么) - 重构了 xxxx 代码 - xxxx 算法优化 * 3.5 废弃通知(什么字段、方法弃用?) * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony-sig/accesscontrol_accesscontrol_cangjie_wrapper!30
accesscontrol_cangjie_wrapper(beta feature)
Introduction
The accesscontrol_cangjie_wrapper is a Cangjie API encapsulated on OpenHarmony based on the access_token capability. The access_token information of the application mainly includes the application identity APPID, user ID, application clone index, application APL (Ability Privilege Level) level, application permission information, etc. The access_token information of each application is identified by a 32-bit unique device identifier, TokenID. Cangjie apis provides APIs for application permission management, including authentication and authorization. The currently accesscontrol Cangjie api only supports standard devices.
System Architecture
Figure 1 System architecture of accesscontrol_cangjie_wrapper
As shown in the architecture diagram:
interface: Provides APIs for developers.
- abilityAcessCtrl:
- checkAccessToken: accesscontrol_cangjie_wrapper provides permission verification and management capabilities for applications. Developers can check whether an application has been authorized.
- requestPermissions: Developers can request user authorization, and the result of this permission application will be returned.
frameworks:
- abilityAcessCtrl wrapper:
- checkAccessToken wrapper: Encapsulates the checkAccessToken interface, providing developers with the ability to check whether an application has been authorized.
- requestPermissions wrapper: Encapsulates the requestPermissionsFromUser interface, providing developers with the ability to request permissions from users.
Dependency Component Introduction in Architecture:
- access_token: It is responsible for providing basic functions of application access control, and encapsulates C interfaces to provide interoperability for Cangjie.
- hiviewdfx_cangjie_wrapper: Responsible for providing HiLog APIs, used for printing logs at critical paths.
- cangjie_ark_interop: Responsible for providing APILevel definitions, used for annotating APIs. Also provides the BusinessException exception class definition that is thrown to users.
- ability_cangjie_wrapper: Responsible for providing UIAbilityContext to the authorization interface for launching permission request dialogs to users.
Directory Structure
The source code of the program access control is under base/accesscontrol/accesstrol_cangjie_wrapper
base/accesscontrol/accesscontrol_cangjie_wrapper
├── figures # architecture pictures
├── ohos # Cangjie program access control interface
│ ├── ability_access_ctrl # Cangjie program access control management interface
│ └── security # Permission request result object
└── test # Cangjie test code
└── ability_access_ctrl # Cangjie AbilityAccessCtrl test code
Usage Guidelines
The following features are provided:
- The AbilityAccessCtrl module provides APIs for application permission management, including authentication and authorization. For relevant guidance, please refer to Requesting User Authorization.
The following features are not provided yet:
- Check the status of application permissions.
- Displays a dialog box for setting a global swich.
- Displays a permission settings dialog box to grant permissions the second time.
For Accesscontrol-related APIs, please refer to ohos.ability_access_ctrl (Application Access Control Management). For relevant guidance, please refer to Access Control Overview.
Code Contribution
Developers are welcome to contribute code, documentation, etc. For specific contribution processes and methods, please refer to Code Contribution.
Constraints
The following features are not provided yet:
- Check the status of application permissions.
- Displays a dialog box for setting a global swich.
- Displays a permission settings dialog box to grant permissions the second time.
Repositories Involved
arkcompiler_cangjie_ark_interop
