3
0

Add basic impersonation support for admins

This commit is contained in:
Denis Arh
2020-08-12 18:39:28 +02:00
parent 4d887ba486
commit a57866bcab
10 changed files with 279 additions and 0 deletions

View File

@@ -254,6 +254,7 @@ Warning: implode(): Invalid arguments passed in /private/tmp/Users/darh/Work.cru
| ------ | -------- | ------- |
| `GET` | `/auth/` | Returns auth settings |
| `GET` | `/auth/check` | Check JWT token |
| `POST` | `/auth/impersonate` | Impersonate a user |
| `POST` | `/auth/exchange` | Exchange auth token for JWT |
| `GET` | `/auth/logout` | Logout |
@@ -283,6 +284,21 @@ Warning: implode(): Invalid arguments passed in /private/tmp/Users/darh/Work.cru
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
## Impersonate a user
#### Method
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/auth/impersonate` | HTTP/S | POST | |
#### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| userID | uint64 | POST | ID of the impersonated user | N/A | YES |
| expire | int | POST | expiration time in seconds, must be shorter than 24h | N/A | NO |
## Exchange auth token for JWT
#### Method