Skip to content

Commit

Permalink
to fortress 2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnmckinney committed Jul 17, 2022
1 parent 4985099 commit c9d538b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Prerequisites for target environment
1. Debian or Redhat Liunx variant machine with OpenSSL installed.
2. Java >= 8
2. Java >= 11
3. Apache Maven >= 3
4. Apache Tomcat >= 8
5. Firefox Web Browser
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.iamfortress</groupId>
<artifactId>apache-fortress-demo</artifactId>
<version>2.0.7</version>
<version>2.0.8</version>
<packaging>war</packaging>
<name>Apache Fortress Demo</name>
<description>Sample Web App demonstrating end-to-end security using Apache Fortress, Wicket, Mybatis Data Persistence Frameworks.</description>
Expand Down Expand Up @@ -37,7 +37,7 @@
</developers>

<properties>
<fortress.version>2.0.6</fortress.version>
<fortress.version>2.0.8</fortress.version>
<spring.version>5.3.8</spring.version>
<version.junit>4.13.1</version.junit>
<javadoc.version>2.9.1</javadoc.version>
Expand Down Expand Up @@ -88,14 +88,14 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
<version>4.1.1</version>
<scope>test</scope>
</dependency>
<!-- Use [WebDriverManager](https://github.com/bonigarcia/webdrivermanager#webdrivermanager-as-java-dependency) for running tests -->
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.0.0</version>
<version>5.1.1</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -174,8 +174,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>11</source>
<target>11</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
Expand Down
29 changes: 14 additions & 15 deletions src/main/java/com/mycompany/WicketApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@

import org.apache.directory.fortress.web.control.WicketSession;
import org.apache.wicket.Session;
import org.apache.wicket.core.request.handler.PageProvider;
import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
import org.apache.wicket.csp.CSPDirective;
import org.apache.wicket.csp.CSPDirectiveSrcValue;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
import org.apache.wicket.request.cycle.AbstractRequestCycleListener;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.settings.ExceptionSettings;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

/**
Expand Down Expand Up @@ -49,16 +47,17 @@ public void init()
// add your configuration here
getComponentInstantiationListeners().add(new SpringComponentInjector(this));

// Catch runtime exceptions this way:
getRequestCycleListeners().add( new AbstractRequestCycleListener()
{
@Override
public IRequestHandler onException( RequestCycle cycle, Exception e )
{
return new RenderPageRequestHandler( new PageProvider( new ErrorPage( e ) ) );
}
} );
// Route runtime exceptions to fortress error page:
getApplicationSettings().setInternalErrorPage( ErrorPage.class );
// show internal error page rather than default developer page
getExceptionSettings().setUnexpectedExceptionDisplay(ExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);

getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setStripWicketTags(true);
getCspSettings().blocking().clear()
.add(CSPDirective.STYLE_SRC, CSPDirectiveSrcValue.SELF)
.add(CSPDirective.STYLE_SRC, CSPDirectiveSrcValue.UNSAFE_INLINE)
.add(CSPDirective.SCRIPT_SRC, CSPDirectiveSrcValue.SELF)
.add(CSPDirective.SCRIPT_SRC, CSPDirectiveSrcValue.UNSAFE_EVAL)
.add(CSPDirective.SCRIPT_SRC, CSPDirectiveSrcValue.UNSAFE_INLINE);
}
}

0 comments on commit c9d538b

Please sign in to comment.