Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Kotlin 1.9.23 and latest KMP-Crypto #42

Merged
merged 8 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
# Runs a set of commands using the runners shell
- name: Remove unwanted files
run: |
git rm -r .github/workflows
git rm .github/workflows/mirror.yml
git rm .github/workflows/publish-dry-run.yml
git rm .github/workflows/publish-pages-only.yml
git rm .github/workflows/publish.yml
git rm .github/workflows/build-jvm.yml
git rm .github/workflows/build-ios.yml
- name: Commit cleanup changes
run: git commit -m "Prepare mirroring"
- name: Set destination to ${{ vars.MIRROR_REMOTE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Publish to Maven Local
run: ./gradlew clean publishToMavenLocal
run: ./gradlew -Dpublishing.excludeIncludedBuilds=true clean publishToMavenLocal
env:
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PUBLISH_SIGNING_KEYID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PUBLISH_SIGNING_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Publish to Sonatype
run: ./gradlew clean publishToSonatype closeSonatypeStagingRepository
run: ./gradlew -Dpublishing.excludeIncludedBuilds=true clean publishToSonatype closeSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PUBLISH_SIGNING_KEYID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PUBLISH_SIGNING_KEY }}
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

Release NEXT:
- Update to latest KMP Crypto 2.5.0
- Introduces correct mulitbase encoding
- EC Point Compression
- **THIS IS A BREAKING CHANGE WRT. SERIALIZATION OF DID-ENCODED KEYS**
- Given that all EC keys were previously uncompressed, different mutlicodec identifiers are now supported and the old encoding of uncompressed keys does not work anymore, as it was faulty.
- In addition, the encoding of the mutlibase prefix has changed, since varint-Encoding is now used correctly.
- Fix name shadowing of gradle plugins by renaming file `Plugin.kt` -> `VcLibConventions.kt`
- Kotlin 1.9.23
- Ktor 2.3.9
- KMP-Crypto *INSERT VERSION HERE*
- Fix: Add missing iOS exports
- Add switch to disable composite build (useful for publishing)


Release 3.4.0:
- Target Java 17
- Updated dependencies from conventions: Bouncycastle 1.77, Serialization 1.6.3-snapshot (fork), Napier 2.7.1, KMP Crypto 2.3.0
Expand Down
3 changes: 3 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ sonatypeUsername=<user-token-name>
sonatypePassword=<user-token-password>
```

In addition, it is highly recommended to set the System property `publishing.excludeIncludedBuilds` to `true`, to
build artefacts for publishing, which **do no** depend on included builds.

To run the pipeline from GitHub, export your GPG key with `gpg --export-secret-keys --armor <keyid> | tee <keyid>.asc` and set the following environment variables:

```shell
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# KMM VC Library
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-brightgreen.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![Kotlin](https://img.shields.io/badge/kotlin-multiplatform--mobile-orange.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.23-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Java](https://img.shields.io/badge/java-17-blue.svg?logo=OPENJDK)](https://www.oracle.com/java/technologies/downloads/#java17)
[![Maven Central](https://img.shields.io/maven-central/v/at.asitplus.wallet/vclib)](https://mvnrepository.com/artifact/at.asitplus.wallet/vclib/)

Expand Down
13 changes: 1 addition & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

plugins {
id("at.asitplus.gradle.vclib-conventions")
}
Expand All @@ -8,20 +7,10 @@ plugins {
apply(plugin = "org.jetbrains.dokka")
tasks.getByName("dokkaHtmlMultiModule") {
(this as DokkaMultiModuleTask)
outputDirectory.set(File("$buildDir/dokka"))
outputDirectory.set(layout.buildDirectory.dir("dokka").get().asFile)
includes.from("README.md")
}

task<Exec>("purge") {
dependsOn("clean")
workingDir = layout.projectDirectory.dir("vclib").asFile
commandLine("./gradlew", "clean")
doFirst {
println("descending into ${workingDir.absolutePath}")
logger.lifecycle("Purging VcLib maven build")
}
}

val artifactVersion: String by extra
group = "at.asitplus.wallet"
version = artifactVersion
2 changes: 1 addition & 1 deletion conventions-vclib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
group = "at.asitplus.gradle"

dependencies {
api("at.asitplus.gradle:legacy")
api("at.asitplus.gradle:k2")
}

repositories {
Expand Down
1 change: 0 additions & 1 deletion conventions-vclib/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rootProject.name = "vclib-conventions"

//we don't want to pollute the classpath with a shadowed conventions plugin
System.setProperty("at.asitplus.gradle", "legacy")
includeBuild("gradle-conventions-plugin")
40 changes: 0 additions & 40 deletions conventions-vclib/src/main/kotlin/Plugin.kt

This file was deleted.

53 changes: 53 additions & 0 deletions conventions-vclib/src/main/kotlin/VcLibConventions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@file:Suppress("NOTHING_TO_INLINE", "PackageDirectoryMismatch")

package at.asitplus.gradle

import VcLibVersions
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler


inline fun commonApiDependencies() = listOf(
coroutines(),
serialization("json"),
serialization("cbor"),
"at.asitplus.crypto:datatypes-cose:${VcLibVersions.kmpcrypto}",
"at.asitplus.crypto:datatypes-jws:${VcLibVersions.kmpcrypto}",
datetime(),
"com.squareup.okio:okio:${VcLibVersions.okio}",
"at.asitplus.crypto:datatypes:${VcLibVersions.kmpcrypto}", //for iosExport
"io.matthewnelson.kotlin-components:encoding-base16:${VcLibVersions.encoding}",
"io.matthewnelson.kotlin-components:encoding-base64:${VcLibVersions.encoding}"
)

inline fun KotlinDependencyHandler.commonImplementationAndApiDependencies() {
commonApiDependencies().forEach { dep -> api(dep) }
commonImplementationDependencies()
}

inline fun KotlinDependencyHandler.commonImplementationDependencies() {
implementation(ktor("http"))
implementation(napier())
implementation(ktor("utils"))
implementation("com.benasher44:uuid:${VcLibVersions.uuid}")
}

fun commonIosExports() = arrayOf(
datetime(),
"com.ionspin.kotlin:bignum:${VcLibVersions.bignum}",
kmmresult(),
"at.asitplus.crypto:datatypes:${VcLibVersions.kmpcrypto}",
"at.asitplus.crypto:datatypes-cose:${VcLibVersions.kmpcrypto}",
"at.asitplus.crypto:datatypes-jws:${VcLibVersions.kmpcrypto}",
"io.matthewnelson.kotlin-components:encoding-base16:${VcLibVersions.encoding}",
"io.matthewnelson.kotlin-components:encoding-base64:${VcLibVersions.encoding}",
)


class VcLibConventions : Plugin<Project> {
override fun apply(target: Project) {
target.plugins.apply("at.asitplus.gradle.conventions")
}
}

3 changes: 2 additions & 1 deletion conventions-vclib/src/main/kotlin/VcLibVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ object VcLibVersions {
const val resultlib = "1.5.3"
const val encoding = "1.2.3"
const val okio = "3.5.0"
const val kmpcrypto = "2.3.0"
const val kmpcrypto = "2.5.0"
const val bignum = "0.3.9"

object Jvm {
const val `jose-jwt` = "9.31"
Expand Down
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ kotlin.native.binary.freezing=disabled
kotlin.native.ignoreDisabledTargets=true
kotlin.experimental.tryK2=false

#https://youtrack.jetbrains.com/issue/KT-65315/KMP-Composite-compileIosMainKotlinMetadata-fails-with-Could-not-find-included-iOS-dependency
kotlin.mpp.hierarchicalStructureSupport=false

# workaround dokka bug (need to wait for next snapshot build)
org.jetbrains.dokka.classpath.excludePlatformDependencyFiles=true
Expand Down
2 changes: 1 addition & 1 deletion kmp-crypto
21 changes: 14 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@ pluginManagement {
}
}


includeBuild("kmp-crypto") {
dependencySubstitution {
substitute(module("at.asitplus.crypto:datatypes")).using(project(":datatypes"))
substitute(module("at.asitplus.crypto:datatypes-jws")).using(project(":datatypes-jws"))
substitute(module("at.asitplus.crypto:datatypes-cose")).using(project(":datatypes-cose"))
if (System.getProperty("publishing.excludeIncludedBuilds") != "true") {
includeBuild("kmp-crypto") {
dependencySubstitution {
substitute(module("at.asitplus.crypto:datatypes")).using(project(":datatypes"))
substitute(module("at.asitplus.crypto:datatypes-jws")).using(
project(
":datatypes-jws"
)
)
substitute(module("at.asitplus.crypto:datatypes-cose")).using(
project(":datatypes-cose")
)
}
}
}
} else logger.lifecycle("Excluding KMP Crypto from this build")

rootProject.name = "vclibrary"
include(":vclib")
Expand Down
19 changes: 8 additions & 11 deletions vclib-aries/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,26 @@ version = artifactVersion


kotlin {
ios()
iosSimulatorArm64()

jvm()
iosArm64()
iosSimulatorArm64()
iosX64()
sourceSets {

val commonMain by getting {
commonMain {
dependencies {
commonImplementationDependencies()
api(project(":vclib"))
commonImplementationDependencies()
}
}
val commonTest by getting

val iosMain by getting
val iosSimulatorArm64Main by getting { dependsOn(iosMain) }
val iosTest by getting

val jvmMain by getting {
jvmMain {
dependencies {
implementation(bouncycastle("bcprov"))
}
}
val jvmTest by getting {
jvmTest {
dependencies {
implementation("com.nimbusds:nimbus-jose-jwt:${VcLibVersions.Jvm.`jose-jwt`}")
implementation("org.json:json:${VcLibVersions.Jvm.json}")
Expand Down
21 changes: 9 additions & 12 deletions vclib-openid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,27 @@ version = artifactVersion


kotlin {
ios()
iosSimulatorArm64()

jvm()
iosArm64()
iosSimulatorArm64()
iosX64()
sourceSets {

val commonMain by getting {
commonMain {
dependencies {
commonImplementationDependencies()
api("at.asitplus.crypto:datatypes-jws:${VcLibVersions.kmpcrypto}")
api(project(":vclib"))
commonImplementationDependencies()
}
}
val commonTest by getting

val iosMain by getting
val iosSimulatorArm64Main by getting { dependsOn(iosMain) }
val iosTest by getting

val jvmMain by getting {
jvmMain {
dependencies {
implementation(bouncycastle("bcprov"))
}
}
val jvmTest by getting {

jvmTest {
dependencies {
implementation("com.nimbusds:nimbus-jose-jwt:${VcLibVersions.Jvm.`jose-jwt`}")
implementation("org.json:json:${VcLibVersions.Jvm.json}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class OidcSiopWallet(

private fun extractRequestObject(params: AuthenticationRequestParameters): AuthenticationRequestParameters? {
params.request?.let { requestObject ->
parseRequestObjectJws(requestObject)
return parseRequestObjectJws(requestObject)
}
return null
}
Expand Down
Loading
Loading