User Interfaces¶
1. AUTH¶
1.1 Registration¶
Registering a system
Before logging in, a graphical verification code is required to pass through the verifyCode parameter.
Resource URI: /login
Method: POST
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
verifyCode |
Graphics Validation Code |
query |
Yes. |
|
username |
用户名/邮箱 |
body |
Yes. |
|
password |
Password. |
body |
Yes. |
Example response:
response 200 OK
1.2 Access to current login user information¶
and obtaining the information of the current login user through the interface after the user login is successful.
Resource URI: /auth/login-info
Method: GET
Example response:
response 200 OK
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org",
"createTime":"2021-02-24 04:39:23",
"allowed": true,
"userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
"permissions": [
{
"platform": "APPSTORE",
"role": "GUEST"
}
]
}
1.4 ObtainAccessToken¶
The northbound interface needs to be obtained through the interface before callingAccessToken。
Resource URI: /v1/accesstoken
Method: POST
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
userFlag |
用户名/邮箱 |
body |
Yes. |
|
password |
Password. |
body |
Yes. |
Example response:
response 200 OK.
{
"userId": "xxxxx",
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
2 USER-MGMT¶
2.1 Registered users¶
registering the user interface, registering successfully returning 200 and returning the user information that has been registered successfully; the interface data is not fully returned to 400.
Before registration, a graphical verification code is required to pass through the verifyCode parameter.
Resource URI: /v1/users
Method: POST
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
verifyCode |
Graphics Validation Code |
query |
Yes. |
|
username |
User name |
body |
Yes. |
Must be a combination of letters or letters and numbers, must start with a letter, between 6 and 30 characters in length |
password |
Password. |
body |
Yes. |
Complexity requirements must be met, must be a combination of number/letter/t number characters, length between 6 and 18 characters |
mailAddress |
Mailbox Address |
body |
not |
If completed, the format requirements of the mailbox address must be met |
Example request:
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org",
"password": "123.qwe"
}
Example response:
response 201 OK
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org",
"userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
"permissions": [
{
"platform": "APPSTORE",
"role": "GUEST"
}
]
}
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
response 500 INTERNAL ERROR
{
"code": 0,
"message": "string"
}
2.2 Modify password (personal modification password & recover password)¶
Personal password modification includes three scenarios:
the personal password is modified by the original password verification mode in the personal centre after the user is logged in.
(2) After the admin logs in for the first time, it is mandatory to change the personal default password
(3) The password of a non-guest user expires after more than 90 days, and it is mandatory to change the password after logging in
如果用户注册时提供了真实的邮箱地址(也可以在个人中心填写该信息),可以通过邮箱重置密码。需要开启邮件服务才能使用。
Resource URI: /v1/users/password
Method: PUT
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
type |
Modify the type of password |
body |
Yes. |
1 – Password verification modification; 2 – password recovery |
newPassword |
New password after modification |
body |
Yes. |
Complexity requirements must be met, must be a combination of number/letter/t number characters, length between 6 and 18 characters |
oldPassword |
original password |
body |
not |
Required when type= 1 |
mailAddress |
Mailbox Address |
body |
not |
当type=2时,填写已经注册过的邮箱地址 |
verificationCode |
Verification code |
body |
not |
6 valid numbers.Required when type= 2 |
Example request:
{
"type": 2,
"newPassword": "123.qwe",
"oldPassword": "",
"mailAddress": "test@edgegallery.org",
"verificationCode": "123456"
}
Example response:
response 200 OK
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
response 500 INTERNAL ERROR
{
"code": 0,
"message": "string"
}
2.3 Check repeat user¶
判断用户名、邮箱地址是否已经注册过,不允许重复注册。
Resource URI: /v1/users/action/uniqueness
Method: POST
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
username |
User name |
body |
Yes. |
Must be a combination of letters or letters and numbers, must start with a letter, between 6 and 30 characters in length |
mailAddress |
Mailbox Address |
body |
not |
If completed, the format requirements of the mailbox address must be met |
Example request:
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org"
}
Example response:
response 200 OK
{
"username": true or false,
"mailAddress": true or false
}
2.4 List of query users¶
List of user administrators
Resource URI: /v1/users/list
Method: POST
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
username |
User name |
body |
not |
User name keyword for fuzzy query conditions |
mailAddress |
Mailbox Address |
body |
not |
Mailbox address keyword for fuzzy query conditions |
role |
characters |
body |
Yes. |
ALL – All; ADMIN – Manager; TENANT – Tenant; GUEST – Visitors |
status |
state |
body |
Yes. |
-1 – All; 0 – Disabled; 1 – Enable |
createTimeBegin |
Creation Time (i.e. Enrollment Time) Range – Initiation |
body |
not |
From Time, Format: 2021-1-21 |
createTimeEnd |
Creation Time (i.e. Enrollment Time) Range – Termination |
body |
not |
Termination Time, Format: 2021-2-1 |
offset |
Query starting position |
body |
Yes. |
Paging control parameters, indicating the initial location of the query |
limit |
Query Records |
body |
Yes. |
Paging control parameters that indicate the number of query records per page |
sortBy |
Sort field |
body |
not |
Word name for sorting.USERNAME – Sort by username; CREATETIME – Sort by create (registration) time |
sortOrder |
Sort Order |
body |
not |
Sort sequence.ASC – Ascending; DESC – Descending |
Example request:
{
"username": "",
"mailAddress": "",
"role": "",
"status": -1,
"createTimeBegin": "2021-1-21",
"createTimeEnd": "2021-2-1",
"queryCtrl": {
"offset": 0,
"limit": 10,
"sortBy": "USERNAME",
"sortOrder": "DESC"
}
}
Example response:
response 200 OK
{
"totalCount": 20,
"userList": [
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org",
"userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
"permissions": [
{
"platform": "APPSTORE",
"role": "GUEST"
}
],
"allowed": true,
"createTime": "2021-1-21 10:24:45"
}
]
}
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
response 500 INTERNAL SERVER ERROR
{
"code": 0,
"message": "string"
}
2.5 Delete user¶
The user administrator can delete any user based on the user ID
Resource URI: /v1/users/{userId}
Method: DELETE
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
userId |
User ID |
path |
Yes. |
uuid |
Example request:
Example response:
response 200 OK
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
2.6 Modifies user personal information¶
The user can modify the personal information and return the modified information.
Resource URI: /v1/users/{userId}
Method: PUT
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
userId |
User ID |
path |
Yes. |
uuid |
username |
User name |
body |
Yes. |
Must be a combination of letters or letters and numbers, must start with a letter, between 6 and 30 characters in length |
mailAddress |
Mailbox Address |
body |
not |
If completed, the format requirements of the mailbox address must be met |
Example request:
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org"
}
Example response:
response 200 OK
{
"username": "TestUser1",
"mailAddress": "test@edgegallery.org",
"userId": "37423702-051a-46b4-bf2b-f190759cc0b8",
"permissions": [
{
"platform": "APPSTORE",
"role": "GUEST"
}
]
}
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
2.7 Disable user¶
The user administrator can disable the user according to the user ID, wherein the user ID is the user ID of the non-built-in user.The user will not be able to register after disabling.
Resource URI: /v1/users/status/{userId}/disallow
Method: PUT
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin
Name |
Definition |
type |
Required |
Describe |
---|---|---|---|---|
userId |
User ID |
path |
Yes. |
uuid |
Example request:
Example response:
response 200 OK
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
2.8 Enable users¶
The user administrator can enable the user according to the user ID, wherein the user ID is the user ID of the non-built-in user.
Resource URI: /v1/users/status/{userId}/disallow
Method: PUT
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
userId |
User ID |
path |
Yes. |
uuid |
Example request:
Example response:
response 200 OK
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
2.9 User roles are set¶
The user administrator can set the role and the accessible platform thereof according to the user ID.
Resource URI: /v1/users/settings/{userId}
Method: PUT
Role: APPSTORE_ADMIN or DEVELOPER_ADMIN or MECM_ADMIN or LAB_ADMIN or ATP_ADMIN
User: admin
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
userId |
User ID |
path |
Yes. |
uuid |
platform |
Access platform |
body |
Yes. |
User accessible platform |
role |
characters |
body |
Yes. |
The role of the user |
Example request:
{
"permissions": [
{
"platform": "APPSTORE",
"role": "GUEST"
}
]
}
Example response:
response 200 OK
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 403 FORBIDDEN
{
"code": 0,
"message": "string"
}
3 IDENTITY¶
3.1 获取邮件验证码¶
Send the verification code to the designated mailbox, send a successful return 200, and send the failure back to 417.
It is necessary to obtain the graphical verification code before sending the message verification code, which is passed through the verifyCode parameter.
Resource URI: /v1/identity/mail
Method: POST
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
verifyCode |
Graphics Validation Code |
query |
Yes. |
|
mailAddress |
Mailbox Address |
body |
Yes. |
Mailbox address to receive verification code |
Example request:
{
"mailAddress": "test@edgegallery.org"
}
Example response:
response 200 OK
response 400 Bad Request
{
"code": 0,
"message": "string"
}
response 417 Expectation Failed
{
"code": 0,
"message": "string"
}
3.2 获取图形验证码¶
Get picture data stream with verification code
Resource URI: /v1/identity/verifycode-image
Method: GET
The interface does not take any request parameters and returns the binary picture data stream
Validation is valid in 3 minutes
3.3 预校验图形验证码正确性¶
pre-checking if the verification code input by the user is correct
Resource URI: /v1/identity/verifycode-image/precheck
Method: GET
Name |
Definition |
Type |
Required |
Describe |
---|---|---|---|---|
verifyCode |
Graphics Validation Code |
query |
Yes. |
Example response:
response 200 OK
{
"checkResult": true
}