j9九游会登录/ 统一身份认证服务 iam_统一身份认证服务(新版)/ api参考/ / / / 校验策略是否有新访问权限 - checknonewaccess
更新时间:2025-12-25 gmt 08:00

校验策略是否有新访问权限 -j9九游会登录

功能介绍

校验策略是否有新访问权限。

授权信息

账号根用户具备所有api的调用权限,如果使用账号下的iam用户调用当前api,该iam用户需具备如下身份策略权限,更多的权限说明请参见权限和授权项

授权项

访问级别

资源类型(*为必须)

条件键

别名

依赖的授权项

accessanalyzer::checknonewaccess

read

-

-

-

-

uri

post /v5/policies/check-no-new-access

请求参数

表1 请求body参数

参数

是否必选

参数类型

描述

existing_policy_document

string

该策略json格式策略文档。

new_policy_document

string

该策略json格式策略文档。

policy_type

string

要校验的策略类型。

  • identity_policy:身份策略

  • agency_trust_policy:委托信任策略

  • bucket_policy:桶策略

响应参数

状态码:200

表2 响应body参数

参数

参数类型

描述

message

string

更新后的策略是否允许新访问权限的消息。

check_result

string

检查新访问权限的结果。

  • pass:无新增访问权限

  • fail:有新增访问权限

reasons

array of checknonewaccessreason objects

新增action的statement描述。

表3 checknonewaccessreason

参数

参数类型

描述

description

string

对访问权限检查结果的推理的描述。

statement_id

string

新增权限statement的sid标识符。

statement_index

integer

新增权限statement的index,从0开始。

最小值:0

请求示例

校验策略是否有新访问权限。

post https://{hostname}/v5/policies/check-no-new-access
{
  "existing_policy_document" : "{\\\"version\\\":\\\"5.0\\\",\\\"statement\\\":[{\\\"effect\\\":\\\"allow\\\",\\\"action\\\":[\\\"iam:users:createuserv5\\\"]}]}",
  "new_policy_document" : "{\\\"version\\\":\\\"5.0\\\",\\\"statement\\\":[{\\\"effect\\\":\\\"allow\\\",\\\"action\\\":[\\\"iam:users:createuserv5\\\",\\\"obs:bucket:createbucket\\\"]}]}",
  "policy_type" : "identity_policy"
}

响应示例

状态码:200

ok

{
  "check_result" : "fail",
  "message" : "the modified permissions grant new access compared to your existing policy.",
  "reasons" : [ {
    "description" : "new access in the statement with sid: {statement_sid}.",
    "statement_index" : 0,
    "statement_id" : "{statement_sid}"
  } ]
}

状态码

状态码

描述

200

ok

错误码

请参见错误码

相关文档

网站地图