From f55fbb6bd58cc04ce8b32dbebf9f6d97cc5bdfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Kubi=C5=9B?= Date: Thu, 22 Sep 2016 13:42:30 +0200 Subject: [PATCH] sonar fix --- .../components/slingJsHandler/dialog.xml | 38 ------------------- .../slingJspScriptHandler/dialog.xml | 38 ------------------- .../crx-development-bundles/.content.xml | 1 - .../replication-transport-users/.content.xml | 3 +- .../sling-development-bundle/.content.xml | 1 - .../secureaem/sling-js-handler/.content.xml | 4 +- .../sling-jsp-script-handler/.content.xml | 6 +-- .../sling-referrer-filter/.content.xml | 3 +- .../com/cognifide/secureaem/cli/Main.java | 6 ++- .../tests/SlingJspScriptHandlerTest.java | 6 +-- 10 files changed, 10 insertions(+), 96 deletions(-) delete mode 100644 src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJsHandler/dialog.xml delete mode 100644 src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJspScriptHandler/dialog.xml diff --git a/src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJsHandler/dialog.xml b/src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJsHandler/dialog.xml deleted file mode 100644 index d70af25..0000000 --- a/src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJsHandler/dialog.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJspScriptHandler/dialog.xml b/src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJspScriptHandler/dialog.xml deleted file mode 100644 index d70af25..0000000 --- a/src/main/aem/jcr_root/apps/cognifide/secureaem/components/slingJspScriptHandler/dialog.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/main/aem/jcr_root/etc/secureaem/crx-development-bundles/.content.xml b/src/main/aem/jcr_root/etc/secureaem/crx-development-bundles/.content.xml index 306b7a3..8f7b033 100644 --- a/src/main/aem/jcr_root/etc/secureaem/crx-development-bundles/.content.xml +++ b/src/main/aem/jcr_root/etc/secureaem/crx-development-bundles/.content.xml @@ -13,7 +13,6 @@ jcr:primaryType="nt:unstructured" sling:resourceType="cognifide/secureaem/components/crxDevelopmentBundles" enabled="true" - users="[admin:admin]" bundles="[Adobe CRXDE Support,Adobe Granite CRX Explorer,Adobe Granite CRXDE Lite]"/> diff --git a/src/main/aem/jcr_root/etc/secureaem/replication-transport-users/.content.xml b/src/main/aem/jcr_root/etc/secureaem/replication-transport-users/.content.xml index b4caf60..95a9b07 100644 --- a/src/main/aem/jcr_root/etc/secureaem/replication-transport-users/.content.xml +++ b/src/main/aem/jcr_root/etc/secureaem/replication-transport-users/.content.xml @@ -12,7 +12,6 @@ + enabled="true"/> diff --git a/src/main/aem/jcr_root/etc/secureaem/sling-development-bundle/.content.xml b/src/main/aem/jcr_root/etc/secureaem/sling-development-bundle/.content.xml index 644b8e8..ec23df1 100644 --- a/src/main/aem/jcr_root/etc/secureaem/sling-development-bundle/.content.xml +++ b/src/main/aem/jcr_root/etc/secureaem/sling-development-bundle/.content.xml @@ -13,7 +13,6 @@ jcr:primaryType="nt:unstructured" sling:resourceType="cognifide/secureaem/components/slingDevelopmentBundle" enabled="true" - users="[admin:admin]" bundles="[Apache Sling Tooling]"/> diff --git a/src/main/aem/jcr_root/etc/secureaem/sling-js-handler/.content.xml b/src/main/aem/jcr_root/etc/secureaem/sling-js-handler/.content.xml index 8b938f9..24fbee2 100644 --- a/src/main/aem/jcr_root/etc/secureaem/sling-js-handler/.content.xml +++ b/src/main/aem/jcr_root/etc/secureaem/sling-js-handler/.content.xml @@ -12,8 +12,6 @@ + enabled="true"/> diff --git a/src/main/aem/jcr_root/etc/secureaem/sling-jsp-script-handler/.content.xml b/src/main/aem/jcr_root/etc/secureaem/sling-jsp-script-handler/.content.xml index 636747f..9954997 100644 --- a/src/main/aem/jcr_root/etc/secureaem/sling-jsp-script-handler/.content.xml +++ b/src/main/aem/jcr_root/etc/secureaem/sling-jsp-script-handler/.content.xml @@ -11,9 +11,7 @@ urlDesc="Official AEM Security Checklist"> + sling:resourceType="cognifide/secureaem/components/slingJspScriptHandler" + enabled="true"/> diff --git a/src/main/aem/jcr_root/etc/secureaem/sling-referrer-filter/.content.xml b/src/main/aem/jcr_root/etc/secureaem/sling-referrer-filter/.content.xml index 8e1035a..3485435 100644 --- a/src/main/aem/jcr_root/etc/secureaem/sling-referrer-filter/.content.xml +++ b/src/main/aem/jcr_root/etc/secureaem/sling-referrer-filter/.content.xml @@ -12,7 +12,6 @@ + enabled="true"/> diff --git a/src/main/java/com/cognifide/secureaem/cli/Main.java b/src/main/java/com/cognifide/secureaem/cli/Main.java index aff4ff6..9cb820b 100644 --- a/src/main/java/com/cognifide/secureaem/cli/Main.java +++ b/src/main/java/com/cognifide/secureaem/cli/Main.java @@ -8,8 +8,8 @@ import org.apache.commons.lang3.StringUtils; import java.io.BufferedReader; +import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -58,7 +58,9 @@ private static List createTestLoaders(CommandLine cmdLine) throws IO private static BufferedReader getBufferedReader(CommandLine cmdLine) throws FileNotFoundException { BufferedReader reader; if (cmdLine.hasOption("suite")) { - reader = new BufferedReader(new FileReader(cmdLine.getOptionValue("suite"))); + reader = new BufferedReader( + new InputStreamReader(new FileInputStream(cmdLine.getOptionValue("suite")), + StandardCharsets.UTF_8)); } else { InputStream is = Main.class.getClass().getResourceAsStream(DEFAULT_TEST_SUITE_PATH); reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)); diff --git a/src/main/java/com/cognifide/secureaem/tests/SlingJspScriptHandlerTest.java b/src/main/java/com/cognifide/secureaem/tests/SlingJspScriptHandlerTest.java index 7287dfc..990bc73 100644 --- a/src/main/java/com/cognifide/secureaem/tests/SlingJspScriptHandlerTest.java +++ b/src/main/java/com/cognifide/secureaem/tests/SlingJspScriptHandlerTest.java @@ -2,7 +2,6 @@ import com.cognifide.secureaem.AbstractTest; import com.cognifide.secureaem.Configuration; -import com.cognifide.secureaem.UserHelper; import com.cognifide.secureaem.markers.AuthorTest; import com.cognifide.secureaem.markers.PublishTest; @@ -14,11 +13,8 @@ public SlingJspScriptHandlerTest(Configuration config) { } @Override public boolean doTest(String url, String instanceName) throws Exception { - String[] user = AuthorTest.ENVIRONMENT_NAME.equals(instanceName) ? - UserHelper.splitUser(config.getStringValue("authorUser", "admin:admin")) : - UserHelper.splitUser(config.getStringValue("publishUser", "admin:admin")); String configurationEndpoint = url - + "/system/console/configMgr/com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.json"; + + "/system/console/configMgr/org.apache.sling.scripting.jsp.JspScriptEngineFactory.json"; String body = getJsonBodyOfOsgiConfiguration(configurationEndpoint, getUsernamePasswordCredentials(instanceName), instanceName); checkBooleanValue(getBooleanValueFromJson("jasper.classdebuginfo", body), false, "Generate Debug Info", instanceName);