Skip to content

Commit

Permalink
Java 21 and nonroot.
Browse files Browse the repository at this point in the history
New version of token-support.
  • Loading branch information
flexable777 committed Mar 27, 2024
1 parent fbf1716 commit 697fee4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-to-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Java 17
- name: Install Java 21
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin

- name: Test and build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Java 17
- name: Install Java 21
uses: actions/setup-java@main
with:
java-version: 17
java-version: 21
distribution: temurin
- name: test and build
run: ./gradlew test build
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/distroless/java17-debian12:latest
FROM gcr.io/distroless/java21-debian12:nonroot
ENV TZ="Europe/Oslo"

COPY build/libs/app.jar /app/app.jar
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ idea {
}
}

java.sourceCompatibility = JavaVersion.VERSION_17
java.sourceCompatibility = JavaVersion.VERSION_21

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
jvmTarget = "21"
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/kotlin/no/nav/klage/util/TokenUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ class TokenUtil(
private val oAuth2AccessTokenService: OAuth2AccessTokenService,
) {
fun getAppAccessTokenWithDokarkivScope(): String {
val clientProperties = clientConfigurationProperties.registration["dokarkiv-maskintilmaskin"]
val clientProperties = clientConfigurationProperties.registration["dokarkiv-maskintilmaskin"]!!
val response = oAuth2AccessTokenService.getAccessToken(clientProperties)
return response.accessToken
return response.accessToken!!
}

fun getAppAccessTokenWithKlageFileApiScope(): String {
val clientProperties = clientConfigurationProperties.registration["klage-file-api-maskintilmaskin"]
val clientProperties = clientConfigurationProperties.registration["klage-file-api-maskintilmaskin"]!!
val response = oAuth2AccessTokenService.getAccessToken(clientProperties)
return response.accessToken
return response.accessToken!!
}

fun getAppAccessTokenWithKlageDittnavApiScope(): String {
val clientProperties = clientConfigurationProperties.registration["klage-dittnav-api-maskintilmaskin"]
val clientProperties = clientConfigurationProperties.registration["klage-dittnav-api-maskintilmaskin"]!!
val response = oAuth2AccessTokenService.getAccessToken(clientProperties)
return response.accessToken
return response.accessToken!!
}

fun getAppAccessTokenWithPdlScope(): String {
val clientProperties = clientConfigurationProperties.registration["pdl-maskintilmaskin"]
val clientProperties = clientConfigurationProperties.registration["pdl-maskintilmaskin"]!!
val response = oAuth2AccessTokenService.getAccessToken(clientProperties)
return response.accessToken
return response.accessToken!!
}
}

0 comments on commit 697fee4

Please sign in to comment.