Skip to content

Commit

Permalink
update-deps (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltkb authored Aug 30, 2023
2 parents df8d5cf + 290dbc5 commit b43af52
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 218 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,29 @@ jobs:
git tag v${{ env.release_version }}
git push --tags
- name: Setup java
uses: actions/setup-java@v2.1.0
uses: actions/setup-java@v3
with:
distribution: 'adopt-hotspot'
distribution: 'temurin'
java-version: '17'
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
#- name: Setup cache
# uses: actions/cache@v2
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
- name: Gradle wrapper validation
uses: gradle/wrapper-validation-action@v1
- name: Running gradle build
uses: eskatos/gradle-command-action@v1.3.3

- name: Gradle Build and Publish
uses: gradle/gradle-build-action@v2
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
with:
arguments: build publish --no-daemon
arguments: build publish

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ COPY --from=dos2unix-env /convert/*.pem src/test/resources/key/
VOLUME /home/gradle/.gradle

RUN if [ -z "$SKIP_TESTS" ]; \
then echo "* Running full build" && gradle -i clean build installDist; \
else echo "* Building but skipping tests" && gradle -i clean installDist -x test; \
then echo "* Running full build" && ./gradlew -i clean build installDist; \
else echo "* Building but skipping tests" && ./gradlew -i clean installDist -x test; \
fi

# --- opa-env
Expand Down
106 changes: 54 additions & 52 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import com.github.jk1.license.filter.LicenseBundleNormalizer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("plugin.serialization") version "1.6.10"
id("org.owasp.dependencycheck") version "6.5.3"
id("com.github.jk1.dependency-license-report") version "2.0"
kotlin("jvm") version "1.9.10"
kotlin("plugin.serialization") version "1.9.10"
id("org.owasp.dependencycheck") version "8.4.0"
id("com.github.jk1.dependency-license-report") version "2.5"
application
`maven-publish`
}
Expand All @@ -23,100 +23,102 @@ repositories {
maven("https://maven.walt.id/repository/waltid/")
maven("https://maven.walt.id/repository/waltid-ssi-kit/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")

maven("https://repo.danubetech.com/repository/maven-public/")
mavenLocal()
}

dependencies {
// Crypto
api("com.google.crypto.tink:tink:1.7.0")
api("info.weboftrust:ld-signatures-java:1.2-SNAPSHOT")
api("decentralized-identity:jsonld-common-java:1.1.0")
api("com.google.crypto.tink:tink:1.10.0")
api("info.weboftrust:ld-signatures-java:1.5.0")
api("decentralized-identity:jsonld-common-java:1.5.0")
implementation("com.goterl:lazysodium-java:5.1.4")
implementation("net.java.dev.jna:jna:5.12.1")
implementation("net.java.dev.jna:jna:5.13.0")
implementation("com.github.multiformats:java-multibase:v1.1.1")
implementation("com.microsoft.azure:azure-keyvault:1.2.6")
implementation("com.microsoft.azure:azure-client-authentication:1.7.14")
implementation("com.nimbusds:nimbus-jose-jwt:9.30.2")
implementation("com.nimbusds:oauth2-oidc-sdk:10.7")
implementation("com.nimbusds:nimbus-jose-jwt:9.31")
implementation("com.nimbusds:oauth2-oidc-sdk:10.11") // changes to authorization_details in 10.12+ not supported
implementation("id.walt:waltid-sd-jwt-jvm:1.2306191408.0")

implementation("org.bouncycastle:bcprov-jdk15to18:1.72")
implementation("org.bouncycastle:bcpkix-jdk15to18:1.72")
implementation("org.bouncycastle:bcprov-jdk18on:1.76")
implementation("org.bouncycastle:bcpkix-jdk18on:1.76")

// Ethereum
implementation("org.web3j:core:5.0.0")
implementation("org.web3j:crypto:5.0.0")
implementation("org.web3j:core:4.10.2") // 5.0.0 is older than 4.x (wrong release)
implementation("org.web3j:crypto:4.10.2")

implementation("com.google.guava:guava:31.1-jre")
implementation("com.google.guava:guava:32.1.2-jre")

// JSON
implementation("org.json:json:20220924")
implementation("org.json:json:20230618")
implementation("com.beust:klaxon:5.6")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.0")
implementation("com.jayway.jsonpath:json-path:2.7.0")
implementation("com.networknt:json-schema-validator:1.0.78")
implementation("net.pwall.json:json-kotlin-schema:0.39")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2")
implementation("com.jayway.jsonpath:json-path:2.8.0")
implementation("com.networknt:json-schema-validator:1.0.86")
implementation("net.pwall.json:json-kotlin-schema:0.40")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")

// DB
implementation("org.xerial:sqlite-jdbc:3.40.1.0")
implementation("org.xerial:sqlite-jdbc:3.43.0.0")
implementation("com.zaxxer:HikariCP:5.0.1")

// CLI-SNAPSHOT
implementation("com.github.ajalt.clikt:clikt-jvm:3.5.2")
implementation("com.github.ajalt.clikt:clikt:3.5.0")
implementation("com.github.ajalt.clikt:clikt-jvm:4.2.0")
implementation("com.github.ajalt.clikt:clikt:4.2.0")

// Misc
implementation("commons-io:commons-io:2.11.0")
implementation("io.minio:minio:8.4.6")
implementation("com.github.ben-manes.caffeine:caffeine:3.1.5")
implementation("commons-io:commons-io:2.13.0")
implementation("io.minio:minio:8.5.5")
implementation("com.github.ben-manes.caffeine:caffeine:3.1.8")

// HTTP
implementation("io.ktor:ktor-client-jackson-jvm:2.2.4")
implementation("io.ktor:ktor-client-content-negotiation:2.2.4")
implementation("io.ktor:ktor-client-core-jvm:2.2.4")
implementation("io.ktor:ktor-client-cio-jvm:2.2.4")
implementation("io.ktor:ktor-client-auth:2.2.4")
implementation("io.ktor:ktor-client-okhttp:2.2.4")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.2.4")
implementation("io.ktor:ktor-client-logging-jvm:2.2.4")
implementation("io.ktor:ktor-client-jackson-jvm:2.3.3")
implementation("io.ktor:ktor-client-content-negotiation:2.3.3")
implementation("io.ktor:ktor-client-core-jvm:2.3.3")
implementation("io.ktor:ktor-client-cio-jvm:2.3.3")
implementation("io.ktor:ktor-client-auth-jvm:2.3.3")
implementation("io.ktor:ktor-client-okhttp-jvm:2.3.3")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.3")
implementation("io.ktor:ktor-client-logging-jvm:2.3.3")

// REST
implementation("io.javalin:javalin:4.6.7")
implementation("io.javalin:javalin-openapi:4.6.7")
implementation("io.javalin:javalin:4.6.8")
implementation("io.javalin:javalin-openapi:4.6.8")
// implementation("io.javalin:javalin-test-tools:4.5.0")

// Logging
implementation("org.slf4j:slf4j-api:2.0.4")
implementation("org.slf4j:slf4j-simple:2.0.4")
implementation("org.slf4j:slf4j-api:2.0.7")
implementation("org.slf4j:slf4j-simple:2.0.7")

implementation("io.github.microutils:kotlin-logging-jvm:3.0.4")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")

// Config
implementation("com.sksamuel.hoplite:hoplite-core:2.6.5")
implementation("com.sksamuel.hoplite:hoplite-yaml:2.6.5")
implementation("com.sksamuel.hoplite:hoplite-hikaricp:2.6.5")
implementation("com.sksamuel.hoplite:hoplite-core:2.7.5")
implementation("com.sksamuel.hoplite:hoplite-yaml:2.7.5")
implementation("com.sksamuel.hoplite:hoplite-hikaricp:2.7.5")

// Service-Matrix
implementation("id.walt.servicematrix:WaltID-ServiceMatrix:1.1.3")

// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.20")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10")

// JNR-FFI
implementation("com.github.jnr:jnr-ffi:2.2.13")
implementation("com.github.jnr:jnr-ffi:2.2.14")

// Testing
//testImplementation(kotlin("test-junit"))
testImplementation("io.mockk:mockk:1.13.2")
testImplementation("io.mockk:mockk:1.13.7")

testImplementation("io.kotest:kotest-runner-junit5:5.5.5")
testImplementation("io.kotest:kotest-assertions-core:5.5.5")
testImplementation("io.kotest:kotest-assertions-json:5.5.5")
testImplementation("io.kotest:kotest-runner-junit5:5.6.2")
testImplementation("io.kotest:kotest-assertions-core:5.6.2")
testImplementation("io.kotest:kotest-assertions-json:5.6.2")

testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0")

}

Expand All @@ -137,7 +139,7 @@ java {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "16"
kotlinOptions.jvmTarget = "17"
}

tasks.named<CreateStartScripts>("startScripts") {
Expand Down Expand Up @@ -215,6 +217,6 @@ publishing {
}

licenseReport {
renderers = arrayOf<ReportRenderer>(InventoryHtmlReportRenderer("ssikit-licenses-report.html","SSI Kit"))
renderers = arrayOf<ReportRenderer>(InventoryHtmlReportRenderer("ssikit-licenses-report.html", "SSI Kit"))
filters = arrayOf<DependencyFilter>(LicenseBundleNormalizer())
}
2 changes: 1 addition & 1 deletion src/main/kotlin/id/walt/cli/EssifCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class EssifOnboardingCommand : CliktCommand(
For gaining access to the EBSI service, a bearer token from
https://app-pilot.ebsi.eu/users-onboarding/v2 must be present."""
) {
val bearerTokenFile: File by argument("BEARER-TOKEN-FILE", help = "File containing the bearer token from EOS").file()
val bearerTokenFile: File by argument("bearer-token-file", help = "File containing the bearer token from EOS").file()
val did: String by option("-d", "--did", help = "DID to be onboarded").required()

override fun run() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/id/walt/crypto/LtSignature.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ open class LtSignature(val algorithm: String) : SignatureSpi() {
return cryptoService.verify(keyId!!, sigBytes!!, b!!)
}

@Deprecated("Deprecated in Java")
override fun engineSetParameter(param: String?, value: Any?) {
TODO("Not yet implemented")
}

@Deprecated("Deprecated in Java")
override fun engineGetParameter(param: String?): Any {
TODO("Not yet implemented")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ object CheqdService {
//private const val registrarUrl = "https://registrar.walt.id/cheqd"
private const val registrarUrl = "https://did-registrar.cheqd.net"
private const val registrarApiVersion = "1.0"
private const val didCreateUrl =
"$registrarUrl/$registrarApiVersion/did-document?verificationMethod=%s&methodSpecificIdAlgo=%s&network=%s&publicKeyHex=%s"
private const val didRegisterUrl = "$registrarUrl/$registrarApiVersion/create"
private const val didDeactivateUrl = "$registrarUrl/$registrarApiVersion/deactivate"
private const val didUpdateUrl = "$registrarUrl/$registrarApiVersion/update"
Expand All @@ -53,7 +51,11 @@ object CheqdService {
val pubKeyHex = Hex.toHexString(key.getPublicKeyBytes())
// step#1. fetch the did document from cheqd registrar
val response = runBlocking {
client.get(String.format(didCreateUrl, verificationMethod, methodSpecificIdAlgo, network, pubKeyHex)).bodyAsText()
client.get("$registrarUrl/$registrarApiVersion/did-document" +
"?verificationMethod=$verificationMethod" +
"&methodSpecificIdAlgo=$methodSpecificIdAlgo" +
"&network=$network" +
"&publicKeyHex=$pubKeyHex").bodyAsText()
}
// step#2. onboard did with cheqd registrar
KlaxonWithConverters().parse<DidGetResponse>(response)?.let {
Expand All @@ -76,7 +78,7 @@ object CheqdService {
}

fun deactivateDid(did: String) {
val job = initiateDidJob(didCreateUrl, KlaxonWithConverters().toJsonString(JobDeactivateRequest(did)))
val job = initiateDidJob(didDeactivateUrl, KlaxonWithConverters().toJsonString(JobDeactivateRequest(did)))
?: throw Exception("Failed to initialize the did onboarding process")
val signatures = signPayload(KeyId(""), job)
val didDocument = (finalizeDidJob(
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/id/walt/services/jwt/WaltIdJwtService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ open class WaltIdJwtService : JwtService() {

val res = verifyJwt(verifierKey, jwt)

log.debug { "JWT verified returned: $res" }
log.debug { "JWT verified returned: $res (with key: ${verifierKey.keyId})" }
return JwtVerificationResult(res)
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/id/walt/signatory/rest/SignatoryRestAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ object SignatoryRestAPI {
.toJsonString(obj)
}

override fun <T : Any?> fromJsonString(json: String, targetClass: Class<T>): T {
override fun <T : Any> fromJsonString(json: String, targetClass: Class<T>): T {
return JavalinJackson(mapper).fromJsonString(json, targetClass)
}
})
Expand Down
7 changes: 3 additions & 4 deletions src/test/kotlin/id/walt/cli/EssifCommandTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ class EssifCommandTest : StringSpec({
val e = shouldThrow<PrintHelpMessage> {
EssifOnboardingCommand().parse(listOf("--help"))
}
val message = e.command.getFormattedHelp()
println(message)
message shouldContain "BEARER-TOKEN-FILE"
message shouldContain "-d, --did"
val message = e.context?.command?.getFormattedHelp()
message shouldContain "bearer-token-file"
message shouldContain "--did"
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/test/kotlin/id/walt/cli/KeyCommandTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class KeyCommandTest : StringSpec({
val e = shouldThrow<PrintHelpMessage> {
GenKeyCommand().parse(listOf("--help"))
}
val message = e.command.getFormattedHelp()
message shouldContain "-a, --algorithm [Ed25519|Secp256k1|RSA|Secp256r1]"
val message = e.context?.command?.getFormattedHelp()
message shouldContain "--algorithm"
message shouldContain "Ed25519|Secp256k1|RSA|Secp256r1"
}

"2. key generate" {
Expand Down
8 changes: 4 additions & 4 deletions src/test/kotlin/id/walt/cli/VcIssueCommandTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class VcIssueCommandTest : StringSpec({
val e = shouldThrow<PrintHelpMessage> {
VcIssueCommand().parse(listOf("--help"))
}
val message = e.command.getFormattedHelp()
message shouldContain "-t, --template"
message shouldContain "-i, --issuer-did"
message shouldContain "-s, --subject-did"
val message = e.context?.command?.getFormattedHelp()
message shouldContain "--template"
message shouldContain "--issuer-did"
message shouldContain "--subject-did"
}

"vc issue default" {
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/id/walt/cli/VcVerifyCommandTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class VcVerifyCommandTest : StringSpec({
val e = shouldThrow<PrintHelpMessage> {
VerifyVcCommand().parse(listOf("--help"))
}
val message = e.command.getFormattedHelp()
val message = e.context?.command?.getFormattedHelp()
message shouldContain "Verify VC or VP"
}

Expand Down
Loading

0 comments on commit b43af52

Please sign in to comment.