Skip to content

Commit

Permalink
Merge pull request #41 from swedenconnect/feature/IS-39-spring-boot-3
Browse files Browse the repository at this point in the history
Feature/is 39 spring boot 3
  • Loading branch information
martin-lindstrom authored Oct 2, 2023
2 parents 8410cdf + 1288886 commit 8b8ecb3
Show file tree
Hide file tree
Showing 71 changed files with 482 additions and 1,242 deletions.
2 changes: 1 addition & 1 deletion autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<version>1.1.5</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Spring Boot Autoconfigure module</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@

import java.util.Map;

import javax.servlet.ServletException;

import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.web.context.request.WebRequest;

import jakarta.servlet.ServletException;
import se.swedenconnect.spring.saml.idp.error.UnrecoverableSaml2IdpError;
import se.swedenconnect.spring.saml.idp.error.UnrecoverableSaml2IdpException;

Expand All @@ -37,11 +36,11 @@
* <li>{@value #IDP_ERROR_DESCRIPTION} - The textual description ({@link UnrecoverableSaml2IdpError#getDescription()}).
* Should be the fallback text if the above does not render a text.</li>
* </ul>
*
*
* @author Martin Lindström
*/
public class Saml2IdpErrorAttributes extends DefaultErrorAttributes {

public static final String IDP_ERROR_CODE = "idpErrorCode";
public static final String IDP_ERROR_MESSAGE_CODE = "idpErrorMessageCode";
public static final String IDP_ERROR_DESCRIPTION = "idpErrorDescription";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package se.swedenconnect.spring.saml.idp.autoconfigure.error;

import javax.servlet.Servlet;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
Expand All @@ -38,17 +36,19 @@
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.DispatcherServlet;

import jakarta.servlet.Servlet;

/**
* IdP specific {@link EnableAutoConfiguration Auto-configuration} to render errors via an MVC error controller.
*
*
* @author Martin Lindström
*/
@AutoConfiguration(before = { WebMvcAutoConfiguration.class, ErrorMvcAutoConfiguration.class })
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class })
@EnableConfigurationProperties({ ServerProperties.class, WebMvcProperties.class })
public class Saml2IdpErrorAutoConfiguration {

/**
* Path of the IdP error view name.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import java.nio.charset.StandardCharsets;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders;
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver;
Expand All @@ -33,12 +30,14 @@
import org.springframework.web.servlet.View;
import org.springframework.web.util.HtmlUtils;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import se.swedenconnect.spring.saml.idp.error.UnrecoverableSaml2IdpException;

/**
* A SAML error view resolver for handling {@link UnrecoverableSaml2IdpException}.
*
*
* @author Martin Lindström
*/
public class Saml2IdpErrorViewResolver implements ErrorViewResolver, Ordered {
Expand All @@ -53,7 +52,7 @@ public class Saml2IdpErrorViewResolver implements ErrorViewResolver, Ordered {

/**
* Constructor.
*
*
* @param applicationContext the application context
*/
public Saml2IdpErrorViewResolver(final ApplicationContext applicationContext) {
Expand All @@ -70,7 +69,7 @@ public int getOrder() {

/**
* Assigns the order for this bean.
*
*
* @param order the order
*/
public void setOrder(final int order) {
Expand All @@ -79,7 +78,7 @@ public void setOrder(final int order) {

/**
* Assigns the view name for IdP errors. The default is {@code error/idp}.
*
*
* @param idpErrorViewName the view name
*/
public void setIdpErrorViewName(final String idpErrorViewName) {
Expand Down
123 changes: 38 additions & 85 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<packaging>pom</packaging>
<version>1.1.5</version>
<version>2.0.0-SNAPSHOT</version>

<name>Sweden Connect :: Spring SAML Identity Provider :: Parent POM</name>
<description>Parent POM for Spring SAML Identity Provider libraries</description>
Expand Down Expand Up @@ -44,8 +44,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>

<spring.boot.version>2.7.15</spring.boot.version>
<spring.version>5.3.29</spring.version>
<spring.boot.version>3.1.4</spring.boot.version>
<spring.version>6.0.12</spring.version>
<bc.version>1.76</bc.version>
</properties>

Expand Down Expand Up @@ -100,45 +100,20 @@
<scope>import</scope>
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
<version>1.10.1</version>
</dependency>

<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<type>pom</type>
<version>5.9.1</version>
<version>5.10.0</version>
<scope>import</scope>
</dependency>

<dependency>
<groupId>se.swedenconnect.security</groupId>
<artifactId>credentials-support</artifactId>
<version>1.2.6</version>
</dependency>

<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>2.3.3</version>
<exclusions>
<!-- Version included has reported vulnerabilities -->
<exclusion>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
</exclusion>
</exclusions>
<version>1.3.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>6.5.1</version>
</dependency>


<!-- Bouncy Castle -->
<dependency>
<groupId>org.bouncycastle</groupId>
Expand All @@ -158,40 +133,23 @@
<version>${bc.version}</version>
</dependency>

<dependency>
<groupId>org.cryptacular</groupId>
<artifactId>cryptacular</artifactId>
<version>1.2.5</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- OpenSAML -->
<dependency>
<groupId>se.swedenconnect.opensaml</groupId>
<artifactId>opensaml-addons</artifactId>
<version>1.2.8</version>
<version>2.0.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>se.swedenconnect.opensaml</groupId>
<artifactId>opensaml-swedish-eid</artifactId>
<version>1.2.6</version>
<exclusions>
<exclusion>
<groupId>se.swedenconnect.opensaml</groupId>
<artifactId>opensaml-addons</artifactId>
</exclusion>
</exclusions>
<version>2.0.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>se.litsec.eidas</groupId>
<artifactId>eidas-opensaml4</artifactId>
<version>2.1.2</version>
<groupId>se.swedenconnect.opensaml</groupId>
<artifactId>opensaml-eidas</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>

<dependency>
Expand All @@ -206,15 +164,11 @@
</dependencyManagement>

<dependencies>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Logging -->
Expand Down Expand Up @@ -259,47 +213,52 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.5</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.6.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
</plugin>

<plugin>
Expand All @@ -311,19 +270,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>4.0.0-M8</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.10</version>
<configuration>
<excludes>
<!-- Ignore coverage for exception classes -->
Expand All @@ -349,7 +302,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce</id>
Expand Down Expand Up @@ -396,14 +349,14 @@
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<doclint>all,-missing</doclint>
<additionalOptions>-Xdoclint:all -Xdoclint:-missing</additionalOptions>
<additionalJOptions>
<additionalJOption>-Xdoclint:all</additionalJOption>
<additionalJOption>-Xdoclint:-missing</additionalJOption>
</additionalJOptions>
<links>
<link>https://docs.spring.io/spring-framework/docs/current/javadoc-api/</link>
<link>https://docs.swedenconnect.se/credentials-support/apidoc/</link>
<link>https://build.shibboleth.net/nexus/content/sites/site/java-opensaml/5.0.0/apidocs/</link>
<link>https://build.shibboleth.net/nexus/content/sites/site/java-shib-shared/9.0.0/apidocs/</link>
<link>https://docs.swedenconnect.se/opensaml-security-ext/javadoc/latest/</link>
<link>https://docs.swedenconnect.se/opensaml-addons/apidoc/</link>
<link>https://docs.swedenconnect.se/opensaml-eidas/apidocs/</link>
</links>
<detectJavaApiLink>true</detectJavaApiLink>
</configuration>
Expand Down
Loading

0 comments on commit 8b8ecb3

Please sign in to comment.