You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2023/08/15 07:28:37 UTC
[sling-org-apache-sling-testing-sling-mock] branch feature/SLING-12002-esapi-discard-stdout created (now 0bed1fd)
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a change to branch feature/SLING-12002-esapi-discard-stdout
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git
at 0bed1fd SLING-12002 Discard "special logging" to stdout from ESAPI
This branch includes the following new commits:
new 0bed1fd SLING-12002 Discard "special logging" to stdout from ESAPI
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[sling-org-apache-sling-testing-sling-mock] 01/01: SLING-12002 Discard "special logging" to stdout from ESAPI
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-12002-esapi-discard-stdout
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git
commit 0bed1fd0dd0862ed348bef0e514ae9d92213f390
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Aug 15 09:28:23 2023 +0200
SLING-12002 Discard "special logging" to stdout from ESAPI
---
.../org/apache/sling/testing/mock/sling/context/SlingContextImpl.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/core/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/core/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index 91a7b2e..ad2fb0d 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -191,7 +191,11 @@ public class SlingContextImpl extends OsgiContextImpl {
SERVICE_PROPERTY_MOCK_SLING_BINDINGS_IGNORE, true);
registerInjectActivateService(new MockResourceBundleProvider());
registerInjectActivateService(MockXSSFilter.class);
+
+ // ugly hack: prevent default console logging from ESAPI on each initialization by setting system property
+ System.setProperty("org.owasp.esapi.logSpecial.discard", "true");
registerInjectActivateService(XSSAPIImpl.class);
+
registerInjectActivateService(new FeatureManager());
// scan for models defined via bundle headers in classpath