diff --git a/apps/oppdrag-service/build.gradle b/apps/oppdrag-service/build.gradle index b9db6d9890..1c26638be9 100644 --- a/apps/oppdrag-service/build.gradle +++ b/apps/oppdrag-service/build.gradle @@ -10,11 +10,7 @@ buildscript { } plugins { - id 'java' - id "org.sonarqube" version "4.4.1.3373" - id 'org.springframework.boot' version "3.2.1" - id 'io.spring.dependency-management' version "1.1.4" - id "jacoco" + id 'dolly-apps' id "uk.co.boothen.gradle.wsimport" version "0.21" } @@ -22,16 +18,8 @@ apply plugin: "uk.co.boothen.gradle.wsimport" sonarqube { properties { - property "sonar.dynamicAnalysis", "reuseReports" - property "sonar.host.url", "https://sonarcloud.io" - property "sonar.java.coveragePlugin", "jacoco" - property "sonar.language", "java" - property "sonar.token", System.getenv("SONAR_TOKEN") - property "sonar.organization", "navikt" - property "sonar.project.monorepo.enabled", true property "sonar.projectKey", "testnav-oppdrag-service" property "sonar.projectName", "testnav-oppdrag-service" - property "sonar.sourceEncoding", "UTF-8" } } @@ -54,19 +42,6 @@ wsimport { target = "3.0" } -dependencyManagement { - applyMavenExclusions = false - imports { - mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0' - } -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) - } -} - repositories { mavenCentral() maven { @@ -97,6 +72,7 @@ dependencies { implementation 'no.nav.testnav.libs:servlet-core' implementation 'no.nav.testnav.libs:servlet-security' implementation 'no.nav.testnav.libs:data-transfer-objects' + implementation "no.nav.testnav.libs:vault" implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' diff --git a/apps/oppdrag-service/settings.gradle b/apps/oppdrag-service/settings.gradle index 6c975088f4..904d930691 100644 --- a/apps/oppdrag-service/settings.gradle +++ b/apps/oppdrag-service/settings.gradle @@ -8,6 +8,7 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' includeBuild '../../libs/data-transfer-objects' +includeBuild '../../libs/vault' gradleEnterprise { buildScan { diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/DevConfig.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/DevConfig.java deleted file mode 100644 index b3ebc0f139..0000000000 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/DevConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package no.nav.testnav.oppdrag.service.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -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 - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - if (System.getenv().containsKey("VAULT_TOKEN")) { - System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); - } - var token = System.getProperty(VAULT_TOKEN); - if (isBlank(token)) { - throw new IllegalArgumentException("PĂ„krevet property 'spring.cloud.vault.token' er ikke satt."); - } - return new TokenAuthentication(System.getProperty(VAULT_TOKEN)); - } -} \ No newline at end of file diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/OppdragServiceApplicationStarter.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/OppdragServiceApplicationStarter.java similarity index 88% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/OppdragServiceApplicationStarter.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/OppdragServiceApplicationStarter.java index 434733c7cf..2e8c4042fa 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/OppdragServiceApplicationStarter.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/OppdragServiceApplicationStarter.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service; +package no.nav.testnav.oppdragservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/ApplicationConfig.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/ApplicationConfig.java similarity index 90% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/ApplicationConfig.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/ApplicationConfig.java index 49d29401dc..fa45e6cc92 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/ApplicationConfig.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/ApplicationConfig.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service.config; +package no.nav.testnav.oppdragservice.config; import no.nav.testnav.libs.servletcore.config.ApplicationCoreConfig; import no.nav.testnav.libs.servletsecurity.config.SecureOAuth2ServerToServerConfiguration; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/DevConfig.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/DevConfig.java new file mode 100644 index 0000000000..a93f3cd275 --- /dev/null +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/DevConfig.java @@ -0,0 +1,13 @@ +package no.nav.testnav.oppdragservice.config; + +import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.springframework.vault.annotation.VaultPropertySource; + +@Configuration +@Profile("dev") +@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) +public class DevConfig extends AbstractLocalVaultConfiguration { + +} \ No newline at end of file diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/OpenApiConfig.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/OpenApiConfig.java similarity index 98% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/OpenApiConfig.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/OpenApiConfig.java index 4ad59d3759..22e439651d 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/OpenApiConfig.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/OpenApiConfig.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service.config; +package no.nav.testnav.oppdragservice.config; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/OppdragWsConfiguration.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/OppdragWsConfiguration.java similarity index 89% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/OppdragWsConfiguration.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/OppdragWsConfiguration.java index 87314fc687..1def57c64d 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/OppdragWsConfiguration.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/OppdragWsConfiguration.java @@ -1,6 +1,6 @@ -package no.nav.testnav.oppdrag.service.config; +package no.nav.testnav.oppdragservice.config; -import no.nav.testnav.oppdrag.service.consumer.OppdragClient; +import no.nav.testnav.oppdragservice.consumer.OppdragClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.oxm.jaxb.Jaxb2Marshaller; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/SecurityConfig.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/SecurityConfig.java similarity index 97% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/SecurityConfig.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/SecurityConfig.java index 112370f029..718c433a89 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/config/SecurityConfig.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/config/SecurityConfig.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service.config; +package no.nav.testnav.oppdragservice.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragClient.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/consumer/OppdragClient.java similarity index 94% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragClient.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/consumer/OppdragClient.java index cf671c8d79..84779bd2bf 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragClient.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/consumer/OppdragClient.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service.consumer; +package no.nav.testnav.oppdragservice.consumer; import lombok.extern.slf4j.Slf4j; import org.springframework.ws.client.core.support.WebServiceGatewaySupport; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragConsumer.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/consumer/OppdragConsumer.java similarity index 65% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragConsumer.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/consumer/OppdragConsumer.java index 5a15904b83..54e01dc005 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragConsumer.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/consumer/OppdragConsumer.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service.consumer; +package no.nav.testnav.oppdragservice.consumer; import org.springframework.stereotype.Service; diff --git a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/provider/OppdragController.java b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/provider/OppdragController.java similarity index 86% rename from apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/provider/OppdragController.java rename to apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/provider/OppdragController.java index 1bacf7e07f..3b1a068229 100644 --- a/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/provider/OppdragController.java +++ b/apps/oppdrag-service/src/main/java/no/nav/testnav/oppdragservice/provider/OppdragController.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service.provider; +package no.nav.testnav.oppdragservice.provider; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/apps/oppdrag-service/src/test/java/no/nav/testnav.oppdrag.service/ApplicationContextTest.java b/apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/ApplicationContextTest.java similarity index 92% rename from apps/oppdrag-service/src/test/java/no/nav/testnav.oppdrag.service/ApplicationContextTest.java rename to apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/ApplicationContextTest.java index 092d7d4153..8f20b2bd0b 100644 --- a/apps/oppdrag-service/src/test/java/no/nav/testnav.oppdrag.service/ApplicationContextTest.java +++ b/apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/ApplicationContextTest.java @@ -1,4 +1,4 @@ -package no.nav.testnav.oppdrag.service; +package no.nav.testnav.oppdragservice; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/oppdragservice/v1/OppdragRequest.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/oppdragservice/v1/OppdragRequest.java index 3ce9e2f803..7643dd4e94 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/oppdragservice/v1/OppdragRequest.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/oppdragservice/v1/OppdragRequest.java @@ -8,6 +8,5 @@ @Data @Builder @NoArgsConstructor -@AllArgsConstructor public class OppdragRequest { }