Skip to content

Commit

Permalink
Merge branch 'master' into feature/new-ws
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jan 31, 2020
2 parents 2f921a8 + 99098ed commit 4381539
Show file tree
Hide file tree
Showing 27 changed files with 381 additions and 327 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Expand Up @@ -97,7 +97,7 @@ ij_java_call_parameters_right_paren_on_new_line = false
ij_java_call_parameters_wrap = off
ij_java_case_statement_on_separate_line = true
ij_java_catch_on_new_line = false
ij_java_class_annotation_wrap = off
ij_java_class_annotation_wrap = split_into_lines
ij_java_class_brace_style = end_of_line
ij_java_class_count_to_use_import_on_demand = 5
ij_java_class_names_in_javadoc = 1
Expand Down Expand Up @@ -168,7 +168,7 @@ ij_java_line_comment_add_space = false
ij_java_line_comment_at_first_column = true
ij_java_message_dd_suffix = EJB
ij_java_message_eb_suffix = Bean
ij_java_method_annotation_wrap = off
ij_java_method_annotation_wrap = split_into_lines
ij_java_method_brace_style = end_of_line
ij_java_method_call_chain_wrap = off
ij_java_method_parameters_new_line_after_left_paren = false
Expand Down
33 changes: 15 additions & 18 deletions custom/pom.xml
Expand Up @@ -26,30 +26,27 @@
-->
</modules>

<dependencies>
<!-- Required for surefire plugin not to complain -->
<dependency>
<groupId>com.evolveum.midpoint.tools</groupId>
<artifactId>test-ng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- reference failsafe and surefire from build-system plugin management in order for tests to be running -->
<!-- reference failsafe to run integration tests (surefire/units run by default) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies> <!-- Not used, but required for surefire plugin not to complain -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.tools</groupId>
<artifactId>test-ng</artifactId>
<version>4.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
60 changes: 21 additions & 39 deletions dist/javadoc/pom.xml
Expand Up @@ -26,10 +26,11 @@
The packaging for this project did not assign a file to the build artifact
-->
<maven.install.skip>true</maven.install.skip>
<maven.test.skip>true</maven.test.skip>
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>com.evolveum.midpoint.gui</groupId>
<artifactId>admin-gui</artifactId>
<version>4.1-SNAPSHOT</version>
Expand All @@ -45,7 +46,7 @@
<artifactId>tomcat-annotations-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<dependency>
<groupId>com.evolveum.midpoint.model</groupId>
<artifactId>model-impl</artifactId>
<version>4.1-SNAPSHOT</version>
Expand All @@ -54,25 +55,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<!-- Default (main) jar is empty. We do not want to build it. -->
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<!-- Test jar is empty. We do not want to build it. -->
<id>test-jar</id>
<phase>none</phase>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
Expand All @@ -84,7 +66,7 @@
<isOffline>true</isOffline>
<doctitle>midPoint Aggregate JavaDoc</doctitle>
<windowtitle>midPoint Aggregate JavaDoc</windowtitle>
<doclint>none</doclint>
<doclint>none</doclint>
<quiet>true</quiet>
<debug>false</debug>
</configuration>
Expand Down Expand Up @@ -128,26 +110,26 @@
<profile>
<id>java8</id>
<activation>
<jdk>(,1.8]</jdk>
<jdk>(,1.8]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
83 changes: 29 additions & 54 deletions dist/midpoint-api/pom.xml
Expand Up @@ -21,8 +21,12 @@

<name>midPoint API Distribution</name>

<properties>
<maven.test.skip>true</maven.test.skip>
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>com.evolveum.midpoint.model</groupId>
<artifactId>model-api</artifactId>
<version>4.1-SNAPSHOT</version>
Expand Down Expand Up @@ -57,7 +61,6 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- <finalName>midpoint-${version}</finalName> -->
</configuration>
<executions>
<execution>
Expand All @@ -69,22 +72,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<!-- Default (main) jar is empty. We do not want to build it. -->
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<!-- Test jar is empty. We do not want to build it. -->
<id>test-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
Expand All @@ -106,18 +93,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
Expand All @@ -131,33 +106,33 @@
<profile>
<id>java8</id>
<activation>
<jdk>[1.8,)</jdk>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includeDependencySources>true</includeDependencySources>
<dependencySourceIncludes>
<dependencySourceInclude>com.evolveum.*:*</dependencySourceInclude>
</dependencySourceIncludes>
<quiet>false</quiet>
<debug>false</debug>
<doclint>none</doclint>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includeDependencySources>true</includeDependencySources>
<dependencySourceIncludes>
<dependencySourceInclude>com.evolveum.*:*</dependencySourceInclude>
</dependencySourceIncludes>
<quiet>false</quiet>
<debug>false</debug>
<doclint>none</doclint>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Expand Up @@ -38,39 +38,26 @@
/**
* Created by Viliam Repan (lazyman).
*/
public class MidPointAccessDeniedHandler<SecurityHelper> implements AccessDeniedHandler {

private AccessDeniedHandler defaultHandler = new AccessDeniedHandlerImpl();
public class AuditedAccessDeniedHandler<SecurityHelper> extends MidpointAccessDeniedHandler {

@Autowired
private TaskManager taskManager;
@Autowired
private AuditService auditService;

@Override
public void handle(HttpServletRequest request, HttpServletResponse response,
protected boolean handleInternal(HttpServletRequest request, HttpServletResponse response,
AccessDeniedException accessDeniedException) throws IOException, ServletException {
if (response.isCommitted()) {
return;
}

if (accessDeniedException instanceof CsrfException) {
// handle invalid csrf token exception gracefully when user tries to log in/out with expired exception
// handle session timeout for ajax cases -> redirect to base context (login)
if (WicketRedirectStrategy.isWicketAjaxRequest(request)) {
WicketRedirectStrategy redirect = new WicketRedirectStrategy();
redirect.sendRedirect(request, response, request.getContextPath());
} else {
response.sendRedirect(request.getContextPath());
}

return;
boolean ended = super.handleInternal(request, response, accessDeniedException);
if (ended) {
return ended;
}

Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
auditEvent(request, authentication, accessDeniedException);

defaultHandler.handle(request, response, accessDeniedException);
return false;
}

private void auditEvent(HttpServletRequest request, Authentication authentication, AccessDeniedException accessDeniedException) {
Expand Down
Expand Up @@ -126,8 +126,8 @@ public AuditedLogoutHandler logoutHandler() {
}

@Bean
public MidPointAccessDeniedHandler accessDeniedHandler() {
return objectObjectPostProcessor.postProcess(new MidPointAccessDeniedHandler());
public AuditedAccessDeniedHandler accessDeniedHandler() {
return objectObjectPostProcessor.postProcess(new AuditedAccessDeniedHandler());
}

@Profile("!cas")
Expand Down

0 comments on commit 4381539

Please sign in to comment.