Skip to content

Commit

Permalink
Merge branch 'feature/java-lts-21' into feature/elastic-search-start
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Oct 18, 2023
2 parents aeb06d4 + f5dbe8e commit 011ecbc
Show file tree
Hide file tree
Showing 614 changed files with 3,106 additions and 2,718 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
java-version: 21
- name: "Gradle"
env:
NAV_TOKEN: ${{ secrets.NAV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common.integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: "Java"
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: 21
distribution: 'temurin'
- name: "Gradle"
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common.java-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
java-version: 21
- name: "Gradle"
env:
GITHUB_USERNAME: token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common.scan.sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
- name: "Gradle"
env:
NAV_TOKEN: ${{ secrets.NAV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common.workflow.backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
- name: "Gradle"
env:
GITHUB_USERNAME: token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common.workflow.frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
java-version: 21
- name: "Gradle"
env:
GITHUB_USERNAME: token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: 21
- name: "Setup"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .nais/alerting-dolly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ spec:
Kibana: <https://logs.adeo.no/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-30m,to:now))&_a=(columns:!(level,message,envclass,application,pod),filters:!(),grid:(columns:(x_WorkerID:(width:325))),index:'96e648c0-980a-11e9-830a-e17bbd64b4db',interval:auto,query:(language:kuery,query:'namespace:%20%22dolly%22%20AND%20level:%20%22Error%22%20AND%20application:%20%22{{ $labels.app }}%22'),sort:!(!('@timestamp',desc)))|Link>
labels:
namespace: 'dolly'
severity: 'warning'
severity: 'warning'
2 changes: 1 addition & 1 deletion apps/adresse-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/navikt/baseimages/temurin:17
FROM ghcr.io/navikt/baseimages/temurin:21
LABEL maintainer="Team Dolly"

ENV JAVA_OPTS="-Dspring.profiles.active=prod --add-opens java.base/java.lang=ALL-UNNAMED"
Expand Down
18 changes: 11 additions & 7 deletions apps/adresse-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.0.4"
id 'io.spring.dependency-management' version "1.1.0"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id "jacoco"
}

Expand Down Expand Up @@ -40,7 +40,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.1'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
}
}

Expand All @@ -67,14 +67,18 @@ dependencies {
implementation 'org.hibernate.validator:hibernate-validator'
implementation 'org.aspectj:aspectjweaver:1.9.7'

implementation 'net.logstash.logback:logstash-logback-encoder:7.3'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.8'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'

testImplementation 'org.springframework.boot:spring-boot-starter-test'

implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
java.sourceCompatibility = JavaVersion.VERSION_17
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {

httpSecurity.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().csrf().disable()
.authorizeHttpRequests()
.requestMatchers(
httpSecurity.sessionManagement(sessionConfig -> sessionConfig.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.csrf(csrfSpec -> csrfSpec.disable())
.authorizeHttpRequests(authorizeConfig -> authorizeConfig.requestMatchers(
"/internal/**",
"/webjars/**",
"/swagger-resources/**",
Expand All @@ -31,11 +29,9 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti
"/swagger",
"/error",
"/swagger-ui.html"
).permitAll()
.requestMatchers("/api/**").fullyAuthenticated()
.and()
.oauth2ResourceServer()
.jwt();
).permitAll().requestMatchers("/api/**").fullyAuthenticated())
.oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> {
}));

return httpSecurity.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
import org.springframework.vault.client.VaultEndpoint;
import org.springframework.vault.config.AbstractVaultConfiguration;

import static io.micrometer.common.util.StringUtils.isBlank;

@Configuration
@Profile("local")
@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false)
public class VaultLocalConfig extends AbstractVaultConfiguration {

private static final String VAULT_TOKEN = "spring.cloud.vault.token";

@Override
public VaultEndpoint vaultEndpoint() {
return VaultEndpoint.create("vault.adeo.no", 443);
Expand All @@ -21,12 +25,12 @@ public VaultEndpoint vaultEndpoint() {
@Override
public ClientAuthentication clientAuthentication() {
if (System.getenv().containsKey("VAULT_TOKEN")) {
System.setProperty("spring.cloud.vault.token", System.getenv("VAULT_TOKEN"));
System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN"));
}
var token = System.getProperty("spring.cloud.vault.token");
if (token == null) {
throw new IllegalArgumentException("Påkreved property 'spring.cloud.vault.token' er ikke satt.");
var token = System.getProperty(VAULT_TOKEN);
if (isBlank(token)) {
throw new IllegalArgumentException("påkrevd property 'spring.cloud.vault.token' er ikke satt.");
}
return new TokenAuthentication(System.getProperty("spring.cloud.vault.token"));
return new TokenAuthentication(System.getProperty(VAULT_TOKEN));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public List<VegadresseDTO> getVegadresse(VegadresseRequest request, Long antall)
buildCriteria("random", random.nextDouble(), RANDOM)
)
.filter(Objects::nonNull)
.collect(Collectors.toList())
.toList()
))
.build());

Expand Down Expand Up @@ -118,7 +118,7 @@ public List<MatrikkeladresseDTO> getMatrikkelAdresse(MatrikkeladresseRequest req
buildCriteria("random", random.nextDouble(), RANDOM)
)
.filter(Objects::nonNull)
.collect(Collectors.toList())
.toList()
))
.build());

Expand Down
2 changes: 1 addition & 1 deletion apps/amelding-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/navikt/baseimages/temurin:17
FROM ghcr.io/navikt/baseimages/temurin:21
LABEL maintainer="Team Dolly"

ENV JAVA_OPTS="-Dspring.profiles.active=prod"
Expand Down
18 changes: 11 additions & 7 deletions apps/amelding-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.0.4"
id 'io.spring.dependency-management' version "1.1.0"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id "jacoco"
}

Expand Down Expand Up @@ -40,7 +40,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.1'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
}
}

Expand Down Expand Up @@ -71,9 +71,9 @@ dependencies {
implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'org.hibernate.validator:hibernate-validator'

implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.0.2'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.8'
implementation 'net.logstash.logback:logstash-logback-encoder:7.3'
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.2.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
Expand All @@ -82,4 +82,8 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
java.sourceCompatibility = JavaVersion.VERSION_17
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
import org.springframework.vault.client.VaultEndpoint;
import org.springframework.vault.config.AbstractVaultConfiguration;

import static io.micrometer.common.util.StringUtils.isBlank;

@Configuration
@Profile("dev")
@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false)
public class DevConfig extends AbstractVaultConfiguration {

private static final String VAULT_TOKEN = "spring.cloud.vault.token";

@Override
public VaultEndpoint vaultEndpoint() {
return VaultEndpoint.create("vault.adeo.no", 443);
Expand All @@ -21,12 +25,12 @@ public VaultEndpoint vaultEndpoint() {
@Override
public ClientAuthentication clientAuthentication() {
if (System.getenv().containsKey("VAULT_TOKEN")) {
System.setProperty("spring.cloud.vault.token", System.getenv("VAULT_TOKEN"));
System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN"));
}
var token = System.getProperty("spring.cloud.vault.token");
if (token == null) {
throw new IllegalArgumentException("Påkreved property 'spring.cloud.vault.token' er ikke satt.");
var token = System.getProperty(VAULT_TOKEN);
if (isBlank(token)) {
throw new IllegalArgumentException("påkrevd property 'spring.cloud.vault.token' er ikke satt.");
}
return new TokenAuthentication(System.getProperty("spring.cloud.vault.token"));
return new TokenAuthentication(System.getProperty(VAULT_TOKEN));
}
}
Loading

0 comments on commit 011ecbc

Please sign in to comment.