-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Konvertert til Kotlin og JDK 21, i tillegg en masse tender love & car…
…e. (#812)
- Loading branch information
1 parent
5b3c889
commit e54986c
Showing
282 changed files
with
4,940 additions
and
8,537 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -12,10 +12,10 @@ jobs: | |
- name: Checkout latest code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
java-version: 21 | ||
distribution: temurin | ||
cache: maven | ||
|
||
|
@@ -51,4 +51,4 @@ jobs: | |
# run: | | ||
# git config user.email "[email protected]" | ||
# git config user.name "GitHub Actions release" | ||
# ./mvnw --settings .github/settings.xml -Pgithub --batch-mode -Dmaven.main.skip=true -Dmaven.test.skip=true deploy | ||
# ./mvnw --settings .github/settings.xml -Pgithub --batch-mode -Dmaven.main.skip=true -Dmaven.test.skip=true deploy |
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 |
---|---|---|
@@ -1 +1 @@ | ||
17 | ||
21.0.1 |
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 |
---|---|---|
|
@@ -33,7 +33,6 @@ | |
<module>token-validation-spring-test</module> | ||
<module>token-validation-jaxrs</module> | ||
<module>token-validation-spring-demo</module> | ||
<module>token-validation-ktor</module> | ||
<module>token-validation-ktor-v2</module> | ||
<module>token-validation-ktor-demo</module> | ||
<module>token-client-spring</module> | ||
|
@@ -42,6 +41,7 @@ | |
<module>token-client-core</module> | ||
</modules> | ||
<properties> | ||
<kotlin.version>1.9.22</kotlin.version> | ||
<kotlin-coroutines.version>1.6.2</kotlin-coroutines.version> | ||
<doclint>none</doclint> | ||
<sonar.host.url>https://sonarcloud.io</sonar.host.url> | ||
|
@@ -55,63 +55,26 @@ | |
<spring-boot.version>3.2.1</spring-boot.version> | ||
<oauth2-oidc-sdk.version>11.9</oauth2-oidc-sdk.version> | ||
<validation-api.version>2.0.1.Final</validation-api.version> | ||
<rest-assured.version>5.4.0</rest-assured.version> | ||
<mockwebserver.version>4.12.0</mockwebserver.version> | ||
<caffeine.version>3.1.8</caffeine.version> | ||
<okhttp3.version>4.12.0</okhttp3.version> | ||
<ktor.version>1.6.8</ktor.version> | ||
<ktor.version>2.3.6</ktor.version> | ||
<kotlin.code.style>official</kotlin.code.style> | ||
<kotlin.version>1.9.22</kotlin.version> | ||
<mock-oauth2-server.version>2.1.0</mock-oauth2-server.version> | ||
<nimbus.jose.jwt.version>9.37.3</nimbus.jose.jwt.version> | ||
<kotest.version>5.8.0</kotest.version> | ||
<kotlin.compiler.jvmTarget>17</kotlin.compiler.jvmTarget> | ||
</properties> | ||
|
||
<scm> | ||
<url>https://github.com/navikt/token-support</url> | ||
<connection>scm:git:[email protected]:navikt/token-support.git</connection> | ||
<developerConnection>scm:git:[email protected]:navikt/token-support.git</developerConnection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.2.3</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.jacoco</groupId> | ||
<artifactId>jacoco-maven-plugin</artifactId> | ||
<version>0.8.11</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>prepare-agent</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>report</id> | ||
<goals> | ||
<goal>report</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.12.1</version> | ||
<configuration> | ||
<compilerArgs> | ||
<arg>-parameters</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
|
@@ -262,6 +225,13 @@ | |
</profiles> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-bom</artifactId> | ||
<version>${kotlin.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
|
@@ -432,6 +402,12 @@ | |
<artifactId>mockito-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito.kotlin</groupId> | ||
<artifactId>mockito-kotlin</artifactId> | ||
<version>5.2.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-junit-jupiter</artifactId> | ||
|
@@ -442,4 +418,4 @@ | |
<artifactId>nimbus-jose-jwt</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
</project> |
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
19 changes: 9 additions & 10 deletions
19
...-client-core/src/main/kotlin/no/nav/security/token/support/client/core/OAuth2GrantType.kt
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
package no.nav.security.token.support.client.core | ||
|
||
import com.nimbusds.oauth2.sdk.GrantType | ||
import kotlin.DeprecationLevel.WARNING | ||
|
||
@Deprecated("Use GrantType from nimbus instead", ReplaceWith("GrantType"), DeprecationLevel.WARNING) | ||
data class OAuth2GrantType(@JvmField val value : String) { | ||
fun value() = value | ||
|
||
@Deprecated("Use GrantType from nimbus instead", ReplaceWith("GrantType"), WARNING) | ||
data class OAuth2GrantType(val value : String) { | ||
companion object { | ||
@JvmField | ||
@Deprecated("Use GrantType.JWT_BEARER from nimbus instead") | ||
val JWT_BEARER = OAuth2GrantType(GrantType.JWT_BEARER.value) | ||
@Deprecated("Use com.nimbusds.oauth2.sdk.GrantType instead", ReplaceWith("GrantType.JWT_BEARER"), WARNING) | ||
val JWT_BEARER = GrantType(GrantType.JWT_BEARER.value) | ||
@JvmField | ||
@Deprecated("Use GrantType.CLIENT_CREDENTIALS from nimbus instead") | ||
val CLIENT_CREDENTIALS = OAuth2GrantType(GrantType.CLIENT_CREDENTIALS.value) | ||
@Deprecated("Use com.nimbusds.oauth2.sdk.GrantType instead", ReplaceWith("GrantType.CLIENT_CREDENTIALS"), WARNING) | ||
val CLIENT_CREDENTIALS = GrantType(GrantType.CLIENT_CREDENTIALS.value) | ||
@JvmField | ||
@Deprecated("Use GrantType.TOKEN_EXCHANGE from nimbus instead") | ||
val TOKEN_EXCHANGE = OAuth2GrantType(GrantType.TOKEN_EXCHANGE.value) | ||
@Deprecated("Use com.nimbusds.oauth2.sdk.GrantType instead", ReplaceWith("GrantType.TOKEN_EXCHANGE"), WARNING) | ||
val TOKEN_EXCHANGE = GrantType(GrantType.TOKEN_EXCHANGE.value) | ||
} | ||
} |
20 changes: 11 additions & 9 deletions
20
...nt-core/src/main/kotlin/no/nav/security/token/support/client/core/auth/ClientAssertion.kt
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
5 changes: 2 additions & 3 deletions
5
...c/main/kotlin/no/nav/security/token/support/client/core/context/JwtBearerTokenResolver.kt
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package no.nav.security.token.support.client.core.context | ||
|
||
import java.util.Optional | ||
|
||
fun interface JwtBearerTokenResolver { | ||
fun token() : Optional<String> | ||
|
||
fun token() : String? | ||
} |
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
Oops, something went wrong.