Skip to content

Commit

Permalink
Default ion creation sets assertion method (#93)
Browse files Browse the repository at this point in the history
Default ion creation sets assertion method
  • Loading branch information
phoebe-lew authored Oct 24, 2023
1 parent 4f9f3ef commit edf3a7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dids/src/main/kotlin/web5/sdk/dids/DidIonManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public sealed class DidIonManager(
id = verificationMethodId,
type = "JsonWebKey2020",
publicKeyJwk = verificationJwk,
purposes = listOf(PublicKeyPurpose.AUTHENTICATION),
purposes = listOf(PublicKeyPurpose.AUTHENTICATION, PublicKeyPurpose.ASSERTION_METHOD),
)
} else {
options.verificationPublicKey
Expand Down
10 changes: 9 additions & 1 deletion dids/src/test/kotlin/web5/sdk/dids/DidResolversTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package web5.sdk.dids

import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
import web5.sdk.crypto.InMemoryKeyManager

Expand All @@ -11,4 +11,12 @@ class DidResolversTest {
fun `it works`() {
DidResolvers.resolve("did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp", null)
}

@Test
fun `resolving a default ion did contains assertion method`() {
val ionDid = DidIonManager.create(InMemoryKeyManager())

val resolutionResult= DidResolvers.resolve(ionDid.uri)
assertNotNull(resolutionResult.didDocument.assertionMethodVerificationMethodsDereferenced)
}
}

0 comments on commit edf3a7d

Please sign in to comment.