Mikro-služba introspekce uživatelů

GraphQL API dokumentace

O projektu

Tento výzkum byl podpořen Programem bezpečnostního výzkumu České republiky v letech 2015–2022 (BV III/1-VS), který je poskytovaný Ministerstvem vnitra ČR, v projektu č. VI20202022164 Pokročilá orchestrace bezpečnosti a inteligentní řízení hrozeb.

Query

getTokenIntrospection

Popis

Získání informací o uživateli podle poskytnutého JWT tokenu v autorizační HTTP hlavičce

Odpověď

Vrací User

Příklad

Dotaz
query getTokenIntrospection {
  getTokenIntrospection {
    id
    createdTimestamp
    username
    enabled
    totp
    email
    emailVerified
    firstName
    lastName
    disableableCredentialTypes
    requiredActions
    notBefore
  }
}
Odpověď
{
  "data": {
    "getTokenIntrospection": {
      "id": "abc123",
      "createdTimestamp": 987.65,
      "username": "abc123",
      "enabled": true,
      "totp": true,
      "email": "abc123",
      "emailVerified": true,
      "firstName": "xyz789",
      "lastName": "xyz789",
      "disableableCredentialTypes": [
        "abc123"
      ],
      "requiredActions": ["xyz789"],
      "notBefore": 123
    }
  }
}

getUser

Popis

Získání informací o uživateli podle realmu a ID uživatele

Argumenty:

  • realm (String): Realm ve kterém se uživatel nachází
  • userId (String): ID uživatele
Odpověď

Vrací User

Argumenty
Jméno Popis
userId - String!
realm - String!

Příklad

Dotaz
query getUser(
  $userId: String!,
  $realm: String!
) {
  getUser(
    userId: $userId,
    realm: $realm
  ) {
    id
    createdTimestamp
    username
    enabled
    totp
    email
    emailVerified
    firstName
    lastName
    disableableCredentialTypes
    requiredActions
    notBefore
  }
}
Proměnné
{
  "userId": "abc123",
  "realm": "abc123"
}
Odpověď
{
  "data": {
    "getUser": {
      "id": "abc123",
      "createdTimestamp": 987.65,
      "username": "abc123",
      "enabled": false,
      "totp": false,
      "email": "xyz789",
      "emailVerified": true,
      "firstName": "xyz789",
      "lastName": "abc123",
      "disableableCredentialTypes": [
        "xyz789"
      ],
      "requiredActions": ["abc123"],
      "notBefore": 987
    }
  }
}

userSearch

Popis

Vyhledání uživatele na základě údajů jako realm, uživatelské jméno, email, alias apod.

Argumenty:

  • filter (UserInfoSearchInput): Filtry pro vyhledávání uživatele
Odpověď

Vrací UserInfoSearchResult!

Argumenty
Jméno Popis
filter - UserInfoSearchInput!

Příklad

Dotaz
query userSearch($filter: UserInfoSearchInput!) {
  userSearch(filter: $filter) {
    data {
      id
      createdTimestamp
      username
      enabled
      totp
      email
      emailVerified
      firstName
      lastName
      disableableCredentialTypes
      requiredActions
      notBefore
    }
  }
}
Proměnné
{"filter": UserInfoSearchInput}
Odpověď
{"data": {"userSearch": {"data": [User]}}}

Typy

User

Pole
Jméno pole Popis
id - String
createdTimestamp - Float
username - String
enabled - Boolean
totp - Boolean
email - String
emailVerified - Boolean
firstName - String
lastName - String
disableableCredentialTypes - [String!]
requiredActions - [String!]
notBefore - Int
Příklad
{
  "id": "abc123",
  "createdTimestamp": 123.45,
  "username": "abc123",
  "enabled": false,
  "totp": false,
  "email": "abc123",
  "emailVerified": false,
  "firstName": "xyz789",
  "lastName": "abc123",
  "disableableCredentialTypes": ["abc123"],
  "requiredActions": ["xyz789"],
  "notBefore": 987
}

String

Popis

Skalární typ String představuje textová data, reprezentovaná jako sekvence znaků UTF-8. Typ String používá GraphQL nejčastěji k reprezentaci textu čitelného člověkem.

Příklad
"abc123"

Float

Popis

Skalární typ Float představuje zlomkové hodnoty se znaménkem s dvojitou přesností podle specifikace IEEE 754.

Příklad
987.65

Boolean

Popis

Skalární typ Boolean představuje true nebo false.

Příklad
true

Int

Popis

Skalární typ Int představuje celé číselné hodnoty se znaménkem bez zlomků. Int může představovat hodnoty mezi -(2^31) a 2^31 - 1.

Příklad
987

UserInfoSearchResult

Pole
Jméno pole Popis
data - [User!]
Příklad
{"data": [User]}

UserInfoSearchInput

Pole
Input Pole Popis
realm - String!
username - String
email - String
emailVerified - Boolean
enabled - Boolean
firstName - String
idpAlias - String
idpUserId - String
lastName - String
exact - Boolean
max - Int
Příklad
{
  "realm": "xyz789",
  "username": "abc123",
  "email": "xyz789",
  "emailVerified": true,
  "enabled": true,
  "firstName": "xyz789",
  "idpAlias": "abc123",
  "idpUserId": "xyz789",
  "lastName": "xyz789",
  "exact": false,
  "max": 123
}