๐Ÿ›ก๏ธ ttp-idm

December 22, 2025 ยท View on GitHub

MegaLinter build docker codecov

TTP Identity Management service

This service provides identity and pseudonym management with the Trusted third party (TTP) tools E-PIX and gPAS.

API

An OpenApi spec is generated when building the service which can be obtained from /api-docs/openapi.json at runtime or via the SwaggerUI (/swagger-ui) endpoint.

A copy of the current API doc is located at /api-docs/openapi.json. Inspect the API at swagger.io.

POST /api/pseudonyms (create pseudonyms for participant)

Flowchart for the create_pseudonyms workflow

Adds participant to E-PIX and generate pseudonyms and ids for the provided trial.

The lab property determines the number of pseudonyms to be created for each individual laboratory by name.

Note

Property keys for these are dynamic.

Body

content-typedata typerequired
application/jsonIdRequesttrue

Responses

http codecontent-typeresponse
200 Okapplication/jsonIdResponse
409 Conflictapplication/jsonPromptResponse
404 Not Foundapplication/jsonLink.id does not match with provided idat
500 Internal Server Errortext/plain;charset=UTF-8Error message

Example

Request

{
  "idat": {
    "first_name": "Erika",
    "last_name": "Mustermann",
    "birth_name": "Musterfrau",
    "birth_date": "1975-08-22",
    "birth_place": "Musterstadt",
    "postal_code": "35037",
    "city": "Marburg"
  },
  "trial": "Studie",
  "lab": {
    "Labor 1": 2,
    "Labor 2": 4
  }
}

Response

{
  "participant": "VYMGJ9TUMDHFPL14",
  "lab": {
    "Labor 2": [
      "0LTKNJNZC5ZEWHG0",
      "CXPEA1CP85JUKCVJ",
      "MFXLKP5Y4PPTKUZV",
      "3XPYZ932JCYAZ8TW"
    ],
    "Labor 1": [
      "CCRPJTW1R8WU6W3P",
      "1NFTHGWYNVYQEAPY"
    ]
  }
}

GET /api/pseudonyms/{trial}/{psn} (get pseudonyms for participant and trial)

Get all pseudonyms for a participant by trial and psn.

Responses

http codecontent-typeresponse
200 Okapplication/jsonIdResponse
404 Not Foundapplication/jsonNo pseudonyms found for trial and psn

Example

Request

url: /api/pseudonyms/Studie/VYMGJ9TUMDHFPL14

Response

{
  "participant": "VYMGJ9TUMDHFPL14",
  "lab": {
    "Labor 2": [
      "0LTKNJNZC5ZEWHG0",
      "CXPEA1CP85JUKCVJ",
      "MFXLKP5Y4PPTKUZV",
      "3XPYZ932JCYAZ8TW"
    ],
    "Labor 1": [
      "CCRPJTW1R8WU6W3P",
      "1NFTHGWYNVYQEAPY"
    ]
  }
}

Authorization

OAuth2 Client credentials flow can be configured in order to authorize trusted clients by providing a valid access token from the issuer (Authorization server).

Configuration properties

Application properties are read from a properties file (app.yaml) with default values.

NameDefaultDescriptionRequired
log_levelinfoLog level (error,warn,info,debug,trace)
auth.oidc.issuer_urlOAuth2 Client credentials issuer
auth.oidc.client_idOAuth2 Client credentials: client id
auth.oidc.client_secretOAuth2 Client credentials: client secret
ttp.epix.base_urlE-PIX base urlโœ“
ttp.epix.domain.nametestE-PIX MPI domain
ttp.epix.domain.descriptionTest domainE-PIX MPI domain description
ttp.epix.identifier_domainMPIE-PIX MPI identifier domain
ttp.epix.data_sourcedummy_safe_sourceE-PIX id safe source
ttp.gpas.base_urlgPAS base urlโœ“
ttp.timeout120Retry timeout

Environment variables

Override configuration properties by providing environment variables with their respective property names. Replace . with double underscore (__).

Example deployment

Docker compose:

query:
  image: ghcr.io/diz-unimr/ttp-idm:latest
  environment:
    LOG_LEVEL: debug
    TTP__EPIX__BASE_URL: http://localhost:8080
    TTP__EPIX__DOMAIN__NAME: trial
    TTP__GPAS__BASE_URL: http://localhost:8081
    TTP__TIMEOUT: 60

License

AGPL-3.0