Create new 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

401

Unauthorized

403

Forbidden

429

Too may requests, rate limiting

500+

Server errors / service unavailable

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~✅:

      • parses the request Body

      • generates, login, password and pseudo-wsid

      • sends v2 request c.registry.CreateLogin to Command Processor

      • handles the response and replies with the login and Password

  • pkg/sys/it

    • integration test for /users

      • ~it.TestDevicesCreate~

Last updated

Was this helpful?