From 41c9289f148c8f5b9f82a822f5c7559e2eceb616 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 18 Nov 2015 15:09:32 +0100 Subject: [PATCH] KEYCLOAK-1749 Moved clien registration api --- .../api}/pom.xml | 11 ++---- .../keycloak/client/registration/Auth.java | 0 .../registration/ClientRegistration.java | 0 .../ClientRegistrationException.java | 0 .../ClientRepresentationMixIn.java | 0 .../registration/HttpErrorException.java | 0 .../client/registration/HttpUtil.java | 0 client-registration/cli/pom.xml | 34 +++++++++++++++++++ .../cli/ClientRegistrationCLI.java | 27 +++++++++++++++ client-registration/pom.xml | 19 +++++++++++ pom.xml | 13 ++++++- .../client/AdapterInstallationConfigTest.java | 3 +- .../integration-arquillian/tests/pom.xml | 2 +- 13 files changed, 97 insertions(+), 12 deletions(-) rename {client-api => client-registration/api}/pom.xml (71%) rename {client-api => client-registration/api}/src/main/java/org/keycloak/client/registration/Auth.java (100%) rename {client-api => client-registration/api}/src/main/java/org/keycloak/client/registration/ClientRegistration.java (100%) rename {client-api => client-registration/api}/src/main/java/org/keycloak/client/registration/ClientRegistrationException.java (100%) rename {client-api => client-registration/api}/src/main/java/org/keycloak/client/registration/ClientRepresentationMixIn.java (100%) rename {client-api => client-registration/api}/src/main/java/org/keycloak/client/registration/HttpErrorException.java (100%) rename {client-api => client-registration/api}/src/main/java/org/keycloak/client/registration/HttpUtil.java (100%) create mode 100755 client-registration/cli/pom.xml create mode 100644 client-registration/cli/src/main/java/org/keycloak/client/registration/cli/ClientRegistrationCLI.java create mode 100755 client-registration/pom.xml diff --git a/client-api/pom.xml b/client-registration/api/pom.xml similarity index 71% rename from client-api/pom.xml rename to client-registration/api/pom.xml index e1c1b5c71a..30c911b14d 100755 --- a/client-api/pom.xml +++ b/client-registration/api/pom.xml @@ -2,14 +2,14 @@ - keycloak-parent + keycloak-client-registration-parent org.keycloak 1.7.0.Final-SNAPSHOT 4.0.0 - keycloak-client-api - Keycloak Client API + keycloak-client-registration-api + Keycloak Client Registration API @@ -21,11 +21,6 @@ org.apache.httpcomponents httpclient - - junit - junit - test - diff --git a/client-api/src/main/java/org/keycloak/client/registration/Auth.java b/client-registration/api/src/main/java/org/keycloak/client/registration/Auth.java similarity index 100% rename from client-api/src/main/java/org/keycloak/client/registration/Auth.java rename to client-registration/api/src/main/java/org/keycloak/client/registration/Auth.java diff --git a/client-api/src/main/java/org/keycloak/client/registration/ClientRegistration.java b/client-registration/api/src/main/java/org/keycloak/client/registration/ClientRegistration.java similarity index 100% rename from client-api/src/main/java/org/keycloak/client/registration/ClientRegistration.java rename to client-registration/api/src/main/java/org/keycloak/client/registration/ClientRegistration.java diff --git a/client-api/src/main/java/org/keycloak/client/registration/ClientRegistrationException.java b/client-registration/api/src/main/java/org/keycloak/client/registration/ClientRegistrationException.java similarity index 100% rename from client-api/src/main/java/org/keycloak/client/registration/ClientRegistrationException.java rename to client-registration/api/src/main/java/org/keycloak/client/registration/ClientRegistrationException.java diff --git a/client-api/src/main/java/org/keycloak/client/registration/ClientRepresentationMixIn.java b/client-registration/api/src/main/java/org/keycloak/client/registration/ClientRepresentationMixIn.java similarity index 100% rename from client-api/src/main/java/org/keycloak/client/registration/ClientRepresentationMixIn.java rename to client-registration/api/src/main/java/org/keycloak/client/registration/ClientRepresentationMixIn.java diff --git a/client-api/src/main/java/org/keycloak/client/registration/HttpErrorException.java b/client-registration/api/src/main/java/org/keycloak/client/registration/HttpErrorException.java similarity index 100% rename from client-api/src/main/java/org/keycloak/client/registration/HttpErrorException.java rename to client-registration/api/src/main/java/org/keycloak/client/registration/HttpErrorException.java diff --git a/client-api/src/main/java/org/keycloak/client/registration/HttpUtil.java b/client-registration/api/src/main/java/org/keycloak/client/registration/HttpUtil.java similarity index 100% rename from client-api/src/main/java/org/keycloak/client/registration/HttpUtil.java rename to client-registration/api/src/main/java/org/keycloak/client/registration/HttpUtil.java diff --git a/client-registration/cli/pom.xml b/client-registration/cli/pom.xml new file mode 100755 index 0000000000..13b8a8f91e --- /dev/null +++ b/client-registration/cli/pom.xml @@ -0,0 +1,34 @@ + + + + keycloak-client-registration-parent + org.keycloak + 1.7.0.Final-SNAPSHOT + + 4.0.0 + + keycloak-client-registration-cli + Keycloak Client Registration CLI + + + + + org.keycloak + keycloak-core + + + org.keycloak + keycloak-client-registration-api + + + org.apache.httpcomponents + httpclient + + + org.jboss.aesh + aesh + + + + diff --git a/client-registration/cli/src/main/java/org/keycloak/client/registration/cli/ClientRegistrationCLI.java b/client-registration/cli/src/main/java/org/keycloak/client/registration/cli/ClientRegistrationCLI.java new file mode 100644 index 0000000000..53c0b88445 --- /dev/null +++ b/client-registration/cli/src/main/java/org/keycloak/client/registration/cli/ClientRegistrationCLI.java @@ -0,0 +1,27 @@ +package org.keycloak.client.registration.cli; + +import org.jboss.aesh.console.AeshConsole; +import org.jboss.aesh.console.AeshConsoleBuilder; +import org.jboss.aesh.console.Prompt; +import org.jboss.aesh.console.settings.Settings; +import org.jboss.aesh.console.settings.SettingsBuilder; + +/** + * @author Stian Thorgersen + */ +public class ClientRegistrationCLI { + + public static void main(String[] args) { + + Settings settings = new SettingsBuilder().logging(true).create(); + AeshConsole aeshConsole = new AeshConsoleBuilder().settings(settings) + .prompt(new Prompt("[aesh@rules]$ ")) +// .command() + .create(); + + aeshConsole.start(); + } + + +} + diff --git a/client-registration/pom.xml b/client-registration/pom.xml new file mode 100755 index 0000000000..214122831b --- /dev/null +++ b/client-registration/pom.xml @@ -0,0 +1,19 @@ + + + keycloak-parent + org.keycloak + 1.7.0.Final-SNAPSHOT + + + Keycloak Client Registration Parent + + 4.0.0 + keycloak-client-registration-parent + pom + + + api + cli + + diff --git a/pom.xml b/pom.xml index d545efd5f9..c137e5904b 100755 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,7 @@ 1.2.17 1.3.1b 1.5.1 + 0.66 1.4 7.5.Final @@ -135,7 +136,7 @@ common core - client-api + client-registration connections dependencies events @@ -580,6 +581,11 @@ pax-web-runtime ${pax.web.version} + + org.jboss.aesh + aesh + ${aesh.version} + @@ -622,6 +628,11 @@ keycloak-connections-http-client ${project.version} + + org.keycloak + keycloak-client-registration-api + ${project.version} + org.keycloak keycloak-connections-mongo-update diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java index bf98364dbd..4e0712ee31 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java @@ -9,8 +9,6 @@ import org.keycloak.common.enums.SslRequired; import org.keycloak.representations.adapters.config.AdapterConfig; import org.keycloak.representations.idm.ClientRepresentation; -import javax.ws.rs.core.Response; - import static org.junit.Assert.*; /** @@ -37,6 +35,7 @@ public class AdapterInstallationConfigTest extends AbstractClientRegistrationTes client.setRegistrationAccessToken("RegistrationAccessTokenTestRegistrationAccessToken"); client.setRootUrl("http://root"); client = createClient(client); + client.setSecret("RegistrationAccessTokenTestClientSecret"); client2 = new ClientRepresentation(); client2.setEnabled(true); diff --git a/testsuite/integration-arquillian/tests/pom.xml b/testsuite/integration-arquillian/tests/pom.xml index 074a08a1de..13a2059f82 100644 --- a/testsuite/integration-arquillian/tests/pom.xml +++ b/testsuite/integration-arquillian/tests/pom.xml @@ -230,7 +230,7 @@ org.keycloak - keycloak-client-api + keycloak-client-registration-api org.keycloak