diff --git a/README.md b/README.md index 5318b025..90f66f18 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Refarch +# RefArch [![Made with love by it@M][made-with-love-shield]][itm-opensource] -Collection of different reference architecture (Refarch) components developed by it@M. +Collection of different reference architecture (RefArch) components developed by it@M. ## Usage diff --git a/refarch-gateway/README.md b/refarch-gateway/README.md index 10680e7d..bd9aea71 100644 --- a/refarch-gateway/README.md +++ b/refarch-gateway/README.md @@ -1,4 +1,4 @@ -# Refarch Gateway +# RefArch Gateway ## Usage @@ -20,9 +20,12 @@ Beside the default behaviour there are some special route prefixes which are han ## Profiles -| Profile | Description | -|---------------|---------------------------------------------------------------------------------------------------| -| `no-security` | Disables complete security like authentication, authorization, csrf etc. Routing works as normal. | +| Profile | Description | +|-------------------|---------------------------------------------------------------------------------------------------| +| `json-logging` | Switches logging from textual to JSON output. | +| `no-security` | Disables complete security like authentication, authorization, csrf etc. Routing works as normal. | +| `hazelcast-local` | Configures Spring Session Hazelcast for connection via localhost (i.e. local development). | +| `hazelcast-k8s` | Configures Spring Session Hazelcast for usage in Kubernetes/OpenShift cluster. | ## Configuration diff --git a/refarch-gateway/src/main/java/de.muenchen.oss.refarch.gateway/configuration/WebSessionConfiguration.java b/refarch-gateway/src/main/java/de.muenchen.oss.refarch.gateway/configuration/WebSessionConfiguration.java index e0c070fa..a4790533 100644 --- a/refarch-gateway/src/main/java/de.muenchen.oss.refarch.gateway/configuration/WebSessionConfiguration.java +++ b/refarch-gateway/src/main/java/de.muenchen.oss.refarch.gateway/configuration/WebSessionConfiguration.java @@ -3,10 +3,10 @@ import com.hazelcast.config.Config; import com.hazelcast.config.EvictionPolicy; import com.hazelcast.config.MapConfig; +import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.map.IMap; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -25,6 +25,7 @@ */ @Configuration @EnableSpringWebSession +@Profile({ "hazelcast-local", "hazelcast-k8s" }) public class WebSessionConfiguration { @Value("${hazelcast.instance:hazl_instance}") @@ -45,13 +46,18 @@ public ServerOAuth2AuthorizedClientRepository authorizedClientRepository() { } @Bean - public ReactiveSessionRepository reactiveSessionRepository(@Qualifier("hazelcastInstance") @Autowired HazelcastInstance hazelcastInstance) { + public ReactiveSessionRepository reactiveSessionRepository(@Autowired HazelcastInstance hazelcastInstance) { final IMap map = hazelcastInstance.getMap(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME); return new ReactiveMapSessionRepository(map); } @Bean - @Profile({ "local", "test" }) + public HazelcastInstance hazelcastInstance(@Autowired final Config config) { + return Hazelcast.getOrCreateHazelcastInstance(config); + } + + @Bean + @Profile({ "hazelcast-local" }) public Config localConfig(@Value( "${spring.session.timeout}" ) int timeout) { @@ -73,7 +79,7 @@ public Config localConfig(@Value( } @Bean - @Profile({ "dev", "kon", "prod" }) + @Profile({ "hazelcast-k8s" }) public Config config(@Value("${spring.session.timeout}") int timeout) { final var hazelcastConfig = new Config(); hazelcastConfig.setInstanceName(hazelcastInstanceName); diff --git a/refarch-gateway/src/main/resources/banner.txt b/refarch-gateway/src/main/resources/banner.txt index d9c17921..f4dbbaed 100644 --- a/refarch-gateway/src/main/resources/banner.txt +++ b/refarch-gateway/src/main/resources/banner.txt @@ -1,10 +1,6 @@ --------------------------------------------------------------------------------------------------------------------------------------------------- - ____ __ _ ____ _ - | _ \ ___ / _| __ _ _ __ ___| |__ / ___| __ _| |_ _____ ____ _ _ _ - | |_) / _ \ |_ / _` | '__/ __| '_ \| | _ / _` | __/ _ \ \ /\ / / _` | | | | - | _ < __/ _| (_| | | | (__| | | | |_| | (_| | || __/\ V V / (_| | |_| | - |_| \_\___|_| \__,_|_| \___|_| |_|\____|\__,_|\__\___| \_/\_/ \__,_|\__, | - |___/ + RefArch-Gateway + https://github.com/it-at-m/refarch Application Name : ${spring.application.name} (v${info.application.version}) Spring Boot Version : ${spring-boot.formatted-version} diff --git a/refarch-gateway/src/main/resources/logback-spring.xml b/refarch-gateway/src/main/resources/logback-spring.xml index 1494ddd2..d3d59236 100644 --- a/refarch-gateway/src/main/resources/logback-spring.xml +++ b/refarch-gateway/src/main/resources/logback-spring.xml @@ -8,14 +8,16 @@ - + + %date{yyyy.MM.dd HH:mm:ss.SSS} | ${springAppName} | TraceId: %X{traceId:-} | SpanId: %X{spanId:-}] | %level | [%thread] | %logger{0} | [%file : %line] - %msg%n + @@ -23,42 +25,36 @@ - - - - - + - + - + - + - + - + @@ -88,34 +84,9 @@ - - - - - - - - - - - - - - - - - - + diff --git a/renovate.json b/renovate.json index 22a99432..aa455ccc 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,9 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:recommended"] + "extends": [ + "config:recommended" + ], + "labels": [ + "dependencies" + ] }