Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-2995

Serverinfo response grows over time [GHI#39219]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

      Area

      admin/api

      Describe the bug

      The admin api serverinfo call endpoint has become extremely large in our production instances, sometimes upwards of 10MB. Looking at the returned json, this seems to be in large part due to a huge number of repeated elements in the response. This appears to be in the org.keycloak.services.clientpolicy.condition.ClientPolicyConditionProvider entry in the componentTypes, the entry with "id": "grant-type" has the following block repeated significant number of times (e.g. over 25000 copies observed on one instance), identically every time:

      {
        "name": "grant_types",
        "label": "Grant Types",
        "helpText": "The condition evaluates to true if the current grant type is one of those in the list",
        "type": "MultivaluedList",
        "options": [
      

      "authorization_code",
      "implicit",
      "refresh_token",
      "password",
      "client_credentials",
      "urn:ietf:params:oauth:grant-type:token-exchange",
      "urn:ietf:params:oauth:grant-type:device_code"

        ],
        "secret": false,
        "required": false,
        "readOnly": false
      },
      

      After some testing, it became clear that it adds a new repetition to this list every time the endpoint is called.

      Version

      Found on 26.2.0, reproduced in 26.2.1

      Regression

      [x] The issue is a regression

      Expected behavior

      The serverinfo response be a reasonable size without huge repetition

      Actual behavior

      The serverinfo response is now unmanageably large, and growing larger with each call

      How to Reproduce?

      Launch a fresh keycloak instance. Tested with the docker version.
      Make a call to the serverinfo api endpoint, and note the number of elements in componentTypes."org.keycloak.services.clientpolicy.condition.ClientPolicyConditionProvider".[11].properties, where [11] is the entry with "id":"grant-type"
      Make a number of subsequent calls to the serverinfo api endpoint
      Obeserve that the number of entries in the above list is now longer

      Anything else?

      No response

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Core Clients
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: