Package io.strimzi.systemtest.utils.specific

## Class KeycloakUtils

- java.lang.Object
- - io.strimzi.systemtest.utils.specific.KeycloakUtils

-     public class KeycloakUtils
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `PATH_TO_KEYCLOAK_PREPARE_SCRIPT` |
    `static String` | `PATH_TO_KEYCLOAK_TEARDOWN_SCRIPT` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `deleteKeycloak​(String namespace)` |
    `static void` | `deployKeycloak​(String namespace)` |
    `static io.vertx.core.json.JsonObject` | `getKeycloakRealm​(String baseURI, String token, String desiredRealm)` | Returns specific realm from Keycloak API
    `static io.vertx.core.json.JsonArray` | `getKeycloakRealmClients​(String baseURI, String token, String desiredRealm)` | Returns all clients for specific realm
    `static io.vertx.core.json.JsonArray` | `getPoliciesFromRealmClient​(String baseURI, String token, String desiredRealm, String clientId)` | Returns all policies from client of specific realm
    `static io.vertx.core.json.JsonArray` | `getResourcesFromRealmClient​(String baseURI, String token, String desiredRealm, String clientId)` | Returns all resources from client of specific realm
    `static String` | `getToken​(String baseURI, String userName, String password)` | Returns token from Keycloak API
    `static String` | `putConfigurationToRealm​(String baseURI, String token, io.vertx.core.json.JsonObject config, String desiredRealm)` | Puts new configuration to the specific realm
    `static String` | `updatePolicyOfRealmClient​(String baseURI, String token, io.vertx.core.json.JsonObject policy, String desiredRealm, String clientId)` | Updates policies of specific client in realm

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PATH_TO_KEYCLOAK_PREPARE_SCRIPT

          public static final String PATH_TO_KEYCLOAK_PREPARE_SCRIPT

      See Also:
        Constant Field Values

    - #### PATH_TO_KEYCLOAK_TEARDOWN_SCRIPT

          public static final String PATH_TO_KEYCLOAK_TEARDOWN_SCRIPT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### deployKeycloak

          public static void deployKeycloak​(String namespace)

    - #### deleteKeycloak

          public static void deleteKeycloak​(String namespace)

    - #### getToken

          public static String getToken​(String baseURI,
                                        String userName,
                                        String password)

      Returns token from Keycloak API
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `userName` - name of user
        `password` - password of user
      Returns:
        user token

    - #### getKeycloakRealm

          public static io.vertx.core.json.JsonObject getKeycloakRealm​(String baseURI,
                                                                       String token,
                                                                       String desiredRealm)

      Returns specific realm from Keycloak API
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `token` - admin token
        `desiredRealm` - realm we want to get
      Returns:
        JsonObject with whole desired realm from Keycloak

    - #### getKeycloakRealmClients

          public static io.vertx.core.json.JsonArray getKeycloakRealmClients​(String baseURI,
                                                                             String token,
                                                                             String desiredRealm)

      Returns all clients for specific realm
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `token` - admin token
        `desiredRealm` - realm we want to get clients from
      Returns:
        JsonArray with all clients set for the specific realm

    - #### getResourcesFromRealmClient

          public static io.vertx.core.json.JsonArray getResourcesFromRealmClient​(String baseURI,
                                                                                 String token,
                                                                                 String desiredRealm,
                                                                                 String clientId)

      Returns all resources from client of specific realm
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `token` - admin token
        `desiredRealm` - realm we want to get clients from
        `clientId` - id of desired client
      Returns:
        JsonArray with all resources for clients in specific realm

    - #### getPoliciesFromRealmClient

          public static io.vertx.core.json.JsonArray getPoliciesFromRealmClient​(String baseURI,
                                                                                String token,
                                                                                String desiredRealm,
                                                                                String clientId)

      Returns all policies from client of specific realm
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `token` - admin token
        `desiredRealm` - realm we want to get clients from
        `clientId` - id of desired client
      Returns:
        JsonArray with all policies for clients in specific realm

    - #### putConfigurationToRealm

          public static String putConfigurationToRealm​(String baseURI,
                                                       String token,
                                                       io.vertx.core.json.JsonObject config,
                                                       String desiredRealm)

      Puts new configuration to the specific realm
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `token` - admin token
        `desiredRealm` - realm where the config should be put
        `config` - configuration we want to put into the realm
      Returns:
        response from server

    - #### updatePolicyOfRealmClient

          public static String updatePolicyOfRealmClient​(String baseURI,
                                                         String token,
                                                         io.vertx.core.json.JsonObject policy,
                                                         String desiredRealm,
                                                         String clientId)

      Updates policies of specific client in realm
      Parameters:
        `baseURI` - base uri for accessing Keycloak API
        `token` - admin token
        `desiredRealm` - realm where the client policies should be updated
        `policy` - new updated policies
        `clientId` - id of client where we want to update policies
      Returns:
        response from server