按 user_id 评估指定用户当前命中的可信设备策略,返回生效的策略内容,可用于判断该用户是否允许申请可信设备。
- Scope:
admin.v1.trusted-device-policies.read - 权限项: 可信设备策略读取
- 权限类型: read
- 接口: POST
/api/openapi/v1/trusted-device-policies/evaluations
Authorization: Bearer <API_KEY>。应用必须配置“全部用户”范围(subject_scope={"mode":"all"});受限或无效范围在业务执行前返回 403 openapi_subject_scope_denied。各 Scope 独立授权,互不隐含。组织及应用操作主体取自可信鉴权,不接受请求参数指定。
请求参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
user_id | body | string | True | 设备所属用户标识 |
请求示例
响应字段
| 名称 | 类型 | 说明 |
|---|---|---|
policy | object | 用户实际命中的策略 |
policy.allow_trust_requests | boolean | 允许申请可信设备 |
policy.created_at | string | 创建时间 |
policy.created_by | string | 创建主体标识 |
policy.created_by_email | string | 创建主体邮箱 |
policy.created_by_name | string | 创建主体名称 |
policy.description | string | 说明 |
policy.first_device_auto_trust | boolean | 首台设备是否自动可信 |
policy.id | string | 记录标识 |
policy.is_default | boolean | 是否默认策略 |
policy.name | string | 名称 |
policy.priority | integer | 策略优先级 |
policy.scope_type | string | 作用范围类型;enum=['all', 'specified'] |
policy.subjects | array | 作用范围对象 |
policy.subjects[].id | string | 记录标识 |
policy.subjects[].name | string | 名称;maxLength=255 |
policy.subjects[].type | string | 对象类型;enum=['department', 'user_group', 'user'] |
policy.updated_at | string | 更新时间 |
policy.updated_by | string | 更新主体标识 |
policy.updated_by_email | string | 更新主体邮箱 |
policy.updated_by_name | string | 更新主体名称 |
policy.validation_enabled | boolean | 是否启用设备验证 |
policy.version | integer | 并发控制版本 |
user_id | string | 设备所属用户标识 |
错误处理
沿用 {error, detail, code} 错误结构。身份校验失败为 401/403;缺少 Scope 或非全部用户范围为 403;资源不存在为 404;冲突或旧版本为 409;参数不合法为 400/422;依赖不可用为 503。业务错误沿用控制台语义。