From a297cfba87737d14ba297c5940aa1b12aea4e626 Mon Sep 17 00:00:00 2001 From: Emily Jiang Date: Sat, 7 Sep 2019 08:21:58 +0100 Subject: [PATCH 1/2] Fixes service-a service-b separation, all servers tested - service-a service-b port definitions - fixed Liberty and Helidon projects Credit to Emily Jiang for helping with Liberty and to Tomas Langer for consultation about Helidon. Emily Jiang : Issue 211 improve liberty pom.xml generation Issue 211 improve liberty pom.xml generation - remove unnecessary files Issue 211 fix the secondar_url Signed-off-by: Michal Karm Babacek --- .../servers/MicroprofileServersAddon.java | 38 +++---- .../servers/model/SupportedServer.java | 48 ++++----- .../servers/server/HelidonServer.java | 54 +++++++--- .../servers/server/TomeeServer.java | 22 ++-- .../starter/core/artifacts/JavaCreator.java | 1 - .../starter/core/artifacts/MavenCreator.java | 4 +- src/main/resources/files.lst | 79 +++++++------- src/main/resources/files/Service.java.tpl | 1 - .../files/TestSecureController.java.tpl | 2 +- .../files/helidon/RestApplication.java.tpl | 13 ++- .../files/helidon/application.yaml.tpl | 6 -- .../files/helidon/logging.properties.tpl | 2 +- .../microprofile-config.properties.tpl | 4 +- .../service-b/RestApplication.java.tpl | 9 +- .../service-b/ServiceController.java.tpl | 20 ++++ .../helidon/service-b/application.yaml.tpl | 17 --- .../microprofile-config.properties.tpl | 13 ++- .../resources/files/kumuluzEE/config.yaml.tpl | 5 +- .../files/kumuluzEE/service-b/config.yaml.tpl | 2 +- .../liberty/TestSecureController.java.tpl | 102 ------------------ .../resources/files/liberty/index.html.tpl | 55 ---------- .../resources/files/liberty/server.xml.tpl | 9 +- .../files/liberty/service-b/server.xml.tpl | 10 +- .../files/microprofile-config.properties.tpl | 2 +- .../resources/files/readme.md.secondary.tpl | 2 - src/main/resources/files/readme.md.tpl | 4 +- src/main/resources/pom-servers.xml | 49 ++------- .../DynamoDBLoggerTest.java | 2 +- 28 files changed, 210 insertions(+), 365 deletions(-) delete mode 100755 src/main/resources/files/helidon/application.yaml.tpl create mode 100644 src/main/resources/files/helidon/service-b/ServiceController.java.tpl delete mode 100755 src/main/resources/files/helidon/service-b/application.yaml.tpl delete mode 100644 src/main/resources/files/liberty/TestSecureController.java.tpl delete mode 100755 src/main/resources/files/liberty/index.html.tpl rename src/test/java/org/eclipse/microprofile/starter/{ => dynamologger}/DynamoDBLoggerTest.java (97%) diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java index d78e8b88..80026ecd 100755 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java @@ -150,15 +150,12 @@ public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProjec } if (model.hasMainAndSecondaryProject()) { - String artifactID = pomFile.getArtifactId(); if (mainProject) { - pomFile.setArtifactId(artifactID + "-" + JessieModel.MAIN_INDICATOR); + pomFile.setArtifactId(model.getMaven().getArtifactId() + "-" + JessieModel.MAIN_INDICATOR); } else { - pomFile.setArtifactId(artifactID + "-" + JessieModel.SECONDARY_INDICATOR); + pomFile.setArtifactId(model.getMaven().getArtifactId() + "-" + JessieModel.SECONDARY_INDICATOR); } - pomFile.getBuild().setFinalName(artifactID); } - } private Profile findProfile(String profileName) { @@ -194,8 +191,8 @@ public void createFiles(JessieModel model) { String artifactId = model.getMaven().getArtifactId(); variables.put("jar_file", defineJarFileName(supportedServer, artifactId)); variables.put("jar_parameters", defineJarParameters(supportedServer)); - variables.put("test_url", defineTestURL(supportedServer, artifactId)); - variables.put("secondary_url", defineSecondaryURL(supportedServer, artifactId)); + variables.put("port_service_a", supportedServer.getPortServiceA()); + variables.put("port_service_b", supportedServer.getPortServiceB()); variables.put("artifact_id", artifactId); String rootJava = getJavaApplicationRootPackage(model); @@ -240,7 +237,6 @@ public void createFiles(JessieModel model) { } } - if (microprofileSpecs.contains(MicroprofileSpec.REST_CLIENT)) { String clientMainDirectory = model.getDirectory(true) + "/" + rootJava + "/client"; directoryCreator.createDirectory(clientMainDirectory); @@ -262,22 +258,23 @@ public void createFiles(JessieModel model) { String resourceDirectory = getResourceDirectory(model, true); processTemplateFile(resourceDirectory, "privateKey.pem", alternatives, variables); - } - // TODO : Verify : This is for all specs? + // With KumuluzEE, it properties are integrated within config.yaml if (supportedServer != SupportedServer.KUMULUZEE) { - // With kumuluzEE, it properties are integrated within config.yaml String metaInfDirectory = getResourceDirectory(model, true) + "/META-INF"; directoryCreator.createDirectory(metaInfDirectory); processTemplateFile(metaInfDirectory, "microprofile-config.properties", alternatives, variables); } - // Demo index file to all endpoints - String webDirectory = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_WEBAPP; - directoryCreator.createDirectory(webDirectory); - processTemplateFile(webDirectory, "index.html", alternatives, variables); + // Helidon should have it in src/main/resource/WEB + if (supportedServer != SupportedServer.HELIDON) { + // Demo index file to all endpoints + String webDirectory = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_WEBAPP; + directoryCreator.createDirectory(webDirectory); + processTemplateFile(webDirectory, "index.html", alternatives, variables); + } processTemplateFile(model.getDirectory(true), "readme.md", alternatives, variables); if (model.hasMainAndSecondaryProject()) { @@ -293,13 +290,4 @@ private String defineJarFileName(SupportedServer supportedServer, String artifac private String defineJarParameters(SupportedServer supportedServer) { return supportedServer.getJarParameters(); } - - private String defineTestURL(SupportedServer supportedServer, String artifactId) { - return String.format(supportedServer.getTestURL(), artifactId); - } - - private String defineSecondaryURL(SupportedServer supportedServer, String artifactId) { - return String.format(supportedServer.getSecondaryURL(), artifactId); - } - -} \ No newline at end of file +} diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java index 3217c903..123072e5 100755 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java @@ -34,16 +34,16 @@ public enum SupportedServer { Collections.singletonList(MicroProfileVersion.MP12) , "%s-swarm.jar" //jarFileName , "-Dswarm.port.offset=100" //jarParameters - , "http://localhost:8080" //testURL - , "http://localhost:8180" //secondaryURL // This need to match with port value from defineJarParameters() + , "8080" //portServiceA + , "8180" //portServiceB ) , THORNTAIL_V2("thorntail-v2", "Thorntail V2", Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP21, MicroProfileVersion.MP22, MicroProfileVersion.MP30) , "%s-thorntail.jar" //jarFileName , "-Dswarm.port.offset=100" //jarParameters - , "http://localhost:8080" //testURL - , "http://localhost:8180" //secondaryURL // This need to match with port value from defineJarParameters() + , "8080" //portServiceA + , "8180" //portServiceB ) , LIBERTY("liberty", "Open Liberty", Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14, @@ -51,39 +51,39 @@ public enum SupportedServer { MicroProfileVersion.MP30) , "%s.jar" //jarFileName , "" //jarParameters // Hard coded in server.xml since no way of overriding a default. - , "http://localhost:8181/%s" //testURL - , "http://localhost:8281/%s" //secondaryURL // This need to match with port value from server.xml + , "8181" //portServiceA + , "8281" //portServiceB ) , KUMULUZEE("kumuluzEE", "KumuluzEE", Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14, MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22) , "%s.jar" //jarFileName , "" //jarParameters // Hard coded in config.xml since we needed a specific version for secondary app. - , "http://localhost:8080" //testURL - , "http://localhost:8180" //secondaryURL // This need to match with port value from secondary/config.yaml + , "8080" //portServiceA + , "8180" //portServiceB // This need to match with port value from secondary/config.yaml ) , PAYARA_MICRO("payara-micro", "Payara Micro", Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14, MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22) , "%s-microbundle.jar" //jarFileName , "--port 8180" //jarParameters - , "http://localhost:8080" //testURL - , "http://localhost:8180" //secondaryURL // This need to match with port value from defineJarParameters() + , "8080" //portServiceA + , "8180" //portServiceB // This need to match with port value from defineJarParameters() ) , TOMEE("tomee", "Apache TomEE 8.0.0-M3", Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14, - MicroProfileVersion.MP20,MicroProfileVersion.MP21) + MicroProfileVersion.MP20, MicroProfileVersion.MP21) , "%s-exec.jar" //jarFileName , "" //jarParameters // Done by TomeeServer.adaptMavenModel - , "http://localhost:8080" // testURL - , "http://localhost:8180" //secondaryURL // This need to match with Port value from TomeeServer.adjustPOM + , "8080" // portServiceA + , "8180" //portServiceB // This need to match with Port value from TomeeServer.adjustPOM ) , HELIDON("helidon", "Helidon", Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP22) , "%s.jar" //jarFileName , "" //jarParameters // Done by secondary/helidon/microprofile-config.properties - , "http://localhost:8080" //testURL - , "http://localhost:8180" //secondaryURL // This need to match Port vcalue from secondary/microprofile-config.proeprties + , "8080" //portServiceA + , "8180" //portServiceB // This need to match Port vcalue from secondary/microprofile-config.proeprties ); // @formatter:on @@ -92,18 +92,18 @@ public enum SupportedServer { private List mpVersions; private String jarFileName; private String jarParameters; - private String testURL; - private String secondaryURL; + private String portServiceA; + private String portServiceB; SupportedServer(String code, String displayName, List mpVersions, String jarFileName - , String jarParameters, String testURL, String secondaryURL) { + , String jarParameters, String portServiceA, String portServiceB) { this.code = code; this.displayName = displayName; this.mpVersions = mpVersions; this.jarFileName = jarFileName; this.jarParameters = jarParameters; - this.testURL = testURL; - this.secondaryURL = secondaryURL; + this.portServiceA = portServiceA; + this.portServiceB = portServiceB; } public String getCode() { @@ -126,12 +126,12 @@ public String getJarParameters() { return jarParameters; } - public String getTestURL() { - return testURL; + public String getPortServiceA() { + return portServiceA; } - public String getSecondaryURL() { - return secondaryURL; + public String getPortServiceB() { + return portServiceB; } public static SupportedServer valueFor(String data) { diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java index 343a79b7..8ae45371 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java @@ -21,6 +21,7 @@ import org.apache.maven.model.Model; import org.eclipse.microprofile.starter.addon.microprofile.servers.AbstractMicroprofileAddon; +import org.eclipse.microprofile.starter.addon.microprofile.servers.model.MicroprofileSpec; import org.eclipse.microprofile.starter.addon.microprofile.servers.model.SupportedServer; import org.eclipse.microprofile.starter.core.artifacts.CDICreator; import org.eclipse.microprofile.starter.core.artifacts.MavenCreator; @@ -29,6 +30,8 @@ import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; @@ -53,29 +56,56 @@ public void createFiles(JessieModel model) { Set alternatives = model.getParameter(JessieModel.Parameter.ALTERNATIVES); Map variables = model.getVariables(); - // kumuluzEE is JAR based, so needs beans.xml within META-INF + // Helidon's html files reside in resources/WEB; we can delete webapp dir. + String webHtmlDir = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_RESOURCES + "/" + "WEB"; + directoryCreator.createDirectory(webHtmlDir); + processTemplateFile(webHtmlDir, "index.html", alternatives, variables); + directoryCreator.removeDirectory(model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_WEBAPP); + if (model.hasMainAndSecondaryProject()) { + directoryCreator.removeDirectory(model.getDirectory(false) + "/" + MavenCreator.SRC_MAIN_WEBAPP); + } + + // Helidon is JAR based, so needs beans.xml within META-INF cdiCreator.createCDIFilesForJar(model, true); + if (model.hasMainAndSecondaryProject()) { + cdiCreator.createCDIFilesForJar(model, false); + } // Remove WEB-INF containing the beans.xml String webDirectory = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_WEBAPP + "/WEB-INF"; directoryCreator.removeDirectory(webDirectory); String rootJava = MavenCreator.SRC_MAIN_JAVA + "/" + directoryCreator.createPathForGroupAndArtifact(model.getMaven()); - String viewDirectory = model.getDirectory(true) + "/" + rootJava; - String resourcesDirectory = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_RESOURCES; + String resourcesDirectory = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_RESOURCES; directoryCreator.createDirectory(resourcesDirectory); - processTemplateFile(resourcesDirectory, "application.yaml", alternatives, variables); processTemplateFile(resourcesDirectory, "logging.properties", alternatives, variables); - processTemplateFile(resourcesDirectory, "publicKey.pem", alternatives, variables); - - String artifactId = variables.get("artifact"); - - String restAppFile = thymeleafEngine.processFile("RestApplication.java", alternatives, variables); - fileCreator.writeContents(viewDirectory, artifactId + "RestApplication.java", restAppFile); - - + processTemplateFile(resourcesDirectory, "privateKey.pem", alternatives, variables); + + List microprofileSpecs = model.getParameter(JessieModel.Parameter.MICROPROFILESPECS); + + if (model.hasMainAndSecondaryProject()) { + String viewDirectory = model.getDirectory(false) + "/" + rootJava; + directoryCreator.createDirectory(viewDirectory); + Set tempAlternative = new HashSet<>(alternatives); + tempAlternative.add(JessieModel.SECONDARY_INDICATOR); + String javaFile = thymeleafEngine.processFile("RestApplication.java", tempAlternative, variables); + fileCreator.writeContents(viewDirectory, variables.get("application") + "RestApplication.java", javaFile); + + String bResourcesDir = model.getDirectory(false) + "/" + MavenCreator.SRC_MAIN_RESOURCES; + String bResourcesMETAINFDir = bResourcesDir + "/META-INF"; + directoryCreator.createDirectory(bResourcesMETAINFDir); + + if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH)) { + processTemplateFile(bResourcesDir, "publicKey.pem", alternatives, variables); + javaFile = thymeleafEngine.processFile("ServiceController.java", tempAlternative, variables); + fileCreator.writeContents(viewDirectory + "/client", "ServiceController.java", javaFile); + } + + String configFile = thymeleafEngine.processFile("microprofile-config.properties", tempAlternative, variables); + fileCreator.writeContents(bResourcesMETAINFDir, "microprofile-config.properties", configFile); + } } @Override diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/TomeeServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/TomeeServer.java index 7829b3e1..ca336a96 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/TomeeServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/TomeeServer.java @@ -89,34 +89,38 @@ public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProjec } pomFile.addProperty("tomee.version", tomeeVersion); - if (!mainProject) { - adjustPOM(pomFile, model); - } + adjustPOM(pomFile, model, mainProject); + } - private void adjustPOM(Model pomFile, JessieModel model) { + private void adjustPOM(Model pomFile, JessieModel model, boolean mainProject) { Profile profile = pomFile.getProfiles().get(0);// We assume there is only 1 profile. Plugin mavenPlugin = findMavenPlugin(profile.getBuild().getPlugins()); Xpp3Dom configuration = (Xpp3Dom) mavenPlugin.getConfiguration(); Xpp3Dom httpPort = new Xpp3Dom("tomeeHttpPort"); - httpPort.setValue("8180"); + httpPort.setValue( + mainProject ? SupportedServer.TOMEE.getPortServiceA() : SupportedServer.TOMEE.getPortServiceB() + ); configuration.addChild(httpPort); Xpp3Dom shutdownPort = new Xpp3Dom("tomeeShutdownPort"); - shutdownPort.setValue("8105"); + shutdownPort.setValue( + mainProject ? "8005" : "8105" + ); configuration.addChild(shutdownPort); Xpp3Dom ajpPort = new Xpp3Dom("tomeeAjpPort"); - ajpPort.setValue("8109"); + ajpPort.setValue( + mainProject ? "8009" : "8109" + ); configuration.addChild(ajpPort); List microprofileSpecs = model.getParameter(JessieModel.Parameter.MICROPROFILESPECS); - if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH)) { + if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH) && !mainProject) { Xpp3Dom systemVariables = new Xpp3Dom("systemVariables"); Xpp3Dom publicKeyLocation = new Xpp3Dom("mp.jwt.verify.publickey.location"); publicKeyLocation.setValue("/publicKey.pem"); - systemVariables.addChild(publicKeyLocation); configuration.addChild(systemVariables); } diff --git a/src/main/java/org/eclipse/microprofile/starter/core/artifacts/JavaCreator.java b/src/main/java/org/eclipse/microprofile/starter/core/artifacts/JavaCreator.java index abab0565..62b1164c 100755 --- a/src/main/java/org/eclipse/microprofile/starter/core/artifacts/JavaCreator.java +++ b/src/main/java/org/eclipse/microprofile/starter/core/artifacts/JavaCreator.java @@ -59,7 +59,6 @@ public void createJavaFiles(JessieModel model) { application = variables.get("application"); javaFile = thymeleafEngine.processFile("RestApplication.java", tempAlternative, variables); fileCreator.writeContents(viewDirectory, application + "RestApplication.java", javaFile); - } } } diff --git a/src/main/java/org/eclipse/microprofile/starter/core/artifacts/MavenCreator.java b/src/main/java/org/eclipse/microprofile/starter/core/artifacts/MavenCreator.java index e213c098..a6563fff 100755 --- a/src/main/java/org/eclipse/microprofile/starter/core/artifacts/MavenCreator.java +++ b/src/main/java/org/eclipse/microprofile/starter/core/artifacts/MavenCreator.java @@ -143,8 +143,10 @@ private Model createSingleModule(JessieModel model) { pomFile.addProperty("failOnMissingWebXml", "false"); + pomFile.addProperty("final.name", model.getMaven().getArtifactId()); + Build build = new Build(); - build.setFinalName("${project.artifactId}"); + build.setFinalName(model.getMaven().getArtifactId()); pomFile.setBuild(build); return pomFile; diff --git a/src/main/resources/files.lst b/src/main/resources/files.lst index abf56ab7..d0a01b4c 100644 --- a/src/main/resources/files.lst +++ b/src/main/resources/files.lst @@ -1,52 +1,49 @@ -src/main/resources/files/tomee/index.html.tpl -src/main/resources/files/securedURLs.ini.tpl +src/main/resources/files/beans.xml.tpl src/main/resources/files/ClientController.java.tpl -src/main/resources/files/RestApplication.java.tpl -src/main/resources/files/kumuluzEE/RestApplication.java.tpl +src/main/resources/files/ConfigTestController.java.tpl +src/main/resources/files/helidon/logging.properties.tpl +src/main/resources/files/helidon/microprofile-config.properties.tpl +src/main/resources/files/helidon/ProtectedController.java.tpl +src/main/resources/files/helidon/RestApplication.java.tpl +src/main/resources/files/helidon/service-b/microprofile-config.properties.tpl +src/main/resources/files/helidon/service-b/RestApplication.java.tpl +src/main/resources/files/helidon/service-b/ServiceController.java.tpl +src/main/resources/files/HelloBean.java.tpl +src/main/resources/files/HelloController.java.tpl +src/main/resources/files/index.html.tpl +src/main/resources/files/index.xhtml.tpl +src/main/resources/files/jwt-roles.properties.tpl src/main/resources/files/kumuluzEE/config.yaml.tpl -src/main/resources/files/kumuluzEE/service-b/RestApplication.java.tpl +src/main/resources/files/kumuluzEE/RestApplication.java.tpl src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl -src/main/resources/files/MPJWTToken.java.tpl -src/main/resources/files/Service.java.tpl +src/main/resources/files/kumuluzEE/service-b/RestApplication.java.tpl +src/main/resources/files/liberty/public.jks.tpl +src/main/resources/files/liberty/server.xml.tpl +src/main/resources/files/liberty/service-b/server.xml.tpl src/main/resources/files/MetricController.java.tpl -src/main/resources/files/readme.md.top.tpl -src/main/resources/files/thorntail-v2/web.xml.tpl src/main/resources/files/microprofile-config.properties.tpl -src/main/resources/files/wildfly-swarm/web.xml.tpl -src/main/resources/files/beans.xml.tpl -src/main/resources/files/ServiceHealthCheck.java.tpl -src/main/resources/files/index.xhtml.tpl -src/main/resources/files/payara-micro/RestApplication.java.tpl +src/main/resources/files/MPJWTToken.java.tpl +src/main/resources/files/octopusConfig.properties.tpl +src/main/resources/files/octopus_index.xhtml.tpl src/main/resources/files/payara-micro/payara-mp-jwt.properties.tpl +src/main/resources/files/payara-micro/RestApplication.java.tpl src/main/resources/files/payara-micro/service-b/RestApplication.java.tpl -src/main/resources/files/HelloBean.java.tpl -src/main/resources/files/liberty/server.xml.tpl -src/main/resources/files/liberty/public.jks.tpl -src/main/resources/files/liberty/index.html.tpl -src/main/resources/files/liberty/TestSecureController.java.tpl -src/main/resources/files/liberty/service-b/server.xml.tpl -src/main/resources/files/index.html.tpl -src/main/resources/files/readme.md.tpl -src/main/resources/files/TestSecureController.java.tpl -src/main/resources/files/octopus_index.xhtml.tpl -src/main/resources/files/service-b/RestApplication.java.tpl src/main/resources/files/privateKey.pem.tpl -src/main/resources/files/ServiceController.java.tpl -src/main/resources/files/readme.md.secondary.tpl +src/main/resources/files/project-defaults.yml.tpl src/main/resources/files/ProtectedController.java.tpl +src/main/resources/files/publicKey.pem.tpl +src/main/resources/files/readme.md.secondary.tpl +src/main/resources/files/readme.md.top.tpl +src/main/resources/files/readme.md.tpl src/main/resources/files/ResilienceController.java.tpl +src/main/resources/files/RestApplication.java.tpl +src/main/resources/files/securedURLs.ini.tpl +src/main/resources/files/service-b/RestApplication.java.tpl +src/main/resources/files/ServiceController.java.tpl +src/main/resources/files/ServiceHealthCheck.java.tpl +src/main/resources/files/Service.java.tpl +src/main/resources/files/TestSecureController.java.tpl +src/main/resources/files/thorntail-v2/web.xml.tpl +src/main/resources/files/tomee/index.html.tpl src/main/resources/files/web.xml.tpl -src/main/resources/files/helidon/application.yaml.tpl -src/main/resources/files/helidon/RestApplication.java.tpl -src/main/resources/files/helidon/microprofile-config.properties.tpl -src/main/resources/files/helidon/logging.properties.tpl -src/main/resources/files/helidon/service-b/application.yaml.tpl -src/main/resources/files/helidon/service-b/RestApplication.java.tpl -src/main/resources/files/helidon/service-b/microprofile-config.properties.tpl -src/main/resources/files/helidon/ProtectedController.java.tpl -src/main/resources/files/HelloController.java.tpl -src/main/resources/files/jwt-roles.properties.tpl -src/main/resources/files/publicKey.pem.tpl -src/main/resources/files/ConfigTestController.java.tpl -src/main/resources/files/octopusConfig.properties.tpl -src/main/resources/files/project-defaults.yml.tpl +src/main/resources/files/wildfly-swarm/web.xml.tpl diff --git a/src/main/resources/files/Service.java.tpl b/src/main/resources/files/Service.java.tpl index 7da189e1..54256ebb 100644 --- a/src/main/resources/files/Service.java.tpl +++ b/src/main/resources/files/Service.java.tpl @@ -15,5 +15,4 @@ public interface Service { @Path("/{parameter}") String doSomething(@PathParam("parameter") String parameter); - } diff --git a/src/main/resources/files/TestSecureController.java.tpl b/src/main/resources/files/TestSecureController.java.tpl index d3fd7326..edcd907d 100644 --- a/src/main/resources/files/TestSecureController.java.tpl +++ b/src/main/resources/files/TestSecureController.java.tpl @@ -48,7 +48,7 @@ public class TestSecureController { String jwt = generateJWT(key); // any method to send a REST request with an appropriate header will work of course. - WebTarget target = ClientBuilder.newClient().target("http://localhost:8180/data/protected"); + WebTarget target = ClientBuilder.newClient().target("http://localhost:[# th:text="${port_service_b}"/]/data/protected"); Response response = target.request().header("authorization", "Bearer " + jwt).buildGet().invoke(); return String.format("Claim value within JWT of 'custom-value' : %s", response.readEntity(String.class)); diff --git a/src/main/resources/files/helidon/RestApplication.java.tpl b/src/main/resources/files/helidon/RestApplication.java.tpl index 59321e99..e0539fb3 100755 --- a/src/main/resources/files/helidon/RestApplication.java.tpl +++ b/src/main/resources/files/helidon/RestApplication.java.tpl @@ -9,6 +9,12 @@ import [# th:text="${java_package}"/].resilient.ResilienceController; [# th:if="${mp_metrics}"] import [# th:text="${java_package}"/].metric.MetricController; [/] +[# th:if="${mp_JWT_auth}"] +import [# th:text="${java_package}"/].secure.TestSecureController; +[/] +[# th:if="${mp_rest_client}"] +import [# th:text="${java_package}"/].client.ClientController; +[/] import javax.enterprise.context.ApplicationScoped; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @@ -38,7 +44,12 @@ public class [# th:text="${application}"/]RestApplication extends Application { [# th:if="${mp_metrics}"] classes.add(MetricController.class); [/] - + [# th:if="${mp_rest_client}"] + classes.add(ClientController.class); + [/] + [# th:if="${mp_JWT_auth}"] + classes.add(TestSecureController.class); + [/] return classes; } diff --git a/src/main/resources/files/helidon/application.yaml.tpl b/src/main/resources/files/helidon/application.yaml.tpl deleted file mode 100755 index e9dda4c8..00000000 --- a/src/main/resources/files/helidon/application.yaml.tpl +++ /dev/null @@ -1,6 +0,0 @@ - -security: - jersey: - analyzers: - jwt: - secure-by-default: "false" diff --git a/src/main/resources/files/helidon/logging.properties.tpl b/src/main/resources/files/helidon/logging.properties.tpl index 79545d10..25a7c650 100755 --- a/src/main/resources/files/helidon/logging.properties.tpl +++ b/src/main/resources/files/helidon/logging.properties.tpl @@ -10,7 +10,7 @@ handlers=java.util.logging.ConsoleHandler # Helidon Web Server has a custom log formatter that extends SimpleFormatter. # It replaces "!thread!" with the current thread name java.util.logging.ConsoleHandler.level=INFO -java.util.logging.ConsoleHandler.formatter=io.helidon.webserver.netty.WebServerLogFormatter +java.util.logging.ConsoleHandler.formatter=io.helidon.webserver.WebServerLogFormatter java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n #Component specific log levels diff --git a/src/main/resources/files/helidon/microprofile-config.properties.tpl b/src/main/resources/files/helidon/microprofile-config.properties.tpl index 40f6deef..b9c1d3e6 100755 --- a/src/main/resources/files/helidon/microprofile-config.properties.tpl +++ b/src/main/resources/files/helidon/microprofile-config.properties.tpl @@ -2,10 +2,12 @@ injected.value=Injected value value=lookup value # Microprofile server properties -server.port=8080 +server.port=[# th:text="${port_service_a}"/] server.host=0.0.0.0 # src/main/resources/WEB in your source tree server.static.classpath.location=/WEB # default is index.html #server.static.classpath.welcome=index.html + +[# th:text="${java_package}"/].client.Service/mp-rest/url=http://localhost:[# th:text="${port_service_b}"/]/data/client/service \ No newline at end of file diff --git a/src/main/resources/files/helidon/service-b/RestApplication.java.tpl b/src/main/resources/files/helidon/service-b/RestApplication.java.tpl index b1b2643d..246d57f8 100755 --- a/src/main/resources/files/helidon/service-b/RestApplication.java.tpl +++ b/src/main/resources/files/helidon/service-b/RestApplication.java.tpl @@ -5,7 +5,9 @@ import [# th:text="${java_package}"/].secure.ProtectedController; import org.eclipse.microprofile.auth.LoginConfig; import javax.annotation.security.DeclareRoles; [/] - +[# th:if="${mp_rest_client}"] +import [# th:text="${java_package}"/].client.ServiceController; +[/] import javax.enterprise.context.ApplicationScoped; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @@ -29,8 +31,9 @@ public class [# th:text="${application}"/]RestApplication extends Application { Set> classes = new HashSet<>(); // resources - classes.add(HelloController.class); - + [# th:if="${mp_rest_client}"] + classes.add(ServiceController.class); + [/] [# th:if="${mp_JWT_auth}"] classes.add(ProtectedController.class); [/] diff --git a/src/main/resources/files/helidon/service-b/ServiceController.java.tpl b/src/main/resources/files/helidon/service-b/ServiceController.java.tpl new file mode 100644 index 00000000..6c0dde48 --- /dev/null +++ b/src/main/resources/files/helidon/service-b/ServiceController.java.tpl @@ -0,0 +1,20 @@ +package [# th:text="${java_package}"/].client; +[# th:if="${mp_JWT_auth}"] +import javax.annotation.security.PermitAll; +[/] +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; + +@Path("/client/service") +public class ServiceController { + + @GET + @Path("/{parameter}") + [# th:if="${mp_JWT_auth}"] + @PermitAll + [/] + public String doSomething(@PathParam("parameter") String parameter) { + return String.format("Processed parameter value '%s'", parameter); + } +} diff --git a/src/main/resources/files/helidon/service-b/application.yaml.tpl b/src/main/resources/files/helidon/service-b/application.yaml.tpl deleted file mode 100755 index e3b470ac..00000000 --- a/src/main/resources/files/helidon/service-b/application.yaml.tpl +++ /dev/null @@ -1,17 +0,0 @@ -mp: - jwt: - verify: - issuer: "https://server.example.com" - -security: - jersey: - analyzers: - jwt: - secure-by-default: "false" - providers: - - mp-jwt-auth: - atn-token: - # must use helidon specific configuration, as otherwise MP validation could fail if public key location is defined - # as well - verify-key: "/publicKey.pem" - - abac: \ No newline at end of file diff --git a/src/main/resources/files/helidon/service-b/microprofile-config.properties.tpl b/src/main/resources/files/helidon/service-b/microprofile-config.properties.tpl index 563e59b9..3cd84d82 100755 --- a/src/main/resources/files/helidon/service-b/microprofile-config.properties.tpl +++ b/src/main/resources/files/helidon/service-b/microprofile-config.properties.tpl @@ -1,11 +1,16 @@ -injected.value=Injected value -value=lookup value - # Microprofile server properties -server.port=8180 +server.port=[# th:text="${port_service_b}"/] server.host=0.0.0.0 # src/main/resources/WEB in your source tree server.static.classpath.location=/WEB # default is index.html #server.static.classpath.welcome=index.html + +[# th:if="${mp_JWT_auth}"] +# configure JWT handling +mp.jwt.verify.issuer=https://server.example.com +mp.jwt.verify.publickey.location=publicKey.pem +# enable the security provider +security.providers.0.mp-jwt-auth +[/] \ No newline at end of file diff --git a/src/main/resources/files/kumuluzEE/config.yaml.tpl b/src/main/resources/files/kumuluzEE/config.yaml.tpl index 791f2882..35a659f7 100755 --- a/src/main/resources/files/kumuluzEE/config.yaml.tpl +++ b/src/main/resources/files/kumuluzEE/config.yaml.tpl @@ -10,7 +10,10 @@ kumuluzee: rest-client: registrations: - class: [# th:text="${java_package}"/].client.Service - url: [# th:text="${secondary_url}"/]/data/client/service + url: http://localhost:[# th:text="${port_service_b}"/]/data/client/service + server: + http: + port: [# th:text="${port_service_a}"/] injected: value: Injected value value: lookup value diff --git a/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl b/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl index 1f737293..4b10c71f 100755 --- a/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl +++ b/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl @@ -8,5 +8,5 @@ kumuluzee: issuer: https://server.example.com server: http: - port: 8180 + port: [# th:text="${port_service_b}"/] diff --git a/src/main/resources/files/liberty/TestSecureController.java.tpl b/src/main/resources/files/liberty/TestSecureController.java.tpl deleted file mode 100644 index df2e7632..00000000 --- a/src/main/resources/files/liberty/TestSecureController.java.tpl +++ /dev/null @@ -1,102 +0,0 @@ -package [# th:text="${java_package}"/].secure; - -import com.nimbusds.jose.*; -import com.nimbusds.jose.crypto.RSASSASigner; -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.bouncycastle.openssl.PEMKeyPair; -import org.bouncycastle.openssl.PEMParser; -import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.security.KeyPair; -import java.security.PrivateKey; -import java.util.Arrays; -import java.util.UUID; - -@Path("/secured") -@ApplicationScoped -public class TestSecureController { - - private PrivateKey key; - - @PostConstruct - public void init() { - try { - key = readPrivateKey(); - } catch (IOException e) { - ; // - } - } - - @GET - @Path("/test") - public String testSecureCall() { - if (key == null) { - throw new WebApplicationException("Unable to read privateKey.pem", 500); - } - - String jwt = generateJWT(key); - - // any method to send a REST request with an appropriate header will work of course. - WebTarget target = ClientBuilder.newClient().target("http://localhost:8281/[# th:text="${artifact_id}"/]/data/protected"); - Response response = target.request().header("authorization", "Bearer " + jwt).buildGet().invoke(); - - return String.format("Claim value within JWT of 'custom-value' : %s", response.readEntity(String.class)); - } - - private static String generateJWT(PrivateKey key) { - JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.RS256) - .type(JOSEObjectType.JWT) - .keyID("theKeyId") - .build(); - - MPJWTToken token = new MPJWTToken(); - token.setAud("targetService"); - token.setIss("https://server.example.com"); // Must match the expected issues configuration values - token.setJti(UUID.randomUUID().toString()); - - token.setSub("Jessie"); // Sub is required for WildFly Swarm - token.setUpn("Jessie"); - - token.setIat(System.currentTimeMillis()); - token.setExp(System.currentTimeMillis() + 30000); // 30 Seconds expiration! - - token.addAdditionalClaims("custom-value", "Jessie specific value"); - - token.setGroups(Arrays.asList("user", "protected")); - - JWSObject jwsObject = new JWSObject(header, new Payload(token.toJSONString())); - - // Apply the Signing protection - JWSSigner signer = new RSASSASigner(key); - - try { - jwsObject.sign(signer); - } catch (JOSEException e) { - e.printStackTrace(); - } - - return jwsObject.serialize(); - } - - private PrivateKey readPrivateKey() throws IOException { - - InputStream inputStream = TestSecureController.class.getResourceAsStream("/privateKey.pem"); - - PEMParser pemParser = new PEMParser(new InputStreamReader(inputStream)); - JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(new BouncyCastleProvider()); - Object object = pemParser.readObject(); - KeyPair kp = converter.getKeyPair((PEMKeyPair) object); - return kp.getPrivate(); - } -} diff --git a/src/main/resources/files/liberty/index.html.tpl b/src/main/resources/files/liberty/index.html.tpl deleted file mode 100755 index 465d7588..00000000 --- a/src/main/resources/files/liberty/index.html.tpl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Eclipse MicroProfile demo - - - -

MicroProfile

- -Hello JAX-RS endpoint
- -[# th:if="${mp_config}"] -

Config

-Injected config values
-Config values by lookup
-[/] - -[# th:if="${mp_fault_tolerance}"] -

Fault tolerance

-Fallback after timeout
-[/] - -[# th:if="${mp_health_checks}"] -

Health

-Health status (with custom status ServiceHealthCheck)
-[/] - -[# th:if="${mp_metrics}"] -

Metrics

-Timed endpoint
-Metrics page
-[/] - -[# th:if="${mp_JWT_auth}"] -

JWT Auth

-Call Secured endpoint with JWT in Authorization Header
-[/] - -[# th:if="${mp_open_API}"] -

Open API

-Open API Documentation
-[/] - -[# th:if="${mp_open_tracing}"] -

Open Tracing

-[/] - -[# th:if="${mp_rest_client}"] -

Rest Client

-Call REST endpoint using generated client based on interface
-[/] - - - \ No newline at end of file diff --git a/src/main/resources/files/liberty/server.xml.tpl b/src/main/resources/files/liberty/server.xml.tpl index e5d1d66d..72250d22 100755 --- a/src/main/resources/files/liberty/server.xml.tpl +++ b/src/main/resources/files/liberty/server.xml.tpl @@ -1,17 +1,16 @@ - + microProfile-[# th:text="${mp_version}"/] - - - + + diff --git a/src/main/resources/files/liberty/service-b/server.xml.tpl b/src/main/resources/files/liberty/service-b/server.xml.tpl index 5998f1e4..dc0faf93 100755 --- a/src/main/resources/files/liberty/service-b/server.xml.tpl +++ b/src/main/resources/files/liberty/service-b/server.xml.tpl @@ -1,18 +1,16 @@ - + microProfile-[# th:text="${mp_version}"/] - - - - + + diff --git a/src/main/resources/files/microprofile-config.properties.tpl b/src/main/resources/files/microprofile-config.properties.tpl index 46200d7c..c0d6cb3e 100755 --- a/src/main/resources/files/microprofile-config.properties.tpl +++ b/src/main/resources/files/microprofile-config.properties.tpl @@ -1,4 +1,4 @@ injected.value=Injected value value=lookup value -[# th:text="${java_package}"/].client.Service/mp-rest/url=[# th:text="${secondary_url}"/]/data/client/service \ No newline at end of file +[# th:text="${java_package}"/].client.Service/mp-rest/url=http://localhost:[# th:text="${port_service_b}"/]/data/client/service \ No newline at end of file diff --git a/src/main/resources/files/readme.md.secondary.tpl b/src/main/resources/files/readme.md.secondary.tpl index c5066efc..71e2dadb 100755 --- a/src/main/resources/files/readme.md.secondary.tpl +++ b/src/main/resources/files/readme.md.secondary.tpl @@ -23,7 +23,6 @@ The **ProtectedController** contains the protected endpoint since it contains th The _TestSecureController_ code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs. - [/] @@ -33,5 +32,4 @@ However, any method to send a REST request with an appropriate header will work A type safe invocation of HTTP rest endpoints. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean. - [/] \ No newline at end of file diff --git a/src/main/resources/files/readme.md.tpl b/src/main/resources/files/readme.md.tpl index f335f4bb..a6a24659 100755 --- a/src/main/resources/files/readme.md.tpl +++ b/src/main/resources/files/readme.md.tpl @@ -14,7 +14,7 @@ This will create an executable jar file **[# th:text="${jar_file}"/]** within th To launch the test page, open your browser at the following URL - [# th:text="${test_url}"/]/index.html + http://localhost:[# th:text="${port_service_a}"/]/index.html ## Specification examples @@ -83,7 +83,6 @@ The index page contains a link to the OpenAPI information of your endpoints. Allow the participation in distributed tracing of your requests through various micro services. Specification [here](https://microprofile.io/project/eclipse/microprofile-opentracing) Example needs to be created. - [/] [# th:if="${mp_rest_client}"] @@ -92,5 +91,4 @@ Example needs to be created. A type safe invocation of HTTP rest endpoints. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean. - [/] \ No newline at end of file diff --git a/src/main/resources/pom-servers.xml b/src/main/resources/pom-servers.xml index 8956a358..aa1dfbbc 100755 --- a/src/main/resources/pom-servers.xml +++ b/src/main/resources/pom-servers.xml @@ -129,31 +129,7 @@ liberty - - - - 8181 - 8543 - https://server.example.com - - ${project.artifactId} - - - ${basedir}/src/main/resources - - **/*.* - - - - ${basedir}/src/main/liberty - true - - **/*.* - - - - net.wasdev.wlp.maven.plugins @@ -168,14 +144,17 @@ zip - target/classes/config/server.xml - ${project.build.directory}/${project.artifactId}.war - ${project.build.directory}/${project.artifactId}.jar + src/main/liberty/config/server.xml + ${project.build.directory}/${final.name}.war + ${project.build.directory}/${final.name}.jar runnable - ${project.artifactId} + ${final.name} project ${project.basedir}/src/main/liberty/server - + + ${final.name} + https://server.example.com + @@ -292,7 +271,7 @@ helidon - 2.26 + 2.29 io.helidon.microprofile.server.Main libs ${project.build.directory}/${libs.classpath.prefix} @@ -321,11 +300,6 @@ jersey-media-json-binding ${jersey.version} - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - @@ -337,11 +311,6 @@ org.glassfish.jersey.media jersey-media-json-binding - - org.glassfish.jersey.core - jersey-client - compile - org.jboss jandex diff --git a/src/test/java/org/eclipse/microprofile/starter/DynamoDBLoggerTest.java b/src/test/java/org/eclipse/microprofile/starter/dynamologger/DynamoDBLoggerTest.java similarity index 97% rename from src/test/java/org/eclipse/microprofile/starter/DynamoDBLoggerTest.java rename to src/test/java/org/eclipse/microprofile/starter/dynamologger/DynamoDBLoggerTest.java index 24185c29..64d89caa 100644 --- a/src/test/java/org/eclipse/microprofile/starter/DynamoDBLoggerTest.java +++ b/src/test/java/org/eclipse/microprofile/starter/dynamologger/DynamoDBLoggerTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package org.eclipse.microprofile.starter; +package org.eclipse.microprofile.starter.dynamologger; import org.eclipse.microprofile.starter.addon.microprofile.servers.model.MicroprofileSpec; import org.eclipse.microprofile.starter.addon.microprofile.servers.model.SupportedServer; From f81990b62801e7373eacbaa647d598ccc85eaef2 Mon Sep 17 00:00:00 2001 From: Michal Karm Babacek Date: Fri, 13 Sep 2019 14:54:20 +0200 Subject: [PATCH 2/2] Fixes Helidon MP 1.2 unnecessary RestClient client and KumuluzEE issue 215 Signed-off-by: Michal Karm Babacek --- gencerts.sh | 40 +++++ .../servers/MicroprofileServersAddon.java | 31 ++-- .../servers/server/HelidonServer.java | 2 - .../files/kumuluzEE/service-b/config.yaml.tpl | 2 +- .../resources/files/liberty/public.jks.tpl | Bin 742 -> 1234 bytes src/main/resources/files/privateKey.pem.tpl | 142 ++++++++++++++---- src/main/resources/files/publicKey.pem.tpl | 16 +- src/main/temp/privateKey.pem | 28 ---- 8 files changed, 178 insertions(+), 83 deletions(-) create mode 100755 gencerts.sh mode change 100755 => 100644 src/main/resources/files/liberty/public.jks.tpl mode change 100755 => 100644 src/main/resources/files/privateKey.pem.tpl mode change 100755 => 100644 src/main/resources/files/publicKey.pem.tpl delete mode 100755 src/main/temp/privateKey.pem diff --git a/gencerts.sh b/gencerts.sh new file mode 100755 index 00000000..1e82c8f7 --- /dev/null +++ b/gencerts.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# Generates certificates for JWT_AUTH demo examples. + +pushd src/main/resources/ + +openssl genrsa -out private.key 2048 +cat << EOF | openssl req -new -key private.key \ + -x509 -days 0 \ + -out publickey.cer +-- +JWT +JWT +JWT +JWT +JWT +JWT +EOF + +keytool -import -noprompt -alias theKeyId -keystore public.jks -file publickey.cer -storepass atbash + +cat private.key | openssl pkcs8 -topk8 -nocrypt -out private.pem +openssl rsa -in private.pem -outform PEM -pubout -out public.pem +rm -rf private.key +rm -rf publickey.cer +mv public.jks ./files/liberty/public.jks.tpl +mv private.pem ./files/privateKey.pem.tpl +mv public.pem ./files/publicKey.pem.tpl + +# As soon as we switch to VertX JWT https://github.com/eclipse/microprofile-starter/issues/206 +# This conversion won't be needed: +# org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.openssl.PEMKeyPair +openssl rsa -in ./files/privateKey.pem.tpl -text -out ./files/privateKey.pem.tpl.long +mv ./files/privateKey.pem.tpl.long ./files/privateKey.pem.tpl + +# KumuluzEE needs pub key in config +KEY=`cat ./files/publicKey.pem.tpl | grep -ve '^-' | tr -d '\n'` +sed -i "s~[ ]*public-key:.*~ public-key: $KEY~g" ./files/kumuluzEE/service-b/config.yaml.tpl + +popd \ No newline at end of file diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java index 80026ecd..376c1bd8 100755 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java @@ -183,6 +183,8 @@ public Set alternativesNames(JessieModel model) { public void createFiles(JessieModel model) { Set alternatives = model.getParameter(JessieModel.Parameter.ALTERNATIVES); + Set bAlternatives = new HashSet<>(alternatives); + bAlternatives.add(JessieModel.SECONDARY_INDICATOR); Map variables = model.getVariables(); String serverName = model.getOptions().get("mp.server").getSingleValue(); @@ -225,18 +227,6 @@ public void createFiles(JessieModel model) { processTemplateFile(faultDirectory, "ResilienceController.java", alternatives, variables); } - if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH)) { - String secureDirectory; - - if (model.hasMainAndSecondaryProject()) { - secureDirectory = model.getDirectory(false) + "/" + rootJava + "/secure"; - directoryCreator.createDirectory(secureDirectory); - - processTemplateFile(secureDirectory, "ProtectedController.java", alternatives, variables); - - } - } - if (microprofileSpecs.contains(MicroprofileSpec.REST_CLIENT)) { String clientMainDirectory = model.getDirectory(true) + "/" + rootJava + "/client"; directoryCreator.createDirectory(clientMainDirectory); @@ -244,16 +234,22 @@ public void createFiles(JessieModel model) { String clientSecondaryDirectory = model.getDirectory(false) + "/" + rootJava + "/client"; directoryCreator.createDirectory(clientSecondaryDirectory); - processTemplateFile(clientSecondaryDirectory, "ServiceController.java", alternatives, variables); + processTemplateFile(clientSecondaryDirectory, "ServiceController.java", bAlternatives, variables); processTemplateFile(clientMainDirectory, "Service.java", alternatives, variables); processTemplateFile(clientMainDirectory, "ClientController.java", alternatives, variables); } if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH)) { - String javaDirectory = model.getDirectory(true) + "/" + rootJava + "/secure"; + if (model.hasMainAndSecondaryProject()) { + String bSecureDirectory = model.getDirectory(false) + "/" + rootJava + "/secure"; + directoryCreator.createDirectory(bSecureDirectory); + processTemplateFile(bSecureDirectory, "ProtectedController.java", bAlternatives, variables); + } + + String aSecureDirectory = model.getDirectory(true) + "/" + rootJava + "/secure"; - processTemplateFile(javaDirectory, "TestSecureController.java", alternatives, variables); - processTemplateFile(javaDirectory, "MPJWTToken.java", alternatives, variables); + processTemplateFile(aSecureDirectory, "TestSecureController.java", alternatives, variables); + processTemplateFile(aSecureDirectory, "MPJWTToken.java", alternatives, variables); String resourceDirectory = getResourceDirectory(model, true); @@ -263,12 +259,11 @@ public void createFiles(JessieModel model) { // With KumuluzEE, it properties are integrated within config.yaml if (supportedServer != SupportedServer.KUMULUZEE) { String metaInfDirectory = getResourceDirectory(model, true) + "/META-INF"; - directoryCreator.createDirectory(metaInfDirectory); processTemplateFile(metaInfDirectory, "microprofile-config.properties", alternatives, variables); } - // Helidon should have it in src/main/resource/WEB + // Helidon should have it in src/main/resources/WEB if (supportedServer != SupportedServer.HELIDON) { // Demo index file to all endpoints String webDirectory = model.getDirectory(true) + "/" + MavenCreator.SRC_MAIN_WEBAPP; diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java index 8ae45371..a71f07e7 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java @@ -99,8 +99,6 @@ public void createFiles(JessieModel model) { if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH)) { processTemplateFile(bResourcesDir, "publicKey.pem", alternatives, variables); - javaFile = thymeleafEngine.processFile("ServiceController.java", tempAlternative, variables); - fileCreator.writeContents(viewDirectory + "/client", "ServiceController.java", javaFile); } String configFile = thymeleafEngine.processFile("microprofile-config.properties", tempAlternative, variables); diff --git a/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl b/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl index 4b10c71f..8590663e 100755 --- a/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl +++ b/src/main/resources/files/kumuluzEE/service-b/config.yaml.tpl @@ -4,7 +4,7 @@ kumuluzee: env: name: dev jwt-auth: - public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlivFI8qB4D0y2jy0CfEqFyy46R0o7S8TKpsx5xbHKoU1VWg6QkQm+ntyIv1p4kE1sPEQO73+HY8+Bzs75XwRTYL1BmR1w8J5hmjVWjc6R2BTBGAYRPFRhor3kpM6ni2SPmNNhurEAHw7TaqszP5eUF/F9+KEBWkwVta+PZ37bwqSE4sCb1soZFrVz/UT/LF4tYpuVYt3YbqToZ3pZOZ9AX2o1GCG3xwOjkc4x0W7ezbQZdC9iftPxVHR8irOijJRRjcPDtA6vPKpzLl6CyYnsIYPd99ltwxTHjr3npfv/3Lw50bAkbT4HeLFxTx4flEoZLKO/g0bAoV2uqBhkA9xnQIDAQAB + public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtJt3yCtGjZOpFo/YEJTs3sF9VuaZfvh7cigTg/CBbkcEGvRinJVgOBhI/otnQAnTxeGyViCPVr99Bt6ANf56LyZBNpEjs1hmQ5ZKIj0acAV00I5Mn5orzRVmcomiI2978r+D5s2h1HV37ZiBdD5aRxnW+VXRswRgnvvF6/8r4bu+wJHqiStzeZOZqVzs9mxqS20eKxG93C2h972Gz/RvJR9BP7nvduDq2JVSkoukYyhtgZ5q50E42KLgzyAecj6T36qcgciIcYuJTJLZn3paXF16VzRmeuqNKprZYEA4VADTOC2JtozJIc3Q+y4Kf9zT1hYJzYZxk69Hux/OdPBIKwIDAQAB issuer: https://server.example.com server: http: diff --git a/src/main/resources/files/liberty/public.jks.tpl b/src/main/resources/files/liberty/public.jks.tpl old mode 100755 new mode 100644 index 22015b3e8c6ec812a20d4de4d0bff3b0f9bb9714..c8cac6008fd6a62f1c3ee01db0d64d9f90803b73 GIT binary patch literal 1234 zcmV;@1TFh8f&|V20Ru3C1cwF*Duzgg_YDCD0ic2ecm#q3bTEPha4>=dYz7G`hDe6@ z4FLxRpn?QlFoFbG0s#Opf&@|q2`Yw2hW8Bt2LUiC1_~;MNQU8>OB6f5iNsEIQs*00s{cUP=JC27$d9rdHT&RKKe&V6PWA|@0A0%qK+2LbOmn`29SS1oYL)vpn6;{^btZo>zJ$qe5KIlD(UjWFM zz2u!|5@sBC3i>MOgmoQ$r|Qi^@$%oh$r-HDA$X2m)3 zh+_8s6$b@ z=zgiRwJ>(X<+esJaALqpmO)sQS#MJ>%yB=`dT>|gDyk6Xr!1`F2EYppv-2-cR zk>>Y>250mF`b{XHvvw|IBa|UQ2U1H!hm_19%an|MNtuP{?h;W87JqvwT>*Z_^vhQ@ z91@m)+GO#Ocyo?rYFHX$jI*=m88n4kx~^X4+qCn`AnFolC>jYILMqRLa&W9g*Y4pG zzx^7Q?5#>cM+XV%2n(L+RBwk~h$|}uE|iGl-XO~cMjv4*mGtEKT^eXmT%f1Z@Y^xL z+FIn>CMR8iIWynuZP+B2a+TqXEfg^??E-Bc>oc@vPh2euw}L<~j`(KyPqDZV$bGv4 z7QM_I!sU#2E9z?kY}ww{nel8Sz2KTcRp}*Hu*K-Dpa@sACxcT{p$-um%CRstWNHb2 zHtU1-9|tdfV3`l1)-OS+Bhgo0s{etps&e4>;M1& literal 742 zcmezO_TO6u1_mY|W(3n5B^jyNsg;>2K!KEyBhD5KtPy&q29`iIOAVTs78*1$b}nFM zVq{`sWHjJqX@#b`yP2Nd?=ms(csqV z1uq<3x0=cPdi(ue=aL5LFXCF)wpjLS*_i#hELkFVT%_U~Q+&PT#QE(z-SldO3(tqU z%zntqb1vg1>xLT9puN^xluvKFd~|1!RilCOj5Xzfiw|tl-mKTXXwF03^Xsh+O>jCk z+xjhI&5hsNN;FL!mn||othz?{(V_2W4GP#h&pd4Ae%iC$VAbR!{sr6KPpHyU6Xp__ ztUo!f;aV&2r{70;?=rtVf9z+!#;T=TZNL9Z`gi_BaM&xIzNhEi><%UTI9YjU(v)?t zxqp?|&D-VAzqY{Dxhbs0&aN?;dEVvUtqu;GuGo6s(u;~ddE|i5;w4rY)h4P;%!~}^ z5daJ!MuwJq^L4U2t=27QxITyL6yIavS(nt*ltOn{MkhZ1ecm=F<>SP=lYXTI_s7}4+8#GAYze<19<#s2(NM{_ej2--O57FYBS%dZ{Pp>%NKWTUepl#aBg%!&Q6YA!Sv!RU$cKRn$EDz<^=#-raBz} diff --git a/src/main/resources/files/privateKey.pem.tpl b/src/main/resources/files/privateKey.pem.tpl old mode 100755 new mode 100644 index 12a52ea9..bbfe2843 --- a/src/main/resources/files/privateKey.pem.tpl +++ b/src/main/resources/files/privateKey.pem.tpl @@ -1,27 +1,117 @@ +Private-Key: (2048 bit) +modulus: + 00:b4:9b:77:c8:2b:46:8d:93:a9:16:8f:d8:10:94: + ec:de:c1:7d:56:e6:99:7e:f8:7b:72:28:13:83:f0: + 81:6e:47:04:1a:f4:62:9c:95:60:38:18:48:fe:8b: + 67:40:09:d3:c5:e1:b2:56:20:8f:56:bf:7d:06:de: + 80:35:fe:7a:2f:26:41:36:91:23:b3:58:66:43:96: + 4a:22:3d:1a:70:05:74:d0:8e:4c:9f:9a:2b:cd:15: + 66:72:89:a2:23:6f:7b:f2:bf:83:e6:cd:a1:d4:75: + 77:ed:98:81:74:3e:5a:47:19:d6:f9:55:d1:b3:04: + 60:9e:fb:c5:eb:ff:2b:e1:bb:be:c0:91:ea:89:2b: + 73:79:93:99:a9:5c:ec:f6:6c:6a:4b:6d:1e:2b:11: + bd:dc:2d:a1:f7:bd:86:cf:f4:6f:25:1f:41:3f:b9: + ef:76:e0:ea:d8:95:52:92:8b:a4:63:28:6d:81:9e: + 6a:e7:41:38:d8:a2:e0:cf:20:1e:72:3e:93:df:aa: + 9c:81:c8:88:71:8b:89:4c:92:d9:9f:7a:5a:5c:5d: + 7a:57:34:66:7a:ea:8d:2a:9a:d9:60:40:38:54:00: + d3:38:2d:89:b6:8c:c9:21:cd:d0:fb:2e:0a:7f:dc: + d3:d6:16:09:cd:86:71:93:af:47:bb:1f:ce:74:f0: + 48:2b +publicExponent: 65537 (0x10001) +privateExponent: + 3c:52:64:ca:6d:71:ce:1d:90:6f:21:b2:17:af:b6: + 01:9c:7c:81:86:d9:a3:a7:d8:8b:43:49:69:5a:ed: + cf:e8:56:3d:ae:7c:35:32:4b:05:d1:4e:a7:fd:e5: + 89:64:fe:df:6b:c7:85:ae:b0:51:57:f9:a9:4e:ad: + 61:db:51:f1:e7:84:06:76:a9:86:e0:32:9f:c6:55: + 92:63:f8:2d:8c:14:fd:07:5a:1e:40:7e:fa:ab:78: + 21:2f:49:01:2e:de:26:30:c3:1c:56:78:03:9f:0c: + 64:45:f8:8e:db:b8:89:60:df:05:3e:1d:a0:fe:08: + 4b:71:6a:24:ad:80:79:8f:0c:b0:30:34:48:f0:78: + 89:eb:3f:57:e1:34:cb:4b:ad:b4:f0:f2:36:c6:03: + 78:af:2e:1e:66:ed:c0:f8:4d:da:ae:8a:81:69:53: + 1d:a8:44:41:6c:ff:40:4f:c4:7b:35:77:c6:cd:6e: + 7f:b4:53:eb:72:f3:43:6c:47:3c:38:37:32:d1:8b: + 36:15:c5:41:a5:c9:13:5e:d3:17:49:bc:77:1c:94: + ef:d9:be:16:75:7f:d6:61:08:2c:c7:08:23:f4:71: + 23:a0:8a:4b:26:ee:e9:55:6c:ab:3e:d5:e5:ac:aa: + 07:5a:76:e4:a4:5c:ff:ca:f2:27:e8:63:54:59:6b: + 49 +prime1: + 00:dd:40:14:d5:33:23:c9:71:3e:ab:28:fe:c3:3a: + 05:08:38:e1:b7:5e:8d:09:8b:26:4d:e0:28:ff:ab: + 1e:9d:a9:23:03:f0:a4:22:f2:50:76:68:74:20:aa: + 17:b4:df:6a:aa:37:95:56:55:e9:3c:3a:b0:d5:7d: + d2:15:15:c6:13:52:72:96:fc:da:83:65:cb:5c:35: + cd:d3:1c:99:4a:8d:ee:7d:76:52:36:2e:8b:7c:e5: + 87:f9:96:41:72:9d:dd:37:a4:c1:ab:c3:b3:98:79: + ff:ab:90:65:7a:5f:4d:ef:55:0c:fa:97:d4:d9:a4: + 80:d7:3e:4c:bb:d1:56:38:b7 +prime2: + 00:d0:f9:3b:9e:6a:73:f2:30:3d:26:e2:22:7c:40: + ac:47:cf:1f:f1:52:79:79:54:1e:ca:ad:26:d8:cd: + 5a:69:29:69:4e:ef:35:5e:c7:c5:ea:57:b7:ed:be: + 68:65:0a:ab:de:7d:4e:38:48:a8:b3:71:0f:67:28: + 30:73:86:a6:90:b9:d6:f6:18:ef:56:58:e4:93:4b: + 00:98:a4:c3:3d:ce:59:e3:87:8e:dc:1f:d7:16:f6: + 03:b8:e1:7a:22:d4:87:4f:46:42:50:73:2d:d7:25: + ce:a9:25:5d:92:72:d7:1a:71:61:97:2a:cd:65:c8: + 60:76:0b:6b:78:f1:0a:30:2d +exponent1: + 62:47:ec:f9:27:d6:65:cd:60:41:37:dc:b3:6c:3a: + 80:04:84:7f:a8:08:8e:8c:b9:5f:2e:8c:07:c6:43: + bb:55:3e:b0:a9:5c:c0:09:53:a4:c5:91:90:50:fe: + 66:e2:37:c7:95:19:49:58:b0:5a:88:d7:b4:7e:47: + ac:06:18:0e:cd:39:09:c9:18:67:f5:f7:f7:e6:0e: + a0:10:bc:27:5a:14:ee:b6:78:9e:88:de:7d:84:98: + 7a:4e:3c:94:65:7b:b7:14:00:d4:04:02:eb:60:86: + 29:f7:e2:9c:11:69:d5:3e:ba:9d:36:84:de:89:2c: + 92:70:a2:35:6c:30:18:d1 +exponent2: + 0e:ef:81:3f:55:44:6c:2e:de:70:05:01:89:f7:e5: + 58:4c:89:6f:ea:01:1c:96:d2:8c:91:cb:90:fb:3c: + 56:ff:ca:b3:05:8d:be:f4:70:44:cb:78:2d:d9:ca: + 04:4e:ba:f1:ef:ea:c3:43:0e:2b:a5:0d:00:c6:72: + 90:0f:33:a0:6c:67:dc:b6:f3:84:2c:5e:49:d8:b6: + 76:32:70:71:de:69:b6:45:5e:04:85:92:0d:e6:0f: + 66:0b:57:7b:5d:cd:3d:f1:3b:94:1c:67:4e:55:39: + 6c:05:6b:a6:a7:e6:8f:d1:42:b4:57:2e:ce:f3:7f: + 51:70:87:81:e1:58:65:11 +coefficient: + 04:d6:cf:b0:33:32:27:93:4a:8a:58:4c:97:31:68: + 2b:8c:21:3a:24:3d:2e:8b:80:1f:5b:77:42:73:53: + 73:31:7b:9d:88:0f:ec:28:d5:b6:1f:a8:01:9b:61: + 49:6a:cc:d2:43:67:37:63:54:a0:4a:b9:9e:41:7d: + 7a:2d:a2:d3:be:12:3f:09:43:eb:ec:e5:d2:97:73: + 17:22:0c:0f:d1:e3:2d:d8:a9:82:88:90:a1:75:2e: + 27:67:21:8c:ef:2b:dd:82:ac:89:32:05:a2:a4:a8: + 9f:b2:a3:a3:7a:57:0a:10:13:55:d6:05:94:de:67: + 6d:09:ec:ea:27:36:c1:e3 -----BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAq1yKub7iSaHhG2zxMNqroOhBRbU2HPrt996JpIAb9Bcq1rQ5 -jyo8NvrTGXQexxR49gJffxmRn4e5Ri59E3HPV0Sb4QUMzmjZBbB8FVK9O7Qjy7bT -xblSOoEwI5isd1GjwLIrsy6LopzhLc+vOsKQQsabO+0BfNj7tnQpNUGmojbDJawT -4sL3zTBwB4nM4YML5Yy3MKqTxE9wtu+Qei4mEwoQky+TXoDWhQ3y+8UN3QPtz8b5 -jyiqpbU99/5i/s/IU1bqLI7lz0Y+wmD4yXnCkpSu6wv6dD6euk8PrXBFQ4JWhD4+ -gWMDntP7hUBAstQ9SdouWlvJxMASo6Q6aHs0JQIDAQABAoIBAAH4XunyzWQ+Vbm8 -f2tp4DZJ5VI5WqVrpyfF6bw38tpUF9x/FvhT6nxRVvMAeEgerqNZdKKf9yIn69Po -PezmzpT4x3gHWFXZM8GSfWK7YEya7hxt/jJURqNAj/6gxz7Z8/GHuuPlAZr9hcNC -k4ev6/uwj+FZAL7gOcinvj+MAS/1P2j02JFg1E8OvNEeug+kBh+HdsDZJePf7a1P -8YsCPQLLzv16ZNVDbp1vDrt/ZIPm77DKpY7kWVPPieca/RvUwsOt5Xdt9+Vri0Pp -6Fz5qEX23hYlkW64Tu672EuF6i8Y0FQYQm7DK98t7o0g+qWUineNhOzsQQ1PL/aV -xV53sRMCgYEA1XTYz13TV2VFsaZgYOGU5l3BFtvA0KE0qoQlBVRO64Q4UrGLqBBl -KoOW0MTHgHxpiNO+JyKnQ45LSgI41L6KjUVfSJSm6fEYjgUZ0GJeP5ptRSRU86lb -V5QNhtHjpfl/mn0caWJknOtUeA1YO5MiCreXb+NcZ7POXCp44MVY888CgYEAzYPk -Py1Q5povE11o5Ke8n6baTzIfXIaK35kDq5wttC0Ig4RrPtRjZmcpRmEToal+1+ln -UqpfA325NilzQ5FYOWBNMrmQN98MVQWV4p/WoNNp0Q4CbHL7Ladvj4cM+f9v0aIG -+6zNmg3EkugDRqzMLBWT83wz4fWu3BfAg9rU8csCgYEApsykD4b1+zk7+NJWRd6B -CHMCy+X1ChKuoQCaHUwAT7IGgTgUNcR6CXrCg2kBrLmLjkxILzS5F+U9mBucZUJv -6mznRERFGlI4KeJ6hYgYtgLqmDkH2U/h/NHIsC2bgrswp3xUk1U74hNS8m0bIZKb -61wDjn9QWgj7nLHju2D7XakCgYEAtLBFORaKjnT49rmlw4OGX4e/YOnckOjpqHVL -uNHzjPobBiaic/cf/aStsWcgb34qO4LGiPOp3dPnxyriYIGlY6y7suFbXwQIP6hN -g5asiXHXEyqSDu94z0bq2vIOAq8GjPU71oKzscJxFghO+RBr4kaGcgi9ROlQ98ka -RdNcbckCgYEAuJDL3gwiq6woEqTdyQkyQcbIQC+G7MJkpFLbLmNbpClwWLIr9dDr -a0gquYja3lmquP5RlnRfyspg+aXywELm82GW9Sz4ZUpDTXP8JcO7O0imfmzm8KDK -8jJy8wCbO4NGe0z6FB883HL0IkpqOhy1JkbzZNUmpN47kaBamqb1iec= ------END RSA PRIVATE KEY----- \ No newline at end of file +MIIEogIBAAKCAQEAtJt3yCtGjZOpFo/YEJTs3sF9VuaZfvh7cigTg/CBbkcEGvRi +nJVgOBhI/otnQAnTxeGyViCPVr99Bt6ANf56LyZBNpEjs1hmQ5ZKIj0acAV00I5M +n5orzRVmcomiI2978r+D5s2h1HV37ZiBdD5aRxnW+VXRswRgnvvF6/8r4bu+wJHq +iStzeZOZqVzs9mxqS20eKxG93C2h972Gz/RvJR9BP7nvduDq2JVSkoukYyhtgZ5q +50E42KLgzyAecj6T36qcgciIcYuJTJLZn3paXF16VzRmeuqNKprZYEA4VADTOC2J +tozJIc3Q+y4Kf9zT1hYJzYZxk69Hux/OdPBIKwIDAQABAoIBADxSZMptcc4dkG8h +shevtgGcfIGG2aOn2ItDSWla7c/oVj2ufDUySwXRTqf95Ylk/t9rx4WusFFX+alO +rWHbUfHnhAZ2qYbgMp/GVZJj+C2MFP0HWh5AfvqreCEvSQEu3iYwwxxWeAOfDGRF ++I7buIlg3wU+HaD+CEtxaiStgHmPDLAwNEjweInrP1fhNMtLrbTw8jbGA3ivLh5m +7cD4TdquioFpUx2oREFs/0BPxHs1d8bNbn+0U+ty80NsRzw4NzLRizYVxUGlyRNe +0xdJvHcclO/ZvhZ1f9ZhCCzHCCP0cSOgiksm7ulVbKs+1eWsqgdaduSkXP/K8ifo +Y1RZa0kCgYEA3UAU1TMjyXE+qyj+wzoFCDjht16NCYsmTeAo/6senakjA/CkIvJQ +dmh0IKoXtN9qqjeVVlXpPDqw1X3SFRXGE1Jylvzag2XLXDXN0xyZSo3ufXZSNi6L +fOWH+ZZBcp3dN6TBq8OzmHn/q5Blel9N71UM+pfU2aSA1z5Mu9FWOLcCgYEA0Pk7 +nmpz8jA9JuIifECsR88f8VJ5eVQeyq0m2M1aaSlpTu81XsfF6le37b5oZQqr3n1O +OEios3EPZygwc4amkLnW9hjvVljkk0sAmKTDPc5Z44eO3B/XFvYDuOF6ItSHT0ZC +UHMt1yXOqSVdknLXGnFhlyrNZchgdgtrePEKMC0CgYBiR+z5J9ZlzWBBN9yzbDqA +BIR/qAiOjLlfLowHxkO7VT6wqVzACVOkxZGQUP5m4jfHlRlJWLBaiNe0fkesBhgO +zTkJyRhn9ff35g6gELwnWhTutnieiN59hJh6TjyUZXu3FADUBALrYIYp9+KcEWnV +PrqdNoTeiSyScKI1bDAY0QKBgA7vgT9VRGwu3nAFAYn35VhMiW/qARyW0oyRy5D7 +PFb/yrMFjb70cETLeC3ZygROuvHv6sNDDiulDQDGcpAPM6BsZ9y284QsXknYtnYy +cHHeabZFXgSFkg3mD2YLV3tdzT3xO5QcZ05VOWwFa6an5o/RQrRXLs7zf1Fwh4Hh +WGURAoGABNbPsDMyJ5NKilhMlzFoK4whOiQ9LouAH1t3QnNTczF7nYgP7CjVth+o +AZthSWrM0kNnN2NUoEq5nkF9ei2i074SPwlD6+zl0pdzFyIMD9HjLdipgoiQoXUu +J2chjO8r3YKsiTIFoqSon7Kjo3pXChATVdYFlN5nbQns6ic2weM= +-----END RSA PRIVATE KEY----- diff --git a/src/main/resources/files/publicKey.pem.tpl b/src/main/resources/files/publicKey.pem.tpl old mode 100755 new mode 100644 index 30f8ab99..0acf2ac5 --- a/src/main/resources/files/publicKey.pem.tpl +++ b/src/main/resources/files/publicKey.pem.tpl @@ -1,9 +1,9 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq1yKub7iSaHhG2zxMNqr -oOhBRbU2HPrt996JpIAb9Bcq1rQ5jyo8NvrTGXQexxR49gJffxmRn4e5Ri59E3HP -V0Sb4QUMzmjZBbB8FVK9O7Qjy7bTxblSOoEwI5isd1GjwLIrsy6LopzhLc+vOsKQ -QsabO+0BfNj7tnQpNUGmojbDJawT4sL3zTBwB4nM4YML5Yy3MKqTxE9wtu+Qei4m -EwoQky+TXoDWhQ3y+8UN3QPtz8b5jyiqpbU99/5i/s/IU1bqLI7lz0Y+wmD4yXnC -kpSu6wv6dD6euk8PrXBFQ4JWhD4+gWMDntP7hUBAstQ9SdouWlvJxMASo6Q6aHs0 -JQIDAQAB ------END PUBLIC KEY----- \ No newline at end of file +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtJt3yCtGjZOpFo/YEJTs +3sF9VuaZfvh7cigTg/CBbkcEGvRinJVgOBhI/otnQAnTxeGyViCPVr99Bt6ANf56 +LyZBNpEjs1hmQ5ZKIj0acAV00I5Mn5orzRVmcomiI2978r+D5s2h1HV37ZiBdD5a +RxnW+VXRswRgnvvF6/8r4bu+wJHqiStzeZOZqVzs9mxqS20eKxG93C2h972Gz/Rv +JR9BP7nvduDq2JVSkoukYyhtgZ5q50E42KLgzyAecj6T36qcgciIcYuJTJLZn3pa +XF16VzRmeuqNKprZYEA4VADTOC2JtozJIc3Q+y4Kf9zT1hYJzYZxk69Hux/OdPBI +KwIDAQAB +-----END PUBLIC KEY----- diff --git a/src/main/temp/privateKey.pem b/src/main/temp/privateKey.pem deleted file mode 100755 index 1ebcef3b..00000000 --- a/src/main/temp/privateKey.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWK8UjyoHgPTLa -PLQJ8SoXLLjpHSjtLxMqmzHnFscqhTVVaDpCRCb6e3Ii/WniQTWw8RA7vf4djz4H -OzvlfBFNgvUGZHXDwnmGaNVaNzpHYFMEYBhE8VGGiveSkzqeLZI+Y02G6sQAfDtN -qqzM/l5QX8X34oQFaTBW1r49nftvCpITiwJvWyhkWtXP9RP8sXi1im5Vi3dhupOh -nelk5n0BfajUYIbfHA6ORzjHRbt7NtBl0L2J+0/FUdHyKs6KMlFGNw8O0Dq88qnM -uXoLJiewhg9332W3DFMeOveel+//cvDnRsCRtPgd4sXFPHh+UShkso7+DRsChXa6 -oGGQD3GdAgMBAAECggEAAjfTSZwMHwvIXIDZB+yP+pemg4ryt84iMlbofclQV8hv -6TsI4UGwcbKxFOM5VSYxbNOisb80qasb929gixsyBjsQ8284bhPJR7r0q8h1C+jY -URA6S4pk8d/LmFakXwG9Tz6YPo3pJziuh48lzkFTk0xW2Dp4SLwtAptZY/+ZXyJ6 -96QXDrZKSSM99Jh9s7a0ST66WoxSS0UC51ak+Keb0KJ1jz4bIJ2C3r4rYlSu4hHB -Y73GfkWORtQuyUDa9yDOem0/z0nr6pp+pBSXPLHADsqvZiIhxD/O0Xk5I6/zVHB3 -zuoQqLERk0WvA8FXz2o8AYwcQRY2g30eX9kU4uDQAQKBgQDmf7KGImUGitsEPepF -KH5yLWYWqghHx6wfV+fdbBxoqn9WlwcQ7JbynIiVx8MX8/1lLCCe8v41ypu/eLtP -iY1ev2IKdrUStvYRSsFigRkuPHUo1ajsGHQd+ucTDf58mn7kRLW1JGMeGxo/t32B -m96Af6AiPWPEJuVfgGV0iwg+HQKBgQCmyPzL9M2rhYZn1AozRUguvlpmJHU2DpqS -34Q+7x2Ghf7MgBUhqE0t3FAOxEC7IYBwHmeYOvFR8ZkVRKNF4gbnF9RtLdz0DMEG -5qsMnvJUSQbNB1yVjUCnDAtElqiFRlQ/k0LgYkjKDY7LfciZl9uJRl0OSYeX/qG2 -tRW09tOpgQKBgBSGkpM3RN/MRayfBtmZvYjVWh3yjkI2GbHA1jj1g6IebLB9SnfL -WbXJErCj1U+wvoPf5hfBc7m+jRgD3Eo86YXibQyZfY5pFIh9q7Ll5CQl5hj4zc4Y -b16sFR+xQ1Q9Pcd+BuBWmSz5JOE/qcF869dthgkGhnfVLt/OQzqZluZRAoGAXQ09 -nT0TkmKIvlza5Af/YbTqEpq8mlBDhTYXPlWCD4+qvMWpBII1rSSBtftgcgca9XLB -MXmRMbqtQeRtg4u7dishZVh1MeP7vbHsNLppUQT9Ol6lFPsd2xUpJDc6BkFat62d -Xjr3iWNPC9E9nhPPdCNBv7reX7q81obpeXFMXgECgYEAmk2Qlus3OV0tfoNRqNpe -Mb0teduf2+h3xaI1XDIzPVtZF35ELY/RkAHlmWRT4PCdR0zXDidE67L6XdJyecSt -FdOUH8z5qUraVVebRFvJqf/oGsXc4+ex1ZKUTbY0wqY1y9E39yvB3MaTmZFuuqk8 -f3cg+fr8aou7pr9SHhJlZCU= ------END RSA PRIVATE KEY----- \ No newline at end of file