-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
880 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
apps/skattekort-service/src/main/java/no/nav/skattekortservice/config/Consumers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package no.nav.skattekortservice.config; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import no.nav.testnav.libs.securitycore.domain.ServerProperties; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import static lombok.AccessLevel.PACKAGE; | ||
@Configuration | ||
@ConfigurationProperties(prefix = "consumers") | ||
@NoArgsConstructor(access = PACKAGE) | ||
@Getter | ||
@Setter(PACKAGE) | ||
public class Consumers { | ||
|
||
private ServerProperties sokosSkattekort; | ||
} |
26 changes: 26 additions & 0 deletions
26
...kort-service/src/main/java/no/nav/skattekortservice/consumer/SokosSkattekortConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package no.nav.skattekortservice.consumer; | ||
|
||
import no.nav.skattekortservice.config.Consumers; | ||
import no.nav.testnav.libs.reactivesecurity.exchange.TokenService; | ||
import no.nav.testnav.libs.securitycore.domain.ServerProperties; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
|
||
@Service | ||
public class SokosSkattekortConsumer { | ||
|
||
private WebClient webClient; | ||
private TokenService tokenService; | ||
private ServerProperties serverProperties; | ||
|
||
public SokosSkattekortConsumer(TokenService tokenService, Consumers consumers) { | ||
|
||
this.serverProperties = consumers.getSokosSkattekort(); | ||
this.webClient = WebClient.builder() | ||
.baseUrl(serverProperties.getUrl()) | ||
.build(); | ||
this.tokenService = tokenService; | ||
} | ||
|
||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...kort-service/src/main/java/no/nav/skattekortservice/consumer/command/SokoPostCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package no.nav.skattekortservice.consumer.command; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import no.nav.skattekortservice.dto.SokosRequest; | ||
import no.nav.skattekortservice.dto.SokosResponse; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.util.concurrent.Callable; | ||
|
||
@RequiredArgsConstructor | ||
public class SokoPostCommand implements Callable<Mono<SokosResponse>> { | ||
|
||
private final WebClient webClient; | ||
private final SokosRequest request; | ||
private final String token; | ||
|
||
@Override | ||
public Mono<SokosResponse> call() { | ||
|
||
return webClient | ||
.post() | ||
.uri() | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
apps/skattekort-service/src/main/java/no/nav/skattekortservice/dto/SokosRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package no.nav.skattekortservice.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.val; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SokosRequest { | ||
|
||
private String fnr; | ||
private Integer inntektsar; | ||
private String skattekort; | ||
} |
17 changes: 17 additions & 0 deletions
17
apps/skattekort-service/src/main/java/no/nav/skattekortservice/dto/SokosResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package no.nav.skattekortservice.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SokosResponse { | ||
|
||
private String fnr; | ||
private Integer inntektsar; | ||
private String status; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ghcr.io/navikt/baseimages/temurin:21 | ||
LABEL maintainer="Team Dolly" | ||
|
||
ENV JAVA_OPTS="-Dspring.profiles.active=prod" | ||
|
||
ADD /build/libs/app.jar /app/app.jar | ||
|
||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
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" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
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-saf-proxy" | ||
property "sonar.projectName", "testnav-saf-proxy" | ||
property "sonar.sourceEncoding", "UTF-8" | ||
} | ||
} | ||
bootJar { | ||
archiveFileName = "app.jar" | ||
} | ||
|
||
dependencyManagement { | ||
applyMavenExclusions = false | ||
imports { | ||
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0' | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'no.nav.testnav.libs:security-core' | ||
implementation 'no.nav.testnav.libs:reactive-core' | ||
implementation 'no.nav.testnav.libs:reactive-proxy' | ||
implementation 'no.nav.testnav.libs:reactive-security' | ||
implementation 'no.nav.testnav.libs:data-transfer-objects' | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' | ||
implementation 'org.springframework.boot:spring-boot-starter-webflux' | ||
|
||
implementation 'org.springframework.cloud:spring-cloud-starter-vault-config' | ||
implementation 'org.springframework.cloud:spring-cloud-starter-gateway' | ||
|
||
|
||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' | ||
implementation 'org.hibernate.validator:hibernate-validator' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' | ||
|
||
annotationProcessor 'org.projectlombok:lombok' | ||
implementation 'org.projectlombok:lombok' | ||
testAnnotationProcessor 'org.projectlombok:lombok' | ||
} | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
apiVersion: nais.io/v1 | ||
kind: AzureAdApplication | ||
metadata: | ||
name: testnav-saf-proxy-trygdeetaten | ||
namespace: dolly | ||
labels: | ||
team: dolly | ||
spec: | ||
secretName: azure-trygdeetaten-testnav-saf-proxy-trygdeetaten | ||
secretKeyPrefix: "AZURE_TRYGDEETATEN" | ||
tenant: trygdeetaten.no | ||
--- | ||
apiVersion: "nais.io/v1alpha1" | ||
kind: "Application" | ||
metadata: | ||
name: testnav-saf-proxy | ||
namespace: dolly | ||
labels: | ||
team: dolly | ||
spec: | ||
image: "{{image}}" | ||
port: 8080 | ||
webproxy: true | ||
tokenx: | ||
enabled: true | ||
azure: | ||
application: | ||
allowAllUsers: true | ||
enabled: true | ||
tenant: nav.no | ||
accessPolicy: | ||
inbound: | ||
rules: | ||
- application: team-dolly-lokal-app | ||
cluster: dev-gcp | ||
- application: testnav-oversikt-frontend | ||
cluster: dev-gcp | ||
- application: dolly-frontend-dev | ||
cluster: dev-gcp | ||
- application: dolly-frontend | ||
cluster: dev-gcp | ||
- application: dolly-idporten | ||
cluster: dev-gcp | ||
- application: testnav-joark-dokument-service | ||
cluster: dev-gcp | ||
liveness: | ||
path: /internal/isAlive | ||
initialDelay: 4 | ||
periodSeconds: 5 | ||
failureThreshold: 500 | ||
readiness: | ||
path: /internal/isReady | ||
initialDelay: 4 | ||
periodSeconds: 5 | ||
failureThreshold: 500 | ||
replicas: | ||
min: 1 | ||
max: 1 | ||
resources: | ||
requests: | ||
cpu: 200m | ||
memory: 1025Mi | ||
limits: | ||
memory: 2048Mi | ||
envFrom: | ||
- secret: azure-trygdeetaten-testnav-saf-proxy-trygdeetaten | ||
ingresses: | ||
- "https://testnav-saf-proxy.dev-fss-pub.nais.io" |
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
proxies/skattekort-proxy/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.