Refresh principal token
Motivation
Refreshes a valid principal token
Functional design
POST /api/v2/apps/{owner}/{app}/auth/refresh
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {PrincipalToken} |
Parameters
| Parameter | Type | Description |
|---|---|---|
| owner | string | name of a user who owns the application |
| app | string | name of an application |
Result
| Code | Description | Body |
|---|---|---|
| 200 | OK | Returns a refreshed principal token, see below |
| 400 | Bad Request | error object |
| 401 | Unauthorized | error object |
| 403 | Forbidden | error object |
| 429 | Too may requests, rate limiting | error object |
| 500+ | Server errors / service unavailable | error object |
Example result 200:
{
"principalToken": "abc.def.ghi",
"expiresInSeconds": 3600, // seconds
"profileWSID": 1234567890
}
Technical design
Components
- pkg/router
- URL path handler
~cmp.routerRefreshHandler~covrd1✅- sends
APIPath_Auth_Refreshrequest to QueryProcessor;
- sends
- URL path handler
- pkg/processors/query2
- pkg/sys/it
- integration test for /refresh
~it.TestRefresh~covrd6✅
- integration test for /refresh