API: Users
Two of the following request require authorities. Currently there exists following ones:
- **MANAGE_USERS - ** User can manage users
- **MANAGE_LISTENERS - ** User can manage listeners
- **MANAGE_PAYLOADS - ** User can manage payloads
- **MANAGE_AGENTS - ** User can manage agents
- **SEND_COMMANDS - ** User can send commands
- **MODIFY_FILES - ** User can modify files
- **VIEW_RESOURCES - ** Base authority to view agents, listeners, files, commands (but not users), all users must have this authority
List of all users
Request
| GET /api/v1/users HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Request
| GET /api/v1/users/{USER_NAME} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Get my user info
Request
| GET /api/v1/users/me HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Change my password
Request
| PUT /api/v1/users/me/password HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"oldPassword": "{OLD_PASSWORD}",
"newPassword": "{NEW_PASSWORD}"
}
|
Add new user
Request
| POST /api/v1/users HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"username": "{USER_NAME}",
"password": "{USER_PASSWORD}",
"authorities": {LIST_OF_AUTHORITIES}
}
|
Edit existing user
Request
| PUT {{url}}/api/v1/users/{USER_NAME} HTTP/1.1
Authorization: Bearer {{auth_token}}
Content-Type: application/json
{
"enabled": {SHOULD_USER_BE_ENABLED},
"authorities": {LIST_OF_AUTHORITIES}
}
|