查询账号密码策略
功能介绍
该接口可以用于查询账号密码策略。
URI
GET /v3.0/OS-SECURITYPOLICY/domains/{domain_id}/password-policy
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
domain_id |
是 |
String |
待查询的账号ID。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
拥有Security Administrator权限的token。 |
响应参数
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
object |
密码策略。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
maximum_consecutive_identical_chars |
Integer |
同一字符连续出现的最大次数。 |
|
maximum_password_length |
Integer |
密码最大字符数。 |
|
minimum_password_age |
Integer |
密码最短使用时间(分钟)。 |
|
minimum_password_length |
Integer |
密码最小字符数。 |
|
number_of_recent_passwords_disallowed |
Integer |
密码不能与历史密码重复次数。 |
|
password_not_username_or_invert |
Boolean |
密码是否可以是用户名或用户名的反序。 |
|
password_requirements |
String |
设置密码必须包含的字符要求。 |
|
password_validity_period |
Integer |
密码有效期(天)。 |
请求示例
GET https://sample.domain.com/v3.0/OS-SECURITYPOLICY/domains/{domain_id}/password-policy
响应示例
状态码为 200 时:
请求成功。
{
"password_policy" : {
"password_requirements" : "A password must contain at least two of the following: uppercase letters, lowercase letters, digits, and special characters.",
"minimum_password_age" : 20,
"minimum_password_length" : 8,
"maximum_password_length" : 32,
"number_of_recent_passwords_disallowed" : 2,
"password_validity_period" : 60,
"maximum_consecutive_identical_chars" : 3,
"password_not_username_or_invert" : true
}
}
状态码为 403 时:
没有操作权限。
- 示例 1
{
"error_msg" : "You are not authorized to perform the requested action.",
"error_code" : "IAM.0002"
}
- 示例 2
{
"error_msg" : "Policy doesn't allow %(actions)s to be performed.",
"error_code" : "IAM.0003"
}
状态码为 404 时:
未找到相应的资源。
{
"error_msg" : "Could not find %(target)s: %(target_id)s.",
"error_code" : "IAM.0004"
}
状态码为 500 时:
内部服务错误。
{
"error_msg" : "An unexpected error prevented the server from fulfilling your request.",
"error_code" : "IAM.0006"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
请求成功。 |
|
401 |
认证失败。 |
|
403 |
没有操作权限。 |
|
404 |
未找到相应的资源。 |
|
500 |
内部服务错误。 |