diff --git a/connections/jpa/src/main/java/org/keycloak/connections/jpa/DefaultJpaConnectionProviderFactory.java b/connections/jpa/src/main/java/org/keycloak/connections/jpa/DefaultJpaConnectionProviderFactory.java index 61bbafa6bf..a79c82b228 100755 --- a/connections/jpa/src/main/java/org/keycloak/connections/jpa/DefaultJpaConnectionProviderFactory.java +++ b/connections/jpa/src/main/java/org/keycloak/connections/jpa/DefaultJpaConnectionProviderFactory.java @@ -13,10 +13,12 @@ import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.sql.DataSource; import java.sql.Connection; +import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -29,6 +31,8 @@ public class DefaultJpaConnectionProviderFactory implements JpaConnectionProvide private volatile EntityManagerFactory emf; private Config.Scope config; + + private Map operationalInfo; @Override public JpaConnectionProvider create(KeycloakSession session) { @@ -120,56 +124,73 @@ public class DefaultJpaConnectionProviderFactory implements JpaConnectionProvide properties.put("hibernate.show_sql", config.getBoolean("showSql", false)); properties.put("hibernate.format_sql", config.getBoolean("formatSql", true)); - if (databaseSchema != null) { - logger.trace("Updating database"); + connection = getConnection(); + try{ + prepareOperationalInfo(connection); + + if (databaseSchema != null) { + logger.trace("Updating database"); + + JpaUpdaterProvider updater = session.getProvider(JpaUpdaterProvider.class); + if (updater == null) { + throw new RuntimeException("Can't update database: JPA updater provider not found"); + } + + if (databaseSchema.equals("update")) { + String currentVersion = null; + try { + ResultSet resultSet = connection.createStatement().executeQuery(updater.getCurrentVersionSql(schema)); + if (resultSet.next()) { + currentVersion = resultSet.getString(1); + } + } catch (SQLException e) { + } + + if (currentVersion == null || !JpaUpdaterProvider.LAST_VERSION.equals(currentVersion)) { + updater.update(session, connection, schema); + } else { + logger.debug("Database is up to date"); + } + } else if (databaseSchema.equals("validate")) { + updater.validate(connection, schema); + } else { + throw new RuntimeException("Invalid value for databaseSchema: " + databaseSchema); + } + + logger.trace("Database update completed"); + } + + logger.trace("Creating EntityManagerFactory"); + emf = Persistence.createEntityManagerFactory(unitName, properties); + logger.trace("EntityManagerFactory created"); - JpaUpdaterProvider updater = session.getProvider(JpaUpdaterProvider.class); - if (updater == null) { - throw new RuntimeException("Can't update database: JPA updater provider not found"); - } - - connection = getConnection(); - - if (databaseSchema.equals("update")) { - String currentVersion = null; - try { - ResultSet resultSet = connection.createStatement().executeQuery(updater.getCurrentVersionSql(schema)); - if (resultSet.next()) { - currentVersion = resultSet.getString(1); - } - } catch (SQLException e) { - } - - if (currentVersion == null || !JpaUpdaterProvider.LAST_VERSION.equals(currentVersion)) { - updater.update(session, connection, schema); - } else { - logger.debug("Database is up to date"); - } - } else if (databaseSchema.equals("validate")) { - updater.validate(connection, schema); - } else { - throw new RuntimeException("Invalid value for databaseSchema: " + databaseSchema); - } - - logger.trace("Database update completed"); - } - - logger.trace("Creating EntityManagerFactory"); - emf = Persistence.createEntityManagerFactory(unitName, properties); - logger.trace("EntityManagerFactory created"); - - // Close after creating EntityManagerFactory to prevent in-mem databases from closing - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - logger.warn(e); - } + } finally { + // Close after creating EntityManagerFactory to prevent in-mem databases from closing + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + logger.warn(e); + } + } } } } } } + + protected void prepareOperationalInfo(Connection connection) { + try { + operationalInfo = new LinkedHashMap<>(); + DatabaseMetaData md = connection.getMetaData(); + operationalInfo.put("databaseUrl",md.getURL()); + operationalInfo.put("databaseUser", md.getUserName()); + operationalInfo.put("databaseProduct", md.getDatabaseProductName() + " " + md.getDatabaseProductVersion()); + operationalInfo.put("databaseDriver", md.getDriverName() + " " + md.getDriverVersion()); + } catch (SQLException e) { + logger.warn("Unable to prepare operational info due database exception: " + e.getMessage()); + } + } private Connection getConnection() { try { @@ -185,5 +206,10 @@ public class DefaultJpaConnectionProviderFactory implements JpaConnectionProvide throw new RuntimeException("Failed to connect to database", e); } } + + @Override + public Map getOperationalInfo() { + return operationalInfo; + } } diff --git a/connections/jpa/src/main/java/org/keycloak/connections/jpa/JpaConnectionProviderFactory.java b/connections/jpa/src/main/java/org/keycloak/connections/jpa/JpaConnectionProviderFactory.java index 1cf4a5f202..288e403335 100644 --- a/connections/jpa/src/main/java/org/keycloak/connections/jpa/JpaConnectionProviderFactory.java +++ b/connections/jpa/src/main/java/org/keycloak/connections/jpa/JpaConnectionProviderFactory.java @@ -1,9 +1,10 @@ package org.keycloak.connections.jpa; -import org.keycloak.provider.ProviderFactory; +import org.keycloak.provider.ServerInfoAwareProviderFactory; /** * @author Stian Thorgersen */ -public interface JpaConnectionProviderFactory extends ProviderFactory { +public interface JpaConnectionProviderFactory extends ServerInfoAwareProviderFactory { + } diff --git a/connections/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java b/connections/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java index 36be680a66..8da15b69c1 100755 --- a/connections/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java +++ b/connections/mongo/src/main/java/org/keycloak/connections/mongo/DefaultMongoConnectionFactoryProvider.java @@ -5,6 +5,7 @@ import com.mongodb.MongoClient; import com.mongodb.MongoClientOptions; import com.mongodb.MongoCredential; import com.mongodb.ServerAddress; + import org.jboss.logging.Logger; import org.keycloak.Config; import org.keycloak.connections.mongo.api.MongoStore; @@ -18,6 +19,8 @@ import javax.net.ssl.SSLSocketFactory; import java.lang.reflect.Method; import java.net.UnknownHostException; import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; /** * @author Stian Thorgersen @@ -57,6 +60,8 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro private MongoStore mongoStore; private DB db; protected Config.Scope config; + + private Map operationalInfo; @Override public MongoConnectionProvider create(KeycloakSession session) { @@ -159,7 +164,13 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro } else { client = new MongoClient(new ServerAddress(host, port), clientOptions); } - + + operationalInfo = new LinkedHashMap<>(); + operationalInfo.put("mongoServerAddress", client.getAddress().toString()); + operationalInfo.put("mongoDatabaseName", dbName); + operationalInfo.put("mongoUser", user); + operationalInfo.put("mongoDriverVersion", client.getVersion()); + logger.debugv("Initialized mongo model. host: %s, port: %d, db: %s", host, port, dbName); return client; } @@ -206,5 +217,10 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro } } } + + @Override + public Map getOperationalInfo() { + return operationalInfo; + } } diff --git a/connections/mongo/src/main/java/org/keycloak/connections/mongo/MongoConnectionProviderFactory.java b/connections/mongo/src/main/java/org/keycloak/connections/mongo/MongoConnectionProviderFactory.java index e787ce6382..bce5fe4b9c 100644 --- a/connections/mongo/src/main/java/org/keycloak/connections/mongo/MongoConnectionProviderFactory.java +++ b/connections/mongo/src/main/java/org/keycloak/connections/mongo/MongoConnectionProviderFactory.java @@ -1,9 +1,9 @@ package org.keycloak.connections.mongo; -import org.keycloak.provider.ProviderFactory; +import org.keycloak.provider.ServerInfoAwareProviderFactory; /** * @author Stian Thorgersen */ -public interface MongoConnectionProviderFactory extends ProviderFactory { +public interface MongoConnectionProviderFactory extends ServerInfoAwareProviderFactory { } diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml index ba7043089f..f0d1326c7b 100644 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml @@ -1,8 +1,6 @@ - - - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-core/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-core/main/module.xml index 07dcd06352..6407abcd19 100644 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-core/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-subsystem/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-subsystem/main/module.xml index 4ae8e9a644..66278bd1d6 100644 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-subsystem/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-adapter-subsystem/main/module.xml @@ -22,7 +22,7 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml index b23c589155..ce36b73e82 100644 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-jboss-adapter-core/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-jboss-adapter-core/main/module.xml index 6e5b217ba5..243a5b9098 100644 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-jboss-adapter-core/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-jboss-adapter-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-servlet-oauth-client/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-servlet-oauth-client/main/module.xml index 7e75f13257..73fccad06c 100755 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-servlet-oauth-client/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-servlet-oauth-client/main/module.xml @@ -1,6 +1,6 @@ - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-undertow-adapter/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-undertow-adapter/main/module.xml index 9ba1cb291a..75ac27ea52 100644 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-undertow-adapter/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-undertow-adapter/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-subsystem/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-subsystem/main/module.xml index 5bc59bdf13..4b2efe5b34 100755 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-subsystem/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-subsystem/main/module.xml @@ -22,7 +22,7 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + diff --git a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-adapter/main/module.xml b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-adapter/main/module.xml index 35a656c15a..88eaafafb4 100755 --- a/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-adapter/main/module.xml +++ b/distribution/feature-packs/adapter-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-adapter/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/core/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/core/main/module.xml index cc18aaaf7a..d2d0ca6983 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/core/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/javase/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/javase/main/module.xml index b73ba9b34b..6909121d9b 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/javase/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/com/google/zxing/javase/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/de/idyl/winzipaes/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/de/idyl/winzipaes/main/module.xml index 410333d7e9..ef5c336abb 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/de/idyl/winzipaes/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/de/idyl/winzipaes/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml index ba7043089f..efc692e786 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/net/iharder/base64/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/freemarker/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/freemarker/main/module.xml index 2043bef613..df8dae383c 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/freemarker/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/freemarker/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/jboss/as/product/keycloak/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/jboss/as/product/keycloak/module.xml index 4367111e2e..d59ccb6965 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/jboss/as/product/keycloak/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/jboss/as/product/keycloak/module.xml @@ -22,7 +22,7 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-api/main/module.xml index d36887e584..ff79ea3da7 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-freemarker/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-freemarker/main/module.xml index 1512a9e6b9..12a27b49f5 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-freemarker/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-account-freemarker/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-core/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-core/main/module.xml index f9837268fb..148ca83b0c 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-core/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-oidc/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-oidc/main/module.xml index 1a75cd11bf..5f1696b5f0 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-oidc/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-oidc/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-saml/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-saml/main/module.xml index 839d9f92fb..78800f80b5 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-saml/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-broker-saml/main/module.xml @@ -1,6 +1,6 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-file/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-file/main/module.xml index ef1f1b2eee..2821a82632 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-file/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-file/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-http-client/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-http-client/main/module.xml index f52288ebd9..33acbc3fb4 100755 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-http-client/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-http-client/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-infinispan/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-infinispan/main/module.xml index 94a9f1a2f4..6ec7f490c7 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-infinispan/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-infinispan/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml index 8ade3fd971..2e001ae340 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa/main/module.xml index ef36ac3d59..befbaca0f8 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-jpa/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo-update/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo-update/main/module.xml index 621f06d920..5af24c9c74 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo-update/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo-update/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo/main/module.xml index 504023f5e5..c1820d0ba8 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-connections-mongo/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core-jaxrs/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core-jaxrs/main/module.xml index c773354615..359459c75b 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core-jaxrs/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core-jaxrs/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml index b23c589155..ce36b73e82 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-api/main/module.xml index ed433b52c8..7936e57258 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-freemarker/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-freemarker/main/module.xml index a0c371fb66..5d7e738c44 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-freemarker/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-email-freemarker/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-api/main/module.xml index 2f8c152b0c..6bf4c57254 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-email/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-email/main/module.xml index 255f8302b4..8c924b9464 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-email/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-email/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jboss-logging/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jboss-logging/main/module.xml index 5a6fe2b92b..cb3911e6bf 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jboss-logging/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jboss-logging/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jpa/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jpa/main/module.xml index 12c859e74c..51820cbba4 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jpa/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-jpa/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-mongo/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-mongo/main/module.xml index 4e48e7f69b..58f4ef6613 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-mongo/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-events-mongo/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-api/main/module.xml index 2e503352f7..f93fac08e3 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-dir/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-dir/main/module.xml index 1cda32b5ee..e07d83a7d0 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-dir/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-dir/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-single-file/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-single-file/main/module.xml index a390929490..75bfd6abea 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-single-file/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-single-file/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-zip/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-zip/main/module.xml index a33365dfd3..ef9dfb3eaf 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-zip/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-export-import-zip/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-freemarker/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-freemarker/main/module.xml index c6c6325375..9c2d04519b 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-freemarker/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-freemarker/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-themes/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-themes/main/module.xml index 0e12a97f6f..b6bb215b01 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-themes/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-forms-common-themes/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml index 572ab38840..1fbd5a83b3 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-model/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-model/main/module.xml index 1844bc806f..8136f8338b 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-model/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-invalidation-cache-model/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-js-adapter/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-js-adapter/main/module.xml index d99ac75cad..7f8c1eec75 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-js-adapter/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-js-adapter/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-kerberos-federation/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-kerberos-federation/main/module.xml index 4f9da8b55c..620c79701f 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-kerberos-federation/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-kerberos-federation/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-ldap-federation/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-ldap-federation/main/module.xml index e8c9e4dbd8..b1bd769a2c 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-ldap-federation/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-ldap-federation/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-api/main/module.xml index ff6f6ac456..137514de0c 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-freemarker/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-freemarker/main/module.xml index 1cb5c4182e..ba3b629c0e 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-freemarker/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-login-freemarker/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-api/main/module.xml index 14a0a869c6..356057622f 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-file/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-file/main/module.xml index e3ae276601..d21a5372fc 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-file/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-file/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-jpa/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-jpa/main/module.xml index 4f50b7ad1d..4e62ca71f8 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-jpa/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-jpa/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-mongo/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-mongo/main/module.xml index 702406c95d..9c99b57990 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-mongo/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-mongo/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml index 23f94b144d..877f061173 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-jpa/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-jpa/main/module.xml index 2033069957..39490fc473 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-jpa/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-jpa/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mem/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mem/main/module.xml index 6a1d1019ca..47c9d408be 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mem/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mem/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mongo/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mongo/main/module.xml index 69936807f8..0b5aaa05bd 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mongo/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-model-sessions-mongo/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-core/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-core/main/module.xml index c09490e180..8c7846991b 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-core/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-protocol/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-protocol/main/module.xml index fc0cd15d47..03a5633d1f 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-protocol/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-saml-protocol/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-server-subsystem/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-server-subsystem/main/module.xml index b0309bdb6b..d6e7d81f6a 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-server-subsystem/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-server-subsystem/main/module.xml @@ -22,7 +22,7 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-services/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-services/main/module.xml index 4917ab6a47..5b55602247 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-services/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-services/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-core/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-core/main/module.xml index 836d5d6b5b..47a1348ba6 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-core/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-core/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-facebook/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-facebook/main/module.xml index 4c22779011..30a2489b3a 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-facebook/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-facebook/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-github/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-github/main/module.xml index 9197bb0c96..6a8e0c3276 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-github/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-github/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-google/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-google/main/module.xml index bb56189ffd..965a0e48e4 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-google/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-google/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-linkedin/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-linkedin/main/module.xml index db385431c9..3bba4a8d6b 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-linkedin/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-linkedin/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-stackoverflow/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-stackoverflow/main/module.xml index 5af13cef39..a1ac0830a9 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-stackoverflow/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-stackoverflow/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-twitter/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-twitter/main/module.xml index cf56209f4a..f07af8b221 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-twitter/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-social-twitter/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-api/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-api/main/module.xml index 77049169ad..af13ac0a9f 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-api/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-api/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-basic/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-basic/main/module.xml index e2279f9a3a..1ee1936fd9 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-basic/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-timer-basic/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-server-subsystem/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-server-subsystem/main/module.xml index 430bb0af4d..6748cb4237 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-server-subsystem/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wf9-server-subsystem/main/module.xml @@ -22,7 +22,7 @@ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-extensions/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-extensions/main/module.xml index 556769e366..58d5184390 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-extensions/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/keycloak/keycloak-wildfly-extensions/main/module.xml @@ -1,5 +1,5 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/liquibase/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/liquibase/main/module.xml index d75eef002a..db707e8434 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/liquibase/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/liquibase/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/mongodb/mongo-java-driver/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/mongodb/mongo-java-driver/main/module.xml index bb4acdd80e..2cb5fbe47d 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/mongodb/mongo-java-driver/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/mongodb/mongo-java-driver/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/twitter4j/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/twitter4j/main/module.xml index 70b84dcc78..9dc34a573f 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/twitter4j/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/org/twitter4j/main/module.xml @@ -2,7 +2,7 @@ - + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/sun/jdk/jgss/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/sun/jdk/jgss/main/module.xml index 6df03ff4ba..100d65d081 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/sun/jdk/jgss/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/base/sun/jdk/jgss/main/module.xml @@ -2,9 +2,8 @@ - + - diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index 8fb7c36fed..5e01598199 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -82,8 +82,8 @@ module.config([ '$routeProvider', function($routeProvider) { realm : function(RealmLoader) { return RealmLoader(); }, - serverInfo : function(ServerInfoLoader) { - return ServerInfoLoader(); + serverInfo : function(ServerInfo) { + return ServerInfo.delay; } }, controller : 'RealmLoginSettingsCtrl' @@ -1133,7 +1133,22 @@ module.config([ '$routeProvider', function($routeProvider) { controller : 'AuthenticationConfigCreateCtrl' }) .when('/server-info', { - templateUrl : resourceUrl + '/partials/server-info.html' + templateUrl : resourceUrl + '/partials/server-info.html', + resolve : { + serverInfo : function(ServerInfoLoader) { + return ServerInfoLoader(); + } + }, + controller : 'ServerInfoCtrl' + }) + .when('/server-info/providers', { + templateUrl : resourceUrl + '/partials/server-info-providers.html', + resolve : { + serverInfo : function(ServerInfoLoader) { + return ServerInfoLoader(); + } + }, + controller : 'ServerInfoCtrl' }) .when('/logout', { templateUrl : resourceUrl + '/partials/home.html', @@ -1867,4 +1882,4 @@ module.directive( 'kcOpen', function ( $location ) { }); }); }; -}); \ No newline at end of file +}); diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index 6331c9d39a..810aef73a7 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -549,7 +549,7 @@ module.controller('ClientDetailCtrl', function($scope, realm, client, $route, se "bearer-only" ]; - $scope.protocols = serverInfo.protocols; + $scope.protocols = Object.keys(serverInfo.providers['login-protocol'].providers).sort(); $scope.signatureAlgorithms = [ "RSA_SHA1", diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 85ad18b5c2..15a8fa9223 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -7,9 +7,6 @@ module.controller('GlobalCtrl', function($scope, $http, Auth, WhoAmI, Current, $ $scope.resourceUrl = resourceUrl; $scope.auth = Auth; $scope.serverInfo = ServerInfo.get(); - $scope.serverInfoUpdate = function() { - $scope.serverInfo = ServerInfo.get(); - }; function hasAnyAccess() { var realmAccess = Auth.user && Auth.user['realm_access']; @@ -125,6 +122,25 @@ module.controller('RealmTabCtrl', function(Dialog, $scope, Current, Realm, Notif }; }); +module.controller('ServerInfoCtrl', function($scope, ServerInfo) { + ServerInfo.reload(); + + $scope.serverInfo = ServerInfo.get(); + + $scope.$watch($scope.serverInfo, function() { + $scope.providers = []; + for(var spi in $scope.serverInfo.providers) { + var p = angular.copy($scope.serverInfo.providers[spi]); + p.name = spi; + $scope.providers.push(p) + } + }); + + $scope.serverInfoReload = function() { + ServerInfo.reload(); + } +}); + module.controller('RealmListCtrl', function($scope, Realm, Current) { $scope.realms = Realm.query(); Current.realms = $scope.realms; @@ -1217,7 +1233,7 @@ module.controller('RealmEventsConfigCtrl', function($scope, eventsConfig, RealmE } }); - $scope.eventListeners = serverInfo.eventListeners; + $scope.eventListeners = Object.keys(serverInfo.providers.eventsListener.providers); $scope.eventSelectOptions = { 'multiple': true, diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/loaders.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/loaders.js index 37a9566397..c347759413 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/loaders.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/loaders.js @@ -35,8 +35,10 @@ module.factory('RealmListLoader', function(Loader, Realm, $q) { return Loader.get(Realm); }); -module.factory('ServerInfoLoader', function(Loader, ServerInfo, $q) { - return Loader.get(ServerInfo); +module.factory('ServerInfoLoader', function(Loader, ServerInfo) { + return function() { + return ServerInfo.promise; + }; }); module.factory('RealmLoader', function(Loader, Realm, $route, $q) { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js index 3763ba9a9f..04929ef7f1 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js @@ -215,10 +215,27 @@ module.factory('RealmLDAPConnectionTester', function($resource) { return $resource(authUrl + '/admin/realms/:realm/testLDAPConnection'); }); -module.factory('ServerInfo', function($resource) { - return $resource(authUrl + '/admin/serverinfo'); -}); +module.service('ServerInfo', function($resource, $q, $http) { + var info = {}; + var delay = $q.defer(); + $http.get(authUrl + '/admin/serverinfo').success(function(data) { + info = data; + delay.resolve(info); + }); + + return { + get: function() { + return info; + }, + reload: function() { + $http.get(authUrl + '/admin/serverinfo').success(function(data) { + angular.copy(data, info); + }); + }, + promise: delay.promise + } +}); module.factory('ClientProtocolMapper', function($resource) { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html new file mode 100755 index 0000000000..aa95b5016f --- /dev/null +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info-providers.html @@ -0,0 +1,55 @@ +
+

+ Server Info + +

+ + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
SPIProviders
{{spi.name}} +
+ {{providerName}} + + + + + + + +
{{key}}{{value}}
+
+
+
+
+ + \ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info.html index 34c9a845d3..a92c774b25 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/server-info.html @@ -1,66 +1,104 @@ -
-

Server Info

+
+

+ Server Info + +

+ + - - + + - + + + + +
Version{{serverInfo.version}}Keycloak Version{{serverInfo.systemInfo.version}}
Server Time{{serverInfo.serverTime}} (update){{serverInfo.systemInfo.serverTime}}
Server Uptime{{serverInfo.systemInfo.uptime}}
- Providers - -
-

Public SPIs

- For public SPIs there are built-in providers, but it's also supported to write your own custom providers. - - - - - - - - - - - - - - -
SPIProviders
{{spi.name}} -
- {{provider}} -
-
-
- -
-

Internal SPIs

- For internal SPIs there are only built-in providers. It's not recommended to write your own custom providers as internal SPIs may change or be removed without notice. - - - - - - - - - - - - - - -
SPIProviders
{{spi.name}} -
- {{provider}} -
-
-
+ Memory + + + + + + + + + + + + + +
Total Memory{{serverInfo.memoryInfo.totalFormated}}
Free Memory{{serverInfo.memoryInfo.freeFormated}} ({{serverInfo.memoryInfo.freePercentage}}%)
Used Memory{{serverInfo.memoryInfo.usedFormated}}
-
\ No newline at end of file + +
+ System + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current Working Directory{{serverInfo.systemInfo.userDir}}
Java Version{{serverInfo.systemInfo.javaVersion}}
Java Vendor{{serverInfo.systemInfo.javaVendor}}
Java Runtime{{serverInfo.systemInfo.javaRuntime}}
Java VM{{serverInfo.systemInfo.javaVm}}
Java VM Version{{serverInfo.systemInfo.javaVmVersion}}
Java Home{{serverInfo.systemInfo.javaHome}}
User Name{{serverInfo.systemInfo.userName}}
User Timezone{{serverInfo.systemInfo.userTimezone}}
User Locale{{serverInfo.systemInfo.userLocale}}
System Encoding{{serverInfo.systemInfo.fileEncoding}}
Operating System{{serverInfo.systemInfo.osName}} {{serverInfo.systemInfo.osVersion}}
OS Architecture{{serverInfo.systemInfo.osArchitecture}}
+
+
+ + \ No newline at end of file diff --git a/model/api/src/main/java/org/keycloak/models/KeycloakSessionFactory.java b/model/api/src/main/java/org/keycloak/models/KeycloakSessionFactory.java index cbb3da22d5..82665508c2 100755 --- a/model/api/src/main/java/org/keycloak/models/KeycloakSessionFactory.java +++ b/model/api/src/main/java/org/keycloak/models/KeycloakSessionFactory.java @@ -18,6 +18,8 @@ public interface KeycloakSessionFactory extends ProviderEventManager { ProviderFactory getProviderFactory(Class clazz, String id); List getProviderFactories(Class clazz); + + long getServerStartupTimestamp(); void close(); } diff --git a/model/api/src/main/java/org/keycloak/provider/ServerInfoAwareProviderFactory.java b/model/api/src/main/java/org/keycloak/provider/ServerInfoAwareProviderFactory.java new file mode 100644 index 0000000000..97d17b1dcc --- /dev/null +++ b/model/api/src/main/java/org/keycloak/provider/ServerInfoAwareProviderFactory.java @@ -0,0 +1,20 @@ +package org.keycloak.provider; + +import java.util.Map; + +/** + * Marker interface for ProviderFactory of Provider which wants to show some info on "Server Info" page in Admin console. + * + * @author Vlastimil Elias (velias at redhat dot com) + */ +public interface ServerInfoAwareProviderFactory extends ProviderFactory { + + /** + * Get operational info about given provider. This info contains informations about providers configuration and operational conditions (eg. errors in connection to remote systems etc) which is + * shown on "Server Info" page. + * + * @return Map with keys describing value and relevant values itself + */ + public Map getOperationalInfo(); + +} diff --git a/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java b/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java index e312aa0122..c5be21be10 100755 --- a/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java +++ b/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java @@ -28,6 +28,8 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory { private Map, Map> factoriesMap = new HashMap, Map>(); protected CopyOnWriteArrayList listeners = new CopyOnWriteArrayList(); + protected long serverStartupTimestamp; + @Override public void register(ProviderEventListener listener) { listeners.add(listener); @@ -46,6 +48,8 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory { } public void init() { + serverStartupTimestamp = System.currentTimeMillis(); + ProviderManager pm = new ProviderManager(getClass().getClassLoader(), Config.scope().getArray("providers")); for (Spi spi : ServiceLoader.load(Spi.class, getClass().getClassLoader())) { @@ -148,4 +152,12 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory { return factory.getClass().getPackage().getName().startsWith("org.keycloak"); } + /** + * @return timestamp of Keycloak server startup + */ + @Override + public long getServerStartupTimestamp() { + return serverStartupTimestamp; + } + } diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java index e1d1fa3c48..97c147247c 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java @@ -20,6 +20,7 @@ import org.keycloak.services.managers.AppAuthManager; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.resources.Cors; +import org.keycloak.services.resources.admin.info.ServerInfoAdminResource; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/MemoryInfoRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/MemoryInfoRepresentation.java new file mode 100644 index 0000000000..56a1110d72 --- /dev/null +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/MemoryInfoRepresentation.java @@ -0,0 +1,54 @@ +package org.keycloak.services.resources.admin.info; + +public class MemoryInfoRepresentation { + + protected long total; + protected long used; + + public static MemoryInfoRepresentation create() { + MemoryInfoRepresentation rep = new MemoryInfoRepresentation(); + Runtime runtime = Runtime.getRuntime(); + rep.total = runtime.maxMemory(); + rep.used = runtime.totalMemory() - runtime.freeMemory(); + return rep; + } + + public long getTotal() { + return total; + } + + public String getTotalFormated() { + return formatMemory(getTotal()); + } + + public long getFree() { + return getTotal() - getUsed(); + } + + public String getFreeFormated() { + return formatMemory(getFree()); + } + + public long getUsed() { + return used; + } + + public String getUsedFormated() { + return formatMemory(getUsed()); + } + + public long getFreePercentage() { + return getFree() * 100 / getTotal(); + } + + private String formatMemory(long bytes) { + if (bytes > 1024L * 1024L) { + return bytes / (1024L * 1024L) + " MB"; + } else if (bytes > 1024L) { + return bytes / (1024L) + " kB"; + } else { + return bytes + " B"; + } + } + +} diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/ProviderRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/ProviderRepresentation.java new file mode 100644 index 0000000000..ffcaeb1651 --- /dev/null +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/ProviderRepresentation.java @@ -0,0 +1,17 @@ +package org.keycloak.services.resources.admin.info; + +import java.util.Map; + +public class ProviderRepresentation { + + private Map operationalInfo; + + public Map getOperationalInfo() { + return operationalInfo; + } + + public void setOperationalInfo(Map operationalInfo) { + this.operationalInfo = operationalInfo; + } + +} diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java similarity index 55% rename from services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java rename to services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java index 4f1c22575b..fd0afc9615 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java @@ -1,9 +1,7 @@ -package org.keycloak.services.resources.admin; +package org.keycloak.services.resources.admin.info; -import org.keycloak.Version; import org.keycloak.broker.provider.IdentityProvider; import org.keycloak.broker.provider.IdentityProviderFactory; -import org.keycloak.events.EventListenerProvider; import org.keycloak.events.EventType; import org.keycloak.events.admin.OperationType; import org.keycloak.exportimport.ClientImporter; @@ -18,6 +16,7 @@ import org.keycloak.protocol.LoginProtocolFactory; import org.keycloak.protocol.ProtocolMapper; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; +import org.keycloak.provider.ServerInfoAwareProviderFactory; import org.keycloak.provider.Spi; import org.keycloak.representations.idm.ConfigPropertyRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; @@ -26,14 +25,7 @@ import org.keycloak.social.SocialIdentityProvider; import javax.ws.rs.GET; import javax.ws.rs.core.Context; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.ServiceLoader; -import java.util.Set; +import java.util.*; /** * @author Stian Thorgersen @@ -53,13 +45,12 @@ public class ServerInfoAdminResource { @GET public ServerInfoRepresentation getInfo() { ServerInfoRepresentation info = new ServerInfoRepresentation(); - info.version = Version.VERSION; - info.serverTime = new Date().toString(); + info.setSystemInfo(SystemInfoRepresentation.create(session)); + info.setMemoryInfo(MemoryInfoRepresentation.create()); + setSocialProviders(info); setIdentityProviders(info); setThemes(info); - setEventListeners(info); - setProtocols(info); setClientImporters(info); setProviders(info); setProtocolMapperTypes(info); @@ -69,42 +60,70 @@ public class ServerInfoAdminResource { } private void setProviders(ServerInfoRepresentation info) { - List providers = new LinkedList<>(); + LinkedHashMap spiReps = new LinkedHashMap<>(); + + List spis = new LinkedList<>(); for (Spi spi : ServiceLoader.load(Spi.class)) { - SpiInfoRepresentation spiRep = new SpiInfoRepresentation(); - spiRep.setName(spi.getName()); - spiRep.setInternal(spi.isInternal()); - spiRep.setImplementations(session.listProviderIds(spi.getProviderClass())); - providers.add(spiRep); + spis.add(spi); } - info.providers = providers; + Collections.sort(spis, new Comparator() { + @Override + public int compare(Spi s1, Spi s2) { + return s1.getName().compareTo(s2.getName()); + } + }); + + for (Spi spi : spis) { + SpiInfoRepresentation spiRep = new SpiInfoRepresentation(); + spiRep.setInternal(spi.isInternal()); + spiRep.setSystemInfo(ServerInfoAwareProviderFactory.class.isAssignableFrom(spi.getProviderFactoryClass())); + + List providerIds = new LinkedList<>(session.listProviderIds(spi.getProviderClass())); + Collections.sort(providerIds); + + Map providers = new HashMap<>(); + + if (providerIds != null) { + for (String name : providerIds) { + ProviderRepresentation provider = new ProviderRepresentation(); + if (spiRep.isSystemInfo()) { + provider.setOperationalInfo(((ServerInfoAwareProviderFactory) session.getKeycloakSessionFactory().getProviderFactory(spi.getProviderClass(), name)).getOperationalInfo()); + } + providers.put(name, provider); + } + } + spiRep.setProviders(providers); + + spiReps.put(spi.getName(), spiRep); + } + info.setProviders(spiReps); } private void setThemes(ServerInfoRepresentation info) { ThemeProvider themeProvider = session.getProvider(ThemeProvider.class, "extending"); - info.themes = new HashMap>(); + info.setThemes(new HashMap>()); for (Theme.Type type : Theme.Type.values()) { List themes = new LinkedList(themeProvider.nameSet(type)); Collections.sort(themes); - info.themes.put(type.toString().toLowerCase(), themes); + info.getThemes().put(type.toString().toLowerCase(), themes); } } private void setSocialProviders(ServerInfoRepresentation info) { - info.socialProviders = new LinkedList<>(); + info.setSocialProviders(new LinkedList>()); List providerFactories = session.getKeycloakSessionFactory().getProviderFactories(SocialIdentityProvider.class); - setIdentityProviders(providerFactories, info.socialProviders, "Social"); + setIdentityProviders(providerFactories, info.getSocialProviders(), "Social"); } private void setIdentityProviders(ServerInfoRepresentation info) { - info.identityProviders = new LinkedList<>(); + info.setIdentityProviders(new LinkedList>()); List providerFactories = session.getKeycloakSessionFactory().getProviderFactories(IdentityProvider.class); - setIdentityProviders(providerFactories, info.identityProviders, "User-defined"); + setIdentityProviders(providerFactories, info.getIdentityProviders(), "User-defined"); providerFactories = session.getKeycloakSessionFactory().getProviderFactories(SocialIdentityProvider.class); - setIdentityProviders(providerFactories, info.identityProviders, "Social"); + setIdentityProviders(providerFactories, info.getIdentityProviders(), "Social"); } public void setIdentityProviders(List factories, List> providers, String groupName) { @@ -119,31 +138,14 @@ public class ServerInfoAdminResource { } } - private void setEventListeners(ServerInfoRepresentation info) { - info.eventListeners = new LinkedList(); - - Set providers = session.listProviderIds(EventListenerProvider.class); - if (providers != null) { - info.eventListeners.addAll(providers); - } - } - - private void setProtocols(ServerInfoRepresentation info) { - info.protocols = new LinkedList(); - for (ProviderFactory p : session.getKeycloakSessionFactory().getProviderFactories(LoginProtocol.class)) { - info.protocols.add(p.getId()); - } - Collections.sort(info.protocols); - } - private void setProtocolMapperTypes(ServerInfoRepresentation info) { - info.protocolMapperTypes = new HashMap>(); + info.setProtocolMapperTypes(new HashMap>()); for (ProviderFactory p : session.getKeycloakSessionFactory().getProviderFactories(ProtocolMapper.class)) { ProtocolMapper mapper = (ProtocolMapper)p; - List types = info.protocolMapperTypes.get(mapper.getProtocol()); + List types = info.getProtocolMapperTypes().get(mapper.getProtocol()); if (types == null) { types = new LinkedList(); - info.protocolMapperTypes.put(mapper.getProtocol(), types); + info.getProtocolMapperTypes().put(mapper.getProtocol(), types); } ProtocolMapperTypeRepresentation rep = new ProtocolMapperTypeRepresentation(); rep.setId(mapper.getId()); @@ -166,136 +168,25 @@ public class ServerInfoAdminResource { } private void setBuiltinProtocolMappers(ServerInfoRepresentation info) { - info.builtinProtocolMappers = new HashMap<>(); + info.setBuiltinProtocolMappers(new HashMap>()); for (ProviderFactory p : session.getKeycloakSessionFactory().getProviderFactories(LoginProtocol.class)) { LoginProtocolFactory factory = (LoginProtocolFactory)p; List mappers = new LinkedList<>(); for (ProtocolMapperModel mapper : factory.getBuiltinMappers()) { mappers.add(ModelToRepresentation.toRepresentation(mapper)); } - info.builtinProtocolMappers.put(p.getId(), mappers); + info.getBuiltinProtocolMappers().put(p.getId(), mappers); } } private void setClientImporters(ServerInfoRepresentation info) { - info.clientImporters = new LinkedList>(); + info.setClientImporters(new LinkedList>()); for (ProviderFactory p : session.getKeycloakSessionFactory().getProviderFactories(ClientImporter.class)) { ClientImporterFactory factory = (ClientImporterFactory)p; Map data = new HashMap(); data.put("id", factory.getId()); data.put("name", factory.getDisplayName()); - info.clientImporters.add(data); - } - } - - public static class ServerInfoRepresentation { - - private String version; - - private String serverTime; - - private Map> themes; - - private List> socialProviders; - public List> identityProviders; - private List protocols; - private List> clientImporters; - - private List providers; - - private List eventListeners; - private Map> protocolMapperTypes; - private Map> builtinProtocolMappers; - - private Map> enums; - - public ServerInfoRepresentation() { - } - - public String getServerTime() { - return serverTime; - } - - public String getVersion() { - return version; - } - - public Map> getThemes() { - return themes; - } - - public List> getSocialProviders() { - return socialProviders; - } - - public List> getIdentityProviders() { - return this.identityProviders; - } - - public List getEventListeners() { - return eventListeners; - } - - public List getProtocols() { - return protocols; - } - - public List> getClientImporters() { - return clientImporters; - } - - public List getProviders() { - return providers; - } - - public Map> getProtocolMapperTypes() { - return protocolMapperTypes; - } - - public Map> getBuiltinProtocolMappers() { - return builtinProtocolMappers; - } - - public void setBuiltinProtocolMappers(Map> builtinProtocolMappers) { - this.builtinProtocolMappers = builtinProtocolMappers; - } - - public Map> getEnums() { - return enums; - } - - public void setEnums(Map> enums) { - this.enums = enums; - } - } - - public static class SpiInfoRepresentation { - private String name; - private boolean internal; - private Set implementations; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public boolean isInternal() { - return internal; - } - - public void setInternal(boolean internal) { - this.internal = internal; - } - - public Set getImplementations() { - return implementations; - } - - public void setImplementations(Set implementations) { - this.implementations = implementations; + info.getClientImporters().add(data); } } diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoRepresentation.java new file mode 100644 index 0000000000..9b7f4f5bbb --- /dev/null +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoRepresentation.java @@ -0,0 +1,108 @@ +package org.keycloak.services.resources.admin.info; + +import org.keycloak.representations.idm.ProtocolMapperRepresentation; +import org.keycloak.representations.idm.ProtocolMapperTypeRepresentation; + +import java.util.List; +import java.util.Map; + +/** + * @author Stian Thorgersen + */ +public class ServerInfoRepresentation { + + private SystemInfoRepresentation systemInfo; + private MemoryInfoRepresentation memoryInfo; + + private Map> themes; + + private List> socialProviders; + private List> identityProviders; + private List> clientImporters; + + private Map providers; + + private Map> protocolMapperTypes; + private Map> builtinProtocolMappers; + + private Map> enums; + + public SystemInfoRepresentation getSystemInfo() { + return systemInfo; + } + + public void setSystemInfo(SystemInfoRepresentation systemInfo) { + this.systemInfo = systemInfo; + } + + public MemoryInfoRepresentation getMemoryInfo() { + return memoryInfo; + } + + public void setMemoryInfo(MemoryInfoRepresentation memoryInfo) { + this.memoryInfo = memoryInfo; + } + public Map> getThemes() { + return themes; + } + + public void setThemes(Map> themes) { + this.themes = themes; + } + + public List> getSocialProviders() { + return socialProviders; + } + + public void setSocialProviders(List> socialProviders) { + this.socialProviders = socialProviders; + } + + public List> getIdentityProviders() { + return identityProviders; + } + + public void setIdentityProviders(List> identityProviders) { + this.identityProviders = identityProviders; + } + + public List> getClientImporters() { + return clientImporters; + } + + public void setClientImporters(List> clientImporters) { + this.clientImporters = clientImporters; + } + + public Map getProviders() { + return providers; + } + + public void setProviders(Map providers) { + this.providers = providers; + } + + public Map> getProtocolMapperTypes() { + return protocolMapperTypes; + } + + public void setProtocolMapperTypes(Map> protocolMapperTypes) { + this.protocolMapperTypes = protocolMapperTypes; + } + + public Map> getBuiltinProtocolMappers() { + return builtinProtocolMappers; + } + + public void setBuiltinProtocolMappers(Map> builtinProtocolMappers) { + this.builtinProtocolMappers = builtinProtocolMappers; + } + + public Map> getEnums() { + return enums; + } + + public void setEnums(Map> enums) { + this.enums = enums; + } +} diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/SpiInfoRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/SpiInfoRepresentation.java new file mode 100644 index 0000000000..3f94a5a9f3 --- /dev/null +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/SpiInfoRepresentation.java @@ -0,0 +1,39 @@ +package org.keycloak.services.resources.admin.info; + +import java.util.Map; + +/** + * @author Stian Thorgersen + */ +public class SpiInfoRepresentation { + + private boolean internal; + private boolean systemInfo; + + private Map providers; + + public boolean isInternal() { + return internal; + } + + public void setInternal(boolean internal) { + this.internal = internal; + } + + public boolean isSystemInfo() { + return systemInfo; + } + + public void setSystemInfo(boolean systemInfo) { + this.systemInfo = systemInfo; + } + + public Map getProviders() { + return providers; + } + + public void setProviders(Map providers) { + this.providers = providers; + } + +} diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java new file mode 100644 index 0000000000..bc0329a785 --- /dev/null +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java @@ -0,0 +1,217 @@ +package org.keycloak.services.resources.admin.info; + +import org.keycloak.Version; +import org.keycloak.models.KeycloakSession; + +import java.util.Date; +import java.util.Locale; + +public class SystemInfoRepresentation { + + private String version; + private String serverTime; + private String uptime; + private long uptimeMillis; + private String javaVersion; + private String javaVendor; + private String javaVm; + private String javaVmVersion; + private String javaRuntime; + private String javaHome; + private String osName; + private String osArchitecture; + private String osVersion; + private String fileEncoding; + private String userName; + private String userDir; + private String userTimezone; + private String userLocale; + + public static SystemInfoRepresentation create(KeycloakSession session) { + SystemInfoRepresentation rep = new SystemInfoRepresentation(); + rep.version = Version.VERSION; + rep.serverTime = new Date().toString(); + rep.uptimeMillis = System.currentTimeMillis() - session.getKeycloakSessionFactory().getServerStartupTimestamp(); + rep.uptime = formatUptime(rep.uptimeMillis); + rep.javaVersion = System.getProperty("java.version"); + rep.javaVendor = System.getProperty("java.vendor"); + rep.javaVm = System.getProperty("java.vm.name"); + rep.javaVmVersion = System.getProperty("java.vm.version"); + rep.javaRuntime = System.getProperty("java.runtime.name"); + rep.javaHome = System.getProperty("java.home"); + rep.osName = System.getProperty("os.name"); + rep.osArchitecture = System.getProperty("os.arch"); + rep.osVersion = System.getProperty("os.version"); + rep.fileEncoding = System.getProperty("file.encoding"); + rep.userName = System.getProperty("user.name"); + rep.userDir = System.getProperty("user.dir"); + rep.userTimezone = System.getProperty("user.timezone"); + rep.userLocale = (new Locale(System.getProperty("user.country"), System.getProperty("user.language")).toString()); + return rep; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getServerTime() { + return serverTime; + } + + public void setServerTime(String serverTime) { + this.serverTime = serverTime; + } + + public String getUptime() { + return uptime; + } + + public void setUptime(String uptime) { + this.uptime = uptime; + } + + public long getUptimeMillis() { + return uptimeMillis; + } + + public void setUptimeMillis(long uptimeMillis) { + this.uptimeMillis = uptimeMillis; + } + + public String getJavaVersion() { + return javaVersion; + } + + public void setJavaVersion(String javaVersion) { + this.javaVersion = javaVersion; + } + + public String getJavaVendor() { + return javaVendor; + } + + public void setJavaVendor(String javaVendor) { + this.javaVendor = javaVendor; + } + + public String getJavaVm() { + return javaVm; + } + + public void setJavaVm(String javaVm) { + this.javaVm = javaVm; + } + + public String getJavaVmVersion() { + return javaVmVersion; + } + + public void setJavaVmVersion(String javaVmVersion) { + this.javaVmVersion = javaVmVersion; + } + + public String getJavaRuntime() { + return javaRuntime; + } + + public void setJavaRuntime(String javaRuntime) { + this.javaRuntime = javaRuntime; + } + + public String getJavaHome() { + return javaHome; + } + + public void setJavaHome(String javaHome) { + this.javaHome = javaHome; + } + + public String getOsName() { + return osName; + } + + public void setOsName(String osName) { + this.osName = osName; + } + + public String getOsArchitecture() { + return osArchitecture; + } + + public void setOsArchitecture(String osArchitecture) { + this.osArchitecture = osArchitecture; + } + + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + public String getFileEncoding() { + return fileEncoding; + } + + public void setFileEncoding(String fileEncoding) { + this.fileEncoding = fileEncoding; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserDir() { + return userDir; + } + + public void setUserDir(String userDir) { + this.userDir = userDir; + } + + public String getUserTimezone() { + return userTimezone; + } + + public void setUserTimezone(String userTimezone) { + this.userTimezone = userTimezone; + } + + public String getUserLocale() { + return userLocale; + } + + public void setUserLocale(String userLocale) { + this.userLocale = userLocale; + } + + private static String formatUptime(long uptime) { + long diffInSeconds = uptime / 1000; + long diff[] = new long[]{0, 0, 0, 0}; // sec + diff[3] = (diffInSeconds >= 60 ? diffInSeconds % 60 : diffInSeconds); // min + diff[2] = (diffInSeconds = (diffInSeconds / 60)) >= 60 ? diffInSeconds % 60 : diffInSeconds; // hours + diff[1] = (diffInSeconds = (diffInSeconds / 60)) >= 24 ? diffInSeconds % 24 : diffInSeconds; // days + diff[0] = (diffInSeconds = (diffInSeconds / 24)); + + return String.format( + "%d day%s, %d hour%s, %d minute%s, %d second%s", + diff[0], + diff[0] != 1 ? "s" : "", + diff[1], + diff[1] != 1 ? "s" : "", + diff[2], + diff[2] != 1 ? "s" : "", + diff[3], + diff[3] != 1 ? "s" : ""); + } + +} diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/AdminAPITest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/AdminAPITest.java index 3bde1cb740..dc49661c38 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/AdminAPITest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/AdminAPITest.java @@ -25,6 +25,7 @@ import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; import org.keycloak.Config; +import org.keycloak.Version; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.Constants; @@ -55,6 +56,7 @@ import javax.ws.rs.core.UriBuilder; import java.io.IOException; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -295,4 +297,37 @@ public class AdminAPITest { testCreateRealm("/admin-test/testrealm.json"); } + @Test + public void testServerInfo() { + String token = createToken(); + final String authHeader = "Bearer " + token; + ClientRequestFilter authFilter = new ClientRequestFilter() { + @Override + public void filter(ClientRequestContext requestContext) throws IOException { + requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, authHeader); + } + }; + Client client = ClientBuilder.newBuilder().register(authFilter).build(); + UriBuilder authBase = UriBuilder.fromUri("http://localhost:8081/auth"); + WebTarget target = client.target(AdminRoot.adminBaseUrl(authBase).path("serverinfo")); + + Map response = target.request().accept("application/json").get(Map.class); + + + System.out.println(response.keySet().toString()); + + Assert.assertNotNull(response); + Assert.assertNotNull(response.get("providers")); + Assert.assertNotNull(response.get("themes")); + Assert.assertNotNull(response.get("enums")); + + Assert.assertNotNull(response.get("memoryInfo")); + Assert.assertNotNull(response.get("systemInfo")); + + Map systemInfo = (Map) response.get("systemInfo"); + Assert.assertEquals(Version.VERSION, systemInfo.get("version")); + Assert.assertNotNull(systemInfo.get("serverTime")); + Assert.assertNotNull(systemInfo.get("uptime")); + } + }