This commit is contained in:
Bill Burke committed 2014-08-06 15:44:50 -04:00
1 parent e04af84ac0
commit aff32f69bb
8 files changed
+119 -1

No files matched your search

@@ -1,6 +1,7 @@
package org.keycloak.adapters;
import org.jboss.logging.Logger;
import org.keycloak.Version;
import org.keycloak.jose.jws.JWSInput;
import org.keycloak.jose.jws.crypto.RSAProvider;
import org.keycloak.representations.adapters.action.AdminAction;
@@ -63,10 +64,13 @@ public class PreAuthActionsHandler {
if (!resolveDeployment()) return true;
handleGetSessionStats();
return true;
}else if (requestUri.endsWith(AdapterConstants.K_GET_USER_STATS)) {
} else if (requestUri.endsWith(AdapterConstants.K_GET_USER_STATS)) {
if (!resolveDeployment()) return true;
handleGetUserStats();
return true;
} else if (requestUri.endsWith(AdapterConstants.K_VERSION)) {
handleVersion();
return true;
}
return false;
}
@@ -240,6 +244,15 @@ public class PreAuthActionsHandler {
throw new RuntimeException(e);
}
}
protected void handleVersion() {
try {
facade.getResponse().setStatus(200);
facade.getResponse().setHeader("Content-Type", "application/json");
JsonSerialization.writeValueToStream(facade.getResponse().getOutputStream(), Version.SINGLETON);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
protected UserStats getUserStats(String user) {
UserStats stats = new UserStats();