Skip to content

Commit

Permalink
Merge branch 'dev' into feature/#716-increase-contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanStrehlerCGI authored Nov 3, 2023
2 parents 5de0180 + fbf5537 commit f0dae7e
Show file tree
Hide file tree
Showing 60 changed files with 264 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
working-directory: ./digiwf-apps
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
working-directory: ./docs
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-bump-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# bump apps version
- name: Setup node
if: inputs.bump-apps-version == true
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-release-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
working-directory: ./digiwf-apps
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-release-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
working-directory: ./docs
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion digiwf-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.1</version>
<executions>
<execution>
<id>run-itests</id>
Expand Down
2 changes: 1 addition & 1 deletion digiwf-engine/digiwf-engine-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<apache.commons.csv>1.10.0</apache.commons.csv>
<apache.commons.io>2.15.0</apache.commons.io>
<apache.commons.lang3>3.12.0</apache.commons.lang3>
<apache.commons.text>1.10.0</apache.commons.text>
<apache.commons.text>1.11.0</apache.commons.text>
<apache.commons.validator>1.7</apache.commons.validator>
<hamcrest.version>1.3</hamcrest.version>
<javafaker.version>1.0.2</javafaker.version>
Expand Down
16 changes: 10 additions & 6 deletions digiwf-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<java.version>17</java.version>
<maven.version>3.6.0</maven.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>2.7.17</spring-boot.version>
<spring.cloud.version>2021.0.8</spring.cloud.version>
<spring-boot.version>3.1.5</spring-boot.version>
<spring.cloud.version>2022.0.4</spring.cloud.version>
<apache.commons.lang.version>3.13.0</apache.commons.lang.version>
<hazelcast.version>4.2.8</hazelcast.version>
<logstash.encoder.version>7.4</logstash.encoder.version>
Expand Down Expand Up @@ -112,15 +112,19 @@
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ public class NoSecurityConfiguration {
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
return http
.authorizeExchange()
.anyExchange().permitAll()
.and()
.cors()
.and()
.csrf().disable()
.authorizeExchange(authorizeExchangeSpec -> authorizeExchangeSpec.anyExchange().permitAll())
.cors(corsSpec -> {})
.csrf(ServerHttpSecurity.CsrfSpec::disable)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,34 @@ public class SecurityConfiguration {
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http
.logout()
.logout(logoutSpec -> {
//.logoutSuccessHandler(GatewayUtils.createLogoutSuccessHandler(LOGOUT_SUCCESS_URL))
.logoutSuccessHandler(new HttpStatusReturningServerLogoutSuccessHandler())
.logoutUrl(LOGOUT_URL)
.requiresLogout(ServerWebExchangeMatchers.pathMatchers(HttpMethod.POST, LOGOUT_URL))
.and()
.authorizeExchange()
logoutSpec.logoutSuccessHandler(new HttpStatusReturningServerLogoutSuccessHandler())
.logoutUrl(LOGOUT_URL)
.requiresLogout(ServerWebExchangeMatchers.pathMatchers(HttpMethod.POST, LOGOUT_URL));
})

.authorizeExchange(authorizeExchangeSpec -> {
// permitAll
.pathMatchers(HttpMethod.OPTIONS, "/api/**").permitAll()
.pathMatchers(LOGOUT_SUCCESS_URL).permitAll()
.pathMatchers("/api/*/info",
"/actuator/health",
"/actuator/info",
"/actuator/metrics").permitAll()
// only authenticated
.anyExchange().authenticated()
.and()
authorizeExchangeSpec.pathMatchers(HttpMethod.OPTIONS, "/api/**").permitAll()
.pathMatchers(LOGOUT_SUCCESS_URL).permitAll()
.pathMatchers("/api/*/info",
"/actuator/health",
"/actuator/info",
"/actuator/metrics").permitAll()
// only authenticated
.anyExchange().authenticated();
})
.cors(corsSpec -> {})
.csrf(csrfSpec -> {
/*
* The necessary subscription for csrf token attachment to {@link ServerHttpResponse}
* is done in class {@link CsrfTokenAppendingHelperFilter}.
*/
.csrf().csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse())
.and()
.cors()
.and()
.oauth2Login()
/*
* Set security session timeout.
*/
.authenticationSuccessHandler(new RedirectServerAuthenticationSuccessHandler() {
csrfSpec.csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse());
})
.oauth2Login(oAuth2LoginSpec -> {
oAuth2LoginSpec.authenticationSuccessHandler(new RedirectServerAuthenticationSuccessHandler() {
@Override
public Mono<Void> onAuthenticationSuccess(WebFilterExchange webFilterExchange, Authentication authentication) {
webFilterExchange.getExchange().getSession().subscribe(
Expand All @@ -77,6 +75,8 @@ public Mono<Void> onAuthenticationSuccess(WebFilterExchange webFilterExchange, A
return super.onAuthenticationSuccess(webFilterExchange, authentication);
}
});
});

return http.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package de.muenchen.oss.digiwf.gateway.annotations;

import de.muenchen.oss.digiwf.gateway.ApiGatewayApplication;
import de.muenchen.oss.digiwf.gateway.TestConstants;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@ExtendWith(SpringExtension.class)
@SpringBootTest(
classes = { ApiGatewayApplication.class },
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
)
@ActiveProfiles(TestConstants.SPRING_TEST_PROFILE)
@AutoConfigureObservability
public @interface ApiGatewayTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,13 @@
*/
package de.muenchen.oss.digiwf.gateway.controller;

import de.muenchen.oss.digiwf.gateway.ApiGatewayApplication;
import de.muenchen.oss.digiwf.gateway.annotations.ApiGatewayTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;

import static de.muenchen.oss.digiwf.gateway.TestConstants.SPRING_TEST_PROFILE;


@ExtendWith(SpringExtension.class)
@SpringBootTest(
classes = {ApiGatewayApplication.class},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
)
@ActiveProfiles(SPRING_TEST_PROFILE)
@ApiGatewayTest
public class ActuatorInfoEndpointTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,15 @@
*/
package de.muenchen.oss.digiwf.gateway.controller;

import de.muenchen.oss.digiwf.gateway.ApiGatewayApplication;
import de.muenchen.oss.digiwf.gateway.annotations.ApiGatewayTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;

import static de.muenchen.oss.digiwf.gateway.TestConstants.SPRING_TEST_PROFILE;


@ExtendWith(SpringExtension.class)
@SpringBootTest(
classes = {ApiGatewayApplication.class},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
)
@ActiveProfiles(SPRING_TEST_PROFILE)
@ApiGatewayTest
class PingControllerTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,14 @@
*/
package de.muenchen.oss.digiwf.gateway.filter;

import de.muenchen.oss.digiwf.gateway.ApiGatewayApplication;
import de.muenchen.oss.digiwf.gateway.TestConstants;
import de.muenchen.oss.digiwf.gateway.annotations.ApiGatewayTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;


@ExtendWith(SpringExtension.class)
@SpringBootTest(
classes = { ApiGatewayApplication.class },
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
)
@ActiveProfiles(TestConstants.SPRING_TEST_PROFILE)

@ApiGatewayTest
class CsrfTokenAppendingHelperFilterTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,21 @@
*/
package de.muenchen.oss.digiwf.gateway.filter;

import de.muenchen.oss.digiwf.gateway.ApiGatewayApplication;
import de.muenchen.oss.digiwf.gateway.TestConstants;
import com.github.tomakehurst.wiremock.http.HttpHeader;
import com.github.tomakehurst.wiremock.http.HttpHeaders;
import de.muenchen.oss.digiwf.gateway.annotations.ApiGatewayTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
import org.springframework.http.HttpStatus;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.*;


@ExtendWith(SpringExtension.class)
@SpringBootTest(
classes = {ApiGatewayApplication.class},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
)
@ActiveProfiles(TestConstants.SPRING_TEST_PROFILE)
@ApiGatewayTest
@AutoConfigureWireMock
class GlobalAuthenticationErrorFilterTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,21 @@
*/
package de.muenchen.oss.digiwf.gateway.filter;

import de.muenchen.oss.digiwf.gateway.ApiGatewayApplication;
import com.github.tomakehurst.wiremock.http.HttpHeader;
import com.github.tomakehurst.wiremock.http.HttpHeaders;
import de.muenchen.oss.digiwf.gateway.TestConstants;
import de.muenchen.oss.digiwf.gateway.annotations.ApiGatewayTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
import org.springframework.http.HttpStatus;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.*;


@ExtendWith(SpringExtension.class)
@SpringBootTest(
classes = { ApiGatewayApplication.class },
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
)
@ActiveProfiles(TestConstants.SPRING_TEST_PROFILE)
@ApiGatewayTest
@AutoConfigureWireMock
class GlobalBackendErrorFilterTest {

Expand Down
Loading

0 comments on commit f0dae7e

Please sign in to comment.