Skip to content

Commit

Permalink
Merge pull request #61 from sicpa-dlab/0.3.2_release
Browse files Browse the repository at this point in the history
0.3.2 release
  • Loading branch information
Artemkaaas authored Aug 18, 2022
2 parents b1d4924 + 5a47a40 commit 3db918e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

version=0.3.1
version=0.3.2
group=org.didcommx

kotlinJvm=1.5.21
Expand Down
12 changes: 10 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ kotlin {
dependencies {
implementation "com.nimbusds:nimbus-jose-jwt:${nimbusJoseJWTVersion}"
implementation "com.github.multiformats:java-multibase:${javaMultibase}"
shadow "com.google.crypto.tink:tink:${googleTinkVersion}"
implementation "com.google.code.gson:gson:2.9.0"
implementation 'com.google.protobuf:protobuf-java:3.20.1'
shadow("com.google.crypto.tink:tink:${googleTinkVersion}") {
exclude group: 'com.google.code.gson', module: 'gson'
exclude group: 'com.google.protobuf', module: 'protobuf-java'
}
shadow "com.zmannotes:varint:${zmanVarint}"
// implementation 'org.bouncycastle:bcprov-jdk15on:1.69'

// TODO look for a better solution
// currently it's a workaround for shadow of the above deps
testImplementation "com.google.crypto.tink:tink:${googleTinkVersion}"
testImplementation("com.google.crypto.tink:tink:${googleTinkVersion}") {
exclude group: 'com.google.code.gson', module: 'gson'
exclude group: 'com.google.protobuf', module: 'protobuf-java'
}
testImplementation "com.zmannotes:varint:${zmanVarint}"

testImplementation "org.jetbrains.kotlin:kotlin-test"
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/kotlin/org/didcommx/didcomm/diddoc/DIDDoc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ data class DIDCommService(
val id: String,
val serviceEndpoint: String,
val routingKeys: List<String>,
val accept: List<String>
val accept: List<String>?
)
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal fun findDIDCommService(
if (serviceId != null) {
val didService = didDoc.findDIDCommService(serviceId)

if (PROFILE_DIDCOMM_V2 !in didService.accept) {
if (didService.accept != null && !didService.accept.isEmpty() && PROFILE_DIDCOMM_V2 !in didService.accept) {
throw DIDCommServiceException(
toDid, "service '$serviceId' does not accept didcomm/v2 profile"
)
Expand All @@ -73,7 +73,7 @@ internal fun findDIDCommService(
// > by protocol availability or preference.
// https://identity.foundation/didcomm-messaging/spec/#multiple-endpoints
return try {
didDoc.didCommServices.find { PROFILE_DIDCOMM_V2 in it.accept }
didDoc.didCommServices.find { it.accept == null || it.accept.isEmpty() || PROFILE_DIDCOMM_V2 in it.accept }
} catch (e: DIDDocException) {
null
}
Expand Down

0 comments on commit 3db918e

Please sign in to comment.