WW-5075.
- Draws on PR#427 and utilizes similar code, but updated for JDK8.
- Updated OSGi plugin dependencies to OSGi R7.
- Indication is that the OSGi Plugin has been failing since Struts 2.3.4.
- Applied fix to ResourceFinder to restore 2.3.x logic that was broken in
2.5.x.
- Implemented changes to restore OSGi Plugin functionality for 2.6.x.
- Applied changes to the OSGi Admin Bundle to function under 2.6.x.
- Applied changes to the OSGi Demo Bundle to function under 2.6.x.
- Updated the OSGi Admin Bundle JS libraries and related CSS to newer
versions.
- Added new unit tests for the OSGi plugin.
- The OSGi plugin will only function properly with exploded/expanded WAR
files.
- BundlePackageLoader changes suggested by L. Lenart (from PR#427).
- FelixOsgiHost changes to better handle Felix bundle cache location
processing (Windows and Linux).
- FelixOsgIHost test modified to not fail if felix-cache directory
cannot be created (warn only) to avoid failing the whole build.
- FelixOsgIHost test modified to not fail if felix-cache directory
bundle load issues arise (warn only) to avoid failing the whole build.
Support for CSP in Struts 2:
- Implements a CSP Interceptor that adds a nonce-based, strict-dynamic policy to HTTP responses.
- Implements custom JSP and FTL <script> tags that add nonces to script blocks automatically. This makes these tags compatible with CSP with minimal refactoring.
- Implements an extensible action that can be used to collect CSP reports out of the box. This behaviour is extensible, so developers can customise the processing of CSP reports.
Co-authored-by: Ecenaz Jen Ozmen <eo2419@columbia.edu>
Co-authored-by: Giannis Chatziveroglou <giannisc@google.com>
Co-authored-by: Sal <salchoman@gmail.com>
- Correction/fix for test within testMockPortletSession(), following
recent changes.
- Fix TestMockMultipartFile.isEmpty() bug in both original logic and recent
changes.
- Exclude ASM 3.3.1 from inclusion as a dependency for commons-digester3
(also mark commons-digester3 as optional dependency since it is only
listed to allow the exclusion).
- Provide explicit test dependency of ASM 3.3.1 for portlet-plugin
(otherwise its jmock tests are unable to execute).
read: "copies one interface from
org.springframework.mock.web.portlet.multipart" (not
"org.apache.struts2.mock.web.portlet" which was incorrect).
Refactor (rename) junit-portlet plugin to portlet-mocks plugin.
- Moved StrutsPortletTestCase from the portlet plugin into the junit plugin
(same package name).
- Added optional dependencies to the junit plugin for the portlet plugin
and mocks plugin.
- Duplicated StrutsTestCase from the junit plugin with a new name
StrutsTestCasePortletTests that exists within a test scope only.
This was done to eliminate a dendency cycle between junit and portlet
plugins during refactoring.
- Updated the portlet plugin unit tests to use StrutsTestCasePortletTests
internally instead of StrutsTestCase from the junit plugin.
- Removed junit plugin dependency for portlets plugin, added test scope
dependency for portlet-mocks plugin.
- Made StrutsSpringPortletMockObjectsTest depend only on TestCase.
- Removed unneeded dependencies from portlet-mocks pom.
Amended commit multiple times: Missed plugins pom.xml change, forgot to
drop StrutsPortletTestCase from portlet plugin (local repository).
MockServletContext has a dependency on javax.activation that causes a
java.lang.NoClassDefFoundError.
- Test updated to allow the single call that triggers this in JDK9+
to continue as long as the class not found is FileTypeMap (expected).
Introduce new junit-portlet plugin.
- Utilizes a copy of org.springframework.mock.web.portlet package from
Spring 4.3.x, refactored to org.apache.struts2.mock.web.portlet. Also
copies one interface from org.apache.struts2.mock.web.portlet. The
package-info.java files identify the package renaming.
- Provides test cases for the mock objects.
- Modifies the portlet plugin to use the junit-portlet plugin as a
dependency. Adds a small boundary case fix for PortletRequestMap.