Help Center> Identity and Access Management> API Reference> API> Account Management> Querying the Regular Expression or Description of a Password Strength Policy
Updated on 2023-07-05 GMT+08:00

Querying the Regular Expression or Description of a Password Strength Policy

Function

This API is used to query the password strength policy, including the regular expression and description, of a specified account based on specified conditions.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

URI

GET /v3/domains/{domain_id}/config/security_compliance/{option}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Account ID. For details about how to obtain the account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

option

Yes

String

Query condition, which can be password_regex or password_regex_description.

password_regex indicates the regular expression of the password strength policy, and password_regex_description indicates the description of the password strength policy.

Options:

  • password_regex
  • password_regex_description

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

Token (no special permission requirements) of the IAM user corresponding to the domain_id specified in the URL.

Response Parameters

Table 3 Parameters in the response body

Parameter

Type

Description

config

Object

Configuration information.

Table 4 config

Parameter

Type

Description

password_regex

String

Regular expression of the password strength policy. (This parameter is returned if option is set to password_regex.)

password_regex_description

String

Description of the password strength policy. (This parameter is returned if option is set to password_regex_description.)

Example Request

  • Request for querying the password strength policy with option set to password_regex
    GET https://iam.myhuaweicloud.com/v3/domains/{domain_id}/config/security_compliance/password_regex
  • Request for querying the password strength policy with option set to password_regex_description
    GET https://iam.myhuaweicloud.com/v3/domains/{domain_id}/config/security_compliance/password_regex_description

Example Response

Status code: 200

The request is successful.

Example 1: Response to the request with the option parameter being set to password_regex

Example 2: Response to the request with the option parameter being set to password_regex_description

  • Example 1
    {
        "config": {
            "password_regex": "^(?![A-Z]*$)(?![a-z]*$)(?![\\d]*$)(?![^\\W]*$)\\S{6,32}$"
        }
    }
  • Example 2
    {
        "config": {
            "password_regex_description": "The password must contain at least two of the following character types: uppercase letters, lowercase letters, digits, and special characters, and be a length between 6 and 32."
        }
    }

Status Codes

Status Code

Description

200

The request is successful.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

404

The requested resource cannot be found.

405

The method specified in the request is not allowed for the requested resource.

413

The request entity is too large.

500

Internal server error.

Error Codes

None