From 6392192601a888397930026d03437fc63066f0cf Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Sun, 24 Mar 2024 12:32:36 +0200 Subject: [PATCH] upgrade dependencies - part 1 --- .github/workflows/android-sdk-tests.yml | 2 +- VCL/build.gradle | 24 +++++++++---------- .../api/entities/VCLCredentialManifest.kt | 5 +++- .../velocitycareerlabs/api/entities/VCLJwt.kt | 7 +++--- app/build.gradle | 4 ++-- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/android-sdk-tests.yml b/.github/workflows/android-sdk-tests.yml index 83797e88..b974785c 100644 --- a/.github/workflows/android-sdk-tests.yml +++ b/.github/workflows/android-sdk-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Git clone repository uses: actions/checkout@v4 # Setup java - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} diff --git a/VCL/build.gradle b/VCL/build.gradle index 9413a415..9ea01a71 100644 --- a/VCL/build.gradle +++ b/VCL/build.gradle @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 24 targetSdk 33 - versionName "2.3.4" - versionCode 134 + versionName "2.4.1-rc.1" + versionCode 135 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } @@ -107,10 +107,11 @@ afterEvaluate { groupId getGroupId() artifactId getArtifactId() - // define rc version name - def vers = getVersionName() - def rcSuffix = rootProject.ext.rcSuffix - version = "${vers}-${rcSuffix}" +// // define rc version name +// def vers = getVersionName() +// def rcSuffix = rootProject.ext.rcSuffix +// version = "${vers}-${rcSuffix}" + version getVersionName() // Two artifacts, the `aar` (or `jar`) and the sources if (project.plugins.findPlugin("com.android.library")) { @@ -217,7 +218,7 @@ repositories { dependencies { implementation 'androidx.core:core-ktx:1.9.0' - implementation "com.nimbusds:nimbus-jose-jwt:9.37" + implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3' //noinspection GradleDependency implementation "androidx.security:security-crypto:1.0.0" @@ -228,13 +229,12 @@ dependencies { testImplementation 'junit:junit:4.13.2' // Optional -- Robolectric environment testImplementation 'androidx.test:core:1.5.0' - testImplementation 'org.robolectric:robolectric:4.10' + testImplementation 'org.robolectric:robolectric:4.11.1' // Optional -- Mockito framework - def mockito_version = "4.0.0" - testImplementation "org.mockito:mockito-core:$mockito_version" - testImplementation "org.mockito:mockito-inline:$mockito_version" + testImplementation "org.mockito:mockito-core:5.11.0" + testImplementation "org.mockito:mockito-inline:5.2.0" // Required -- JSON framework - testImplementation 'org.json:json:20201115' + testImplementation 'org.json:json:20240303' // jsonassert testImplementation 'org.skyscreamer:jsonassert:1.5.1' diff --git a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt index a4cf41c1..789bbf5d 100644 --- a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt +++ b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLCredentialManifest.kt @@ -49,7 +49,10 @@ data class VCLCredentialManifest( )?.toString() ?: "" private fun retrieveAud() = - ((jwt.payload?.toJSONObject()?.getOrDefault(CodingKeys.KeyMetadata, HashMap()) as? Map )?.getOrDefault(CodingKeys.KeyFinalizeOffersUri, "") as? String ?: "").substringBefore("/issue/") + ((jwt.payload?.toJSONObject() + ?.getOrDefault(CodingKeys.KeyMetadata, HashMap()) as? Map<*, *> ) + ?.getOrDefault(CodingKeys.KeyFinalizeOffersUri, "") as? String ?: "") + .substringBefore("/issue/") companion object CodingKeys { const val KeyIssuingRequest = "issuing_request" diff --git a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt index 8ff23c41..9fc202d1 100644 --- a/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt +++ b/VCL/src/main/java/io/velocitycareerlabs/api/entities/VCLJwt.kt @@ -64,10 +64,9 @@ class VCLJwt { val kid: String? get() = header?.keyID - ?: ((header?.toJSONObject()?.getOrDefault( - CodingKeys.KeyJwk, - null - )) as? Map)?.getOrDefault(CodingKeys.KeyKid, null) + ?: ((header?.toJSONObject() + ?.getOrDefault(CodingKeys.KeyJwk, null)) as? Map<*, *>) + ?.getOrDefault(CodingKeys.KeyKid, null) as? String val iss: String? get() = this.payload?.toJSONObject()?.getOrDefault(CodingKeys.KeyIss, null) as? String val aud: String? diff --git a/app/build.gradle b/app/build.gradle index 4a62cb5b..f65c4e08 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,11 +51,11 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' // Must: be added: - implementation "com.nimbusds:nimbus-jose-jwt:9.37" + implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3' implementation project(':VCL') // implementation "io.velocitycareerlabs:vcl:x.y.z" testImplementation 'junit:junit:4.13.2' - testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' } \ No newline at end of file