identity (0.3.0)

Download OpenAPI specification:

Tenant-aware facade over Keycloak: customer accounts and staff login.

system

Health and version, the same in every service

Liveness and database check

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "database": "up"
}

Code the running image was built from (read by the status page)

Responses

Response samples

Content type
application/json
{
  • "service": "platform-api",
  • "commit": "string",
  • "buildTime": "string",
  • "source": "pawnshop/pawnshopapp/platform-api"
}

realms

One Keycloak realm per tenant, from the realm template

Create the tenant's realm, or bring it to the current template (safe to repeat)

Needs permission tenant.create (platform staff; platform-api passes the operator's token on). The realm gets the built-in roles and permissions, the back-office client (signed JWT with the back office's keys), password and brute-force policy and the email settings. Existing users, roles and clients stay as they are.

Authorizations:
keycloak
path Parameters
tenantId
required
string <uuid>

The tenant's id; the realm is named by it

Request Body schema: application/json
optional
displayName
string <= 255 characters

Shown on the sign-in page; the tenant can change it later

Responses

Request samples

Content type
application/json
{
  • "displayName": "string"
}

Response samples

Content type
application/json
{
  • "name": "string"
}

setup

The platform's first setup, once per environment

Whether the platform still needs its first setup

Exists only until setup is done (afterwards 404).

Responses

Response samples

Content type
application/json
{
  • "required": true
}

Create the platform realm and invite its first operator

Needs the one-time code identity wrote to its setup code file when it started without a platform realm. Creates the platform realm from the template and the operator (platform-admin); Keycloak emails them a link to set their password. One attempt at a time: while it runs, every other identity request but health and version gets 503. Afterwards this endpoint answers 404.

Request Body schema: application/json
required
code
required
string

The one-time code from identity's setup code file

email
required
string <email> <= 254 characters

The first operator's email address

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "realm": "string",
  • "operatorEmail": "user@example.com"
}