Create device
Motivation
Create(register) a new device
Functional design
POST /api/v2/apps/{owner}/{app}/devices
Headers
| Key | Value |
|---|---|
| Authorization | Bearer {principalToken} |
| Content-Type | application/json |
Parameters
| Parameter | Type | Description |
|---|---|---|
| owner | string | name of a user who owns the application |
| app | string | name of an application |
Result
| Code | Description | Body |
|---|---|---|
| 201 | Created, see response 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 |
Response example 201:
{
"login": "{generated-login}",
"password": "{generated-password}"
}
To fetch the WSID of a profile, the caller should use the /auth/login endpoint with the generated login and password.
Technical design
Components
- pkg/router
- URL path handler
~cmp.routerDevicesCreatePathHandler~covrd1✅:- parses the request Body
- generates, login, password and pseudo-wsid
- sends v2 request
c.registry.CreateLoginto Command Processor - handles the response and replies with the login and Password
- URL path handler
- pkg/sys/it
- integration test for /users
~it.TestDevicesCreate~covrd2✅
- integration test for /users