Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/org.apache.maven.surefire…
Browse files Browse the repository at this point in the history
…-surefire-junit4-3.3.1
  • Loading branch information
dtrouillet authored Jul 31, 2024
2 parents d288f3a + 7b13f47 commit fc40633
Show file tree
Hide file tree
Showing 92 changed files with 805 additions and 613 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [15, 16, 17 ]
java: [ 17, 19 ]
steps:
- uses: actions/checkout@v1
- name: Cache Maven Repo
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ We use cypress for end to end tests with other ebad-front project

Add additional notes about how to deploy this on a live system

### Keycloak
helm install keycloak -f values.yaml oci://registry-1.docker.io/bitnamicharts/keycloak
ingress:
enabled: true
hostname: idp.local


## Built With

Expand Down
53 changes: 32 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.7.5</version>
<version>3.0.0</version>
<relativePath />
</parent>
<licenses>
Expand Down Expand Up @@ -42,7 +42,7 @@

<assertj-core.version>1.0.0m1</assertj-core.version>
<awaitility.version>1.7.0</awaitility.version>
<commons-io.version>2.14.0</commons-io.version>
<commons-io.version>2.16.1</commons-io.version>
<commons-lang.version>3.13.0</commons-lang.version>
<gatling-maven-plugin.version>2.2.4</gatling-maven-plugin.version>
<gatling.version>2.3.0</gatling.version>
Expand All @@ -60,9 +60,9 @@
<spring-security-oauth2.version>2.5.0.RELEASE</spring-security-oauth2.version>
<usertype-core.version>7.0.0.CR1</usertype-core.version>
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<pf4j-spring.version>0.8.0</pf4j-spring.version>
<pf4j.version>3.9.0</pf4j.version>
<jobrunr.version>4.0.10</jobrunr.version>
<pf4j-spring.version>0.9.0</pf4j-spring.version>
<jobrunr.version>5.3.1</jobrunr.version>
<pf4j.version>3.12.0</pf4j.version>
<git.user />
<git.password />
<jacoco.agent.ut.arg />
Expand All @@ -71,7 +71,12 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
</dependency>

Expand Down Expand Up @@ -131,11 +136,6 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.15.3</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand All @@ -145,7 +145,7 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
<version>1.4.200</version>
<version>2.3.230</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -194,7 +194,7 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>4.0.3</version>
<version>4.0.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
Expand All @@ -217,26 +217,32 @@
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.6</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<groupId> org.hibernate.orm</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>6.1.5.Final</version>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache-transactions</artifactId>
<version>3.10.6</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<groupId> org.hibernate.orm</groupId>
<artifactId>hibernate-envers</artifactId>
<version>6.1.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>8.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.6.12.Final</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -311,11 +317,12 @@
<artifactId>spring-security-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.6.8</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<version>3.0.6</version>
</dependency>


<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
Expand Down Expand Up @@ -383,17 +390,20 @@
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>5.0.0</version>
<classifier>jakarta</classifier>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<classifier>jakarta</classifier>
<version>5.0.0</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>2.7.5</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
Expand Down Expand Up @@ -468,7 +478,7 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>4.12.0</version>
<version>4.17.2</version>
</dependency>

<!-- WEBSOCKET -->
Expand All @@ -485,6 +495,7 @@
<artifactId>mapstruct</artifactId>
<version>1.5.5.Final</version>
</dependency>

</dependencies>
<dependencyManagement>
<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<servers>
<server>
<id>github-public</id>
<username>${env.USERNAME}</username>
<password>${env.PASSWORD}</password>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_pASSWORD}</password>
</server>
<server>
<id>github</id>
<username>${env.USERNAME}</username>
<password>${env.PASSWORD}</password>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_PASSWORD}</password>
</server>
</servers>
</settings>
7 changes: 5 additions & 2 deletions src/main/java/fr/icdc/ebad/EbadApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@

import fr.icdc.ebad.config.properties.EbadProperties;
import fr.icdc.ebad.domain.Application;
import jakarta.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springdoc.data.rest.SpringDocDataRestConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PostConstruct;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

@SpringBootApplication(exclude = SpringDocDataRestConfiguration.class)
@SpringBootApplication
@ComponentScan(excludeFilters={@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value=SpringDocDataRestConfiguration.class)})
@EnableConfigurationProperties(EbadProperties.class)
@EnableAsync
@EnableScheduling
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/fr/icdc/ebad/config/JobRunrConfiguration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package fr.icdc.ebad.config;

import org.jobrunr.jobs.mappers.JobMapper;
import org.jobrunr.spring.autoconfigure.JobRunrAutoConfiguration;
import org.jobrunr.spring.autoconfigure.storage.JobRunrSqlStorageAutoConfiguration;
import org.jobrunr.storage.StorageProvider;
import org.jobrunr.storage.StorageProviderUtils;
import org.jobrunr.storage.sql.common.DefaultSqlStorageProvider;
import org.jobrunr.storage.sql.h2.H2StorageProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.sql.DataSource;

@Configuration
@Import({JobRunrSqlStorageAutoConfiguration.class, JobRunrAutoConfiguration.class})
public class JobRunrConfiguration {

private final DataSource dataSource;

public JobRunrConfiguration(DataSource dataSource) {
this.dataSource = dataSource;
}
// @Bean
// public StorageProvider storageProvider(JobMapper jobMapper) {
//
// DefaultSqlStorageProvider storageProvider = new DefaultSqlStorageProvider(dataSource, new AnsiDialect(), StorageProviderUtils.DatabaseOptions.CREATE);
// storageProvider.setJobMapper(jobMapper);
// return storageProvider;
// }

@Bean
public StorageProvider storageProvider2(JobMapper jobMapper) {

DefaultSqlStorageProvider storageProvider = new H2StorageProvider(dataSource, StorageProviderUtils.DatabaseOptions.CREATE);
storageProvider.setJobMapper(jobMapper);
return storageProvider;
}
}
2 changes: 1 addition & 1 deletion src/main/java/fr/icdc/ebad/config/MailConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.thymeleaf.spring5.SpringTemplateEngine;
import org.thymeleaf.spring6.SpringTemplateEngine;
import org.thymeleaf.templateresolver.ITemplateResolver;

@Configuration
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/fr/icdc/ebad/config/apikey/ApiSecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter;

@Configuration
@EnableWebSecurity
@Order(2)
public class ApiSecurityConfig extends WebSecurityConfigurerAdapter {
public class ApiSecurityConfig {

private final ApiKeyAuthenticationManager apiKeyAuthenticationManager;
private final EbadProperties ebadProperties;
Expand All @@ -35,11 +35,11 @@ public RequestHeaderAuthenticationFilter requestHeaderAuthenticationFilter() {
return requestHeaderAuthenticationFilter;
}

@Override
protected void configure(HttpSecurity http) throws Exception {
@Bean
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
// @formatter:off
http
.requestMatcher(request -> {
.securityMatcher(request -> {
String auth = request.getHeader(ebadProperties.getSecurity().getApiKeyHeaderName());
return (auth != null);
})
Expand All @@ -51,5 +51,6 @@ protected void configure(HttpSecurity http) throws Exception {
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS);
// @formatter:on
return http.build();
}
}
Loading

0 comments on commit fc40633

Please sign in to comment.