Interoperability
--
-
- With RootsID's mediator https://github.com/roots-id/didcomm-mediator/tree/main -
-
-
- invitation:
https://mediator.rootsid.cloud/?_oob=eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9vdXQtb2YtYmFuZC8yLjAvaW52aXRhdGlvbiIsImlkIjoiNzk0Mjc4MzctY2MwNi00ODUzLWJiMzktNjg2ZWFjM2U2YjlhIiwiZnJvbSI6ImRpZDpwZWVyOjIuRXo2TFNtczU1NVloRnRobjFXVjhjaURCcFptODZoSzl0cDgzV29qSlVteFBHazFoWi5WejZNa21kQmpNeUI0VFM1VWJiUXc1NHN6bTh5dk1NZjFmdEdWMnNRVllBeGFlV2hFLlNleUpwWkNJNkltNWxkeTFwWkNJc0luUWlPaUprYlNJc0luTWlPaUpvZEhSd2N6b3ZMMjFsWkdsaGRHOXlMbkp2YjNSemFXUXVZMnh2ZFdRaUxDSmhJanBiSW1ScFpHTnZiVzB2ZGpJaVhYMCIsImJvZHkiOnsiZ29hbF9jb2RlIjoicmVxdWVzdC1tZWRpYXRlIiwiZ29hbCI6IlJlcXVlc3RNZWRpYXRlIiwibGFiZWwiOiJNZWRpYXRvciIsImFjY2VwdCI6WyJkaWRjb21tL3YyIl19fQ
-
Scala DID
+Scala DID is a Scala/ScalaJS library for DID and DIDcomm v2.
+DIDComm is a secure messaging protocol for decentralized identities (DIDs). + This library allows you to easily integrate DIDComm messaging into your application.
+The one of the main goals of this library is to make DID Comm v2 type safety and easy to use.
+The repository also contes the LIVE DEMO (DIDComm's Sandbox) + The PoC Mediator was move to the Atala PRISM DID Comm Mediator where a production ready mediator is being developed and maintain.
+ +Badges
+ + + +Design Goals
+ +Specification compliant
+We tryied to follow the DID Comm Specification.
+ +Purely Functional
+The Library API is purely functional. + The internal implementetion tries also to be purely functional, and any call to the dependency libory (for cryptography) encapsulates and handel the error in a Functional way. + All the error are value so the user know exactly what to expect by the signatures of the methods.
+ +Simples to use
+"But I just want to send/read a message!"
- We are create a Framework to facilitate some of the mundane tasks and boilerplate code. Like to open ws connections or making http calls.
We also have an implementation for most of the DID Comm Protocalls of the official repository.
diff --git a/external-documentation.html b/01-about/09-external-documentation.html similarity index 83% rename from external-documentation.html rename to 01-about/09-external-documentation.html index 41187b1b..a3d7a39a 100644 --- a/external-documentation.html +++ b/01-about/09-external-documentation.html @@ -20,9 +20,9 @@ - - - + + + @@ -40,7 +40,7 @@ - +
External documentation
diff --git a/quickstart-setup-environment.html b/02-quickstart/01-setup-environment.html similarity index 64% rename from quickstart-setup-environment.html rename to 02-quickstart/01-setup-environment.html index dd60b557..da2a6bc5 100644 --- a/quickstart-setup-environment.html +++ b/02-quickstart/01-setup-environment.html @@ -20,9 +20,9 @@ - - - + + + @@ -40,7 +40,7 @@ - +
scala-cli repl \
- --dependency app.fmgp::did::0.1.0-M16 \
- --dependency app.fmgp::did-imp::0.1.0-M16 \
- --dependency app.fmgp::did-method-peer::0.1.0-M16 \
+ --dependency app.fmgp::did::0.1.0-M16+2-63d61e64-SNAPSHOT \
+ --dependency app.fmgp::did-imp::0.1.0-M16+2-63d61e64-SNAPSHOT \
+ --dependency app.fmgp::did-method-peer::0.1.0-M16+2-63d61e64-SNAPSHOT \
--repo https://oss.sonatype.org/content/repositories/releases
# For snapshots use
@@ -139,25 +142,25 @@ SBT setup
To install the library on sbt
, you can use the following lines to your build.sbt
:
- libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16
- libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16 // for the DIDComm implementation
- libraryDependencies += "app.fmgp" %% "did-resolver-peer" % 0.1.0-M16 // for hash utils
+ libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16+2-63d61e64-SNAPSHOT
+ libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for the DIDComm implementation
+ libraryDependencies += "app.fmgp" %% "did-resolver-peer" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for hash utils
In a crossProject for the JSPlatform and JVMPlatform this shoud use this instead:
- libraryDependencies += "app.fmgp" %%% "did" % 0.1.0-M16
- libraryDependencies += "app.fmgp" %%% "did-imp" % 0.1.0-M16 // for the DIDComm implementation
- libraryDependencies += "app.fmgp" %%% "did-resolver-peer" % 0.1.0-M16 // for hash utils
+ libraryDependencies += "app.fmgp" %%% "did" % 0.1.0-M16+2-63d61e64-SNAPSHOT
+ libraryDependencies += "app.fmgp" %%% "did-imp" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for the DIDComm implementation
+ libraryDependencies += "app.fmgp" %%% "did-resolver-peer" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for hash utils
Coursier Download
- coursier fetch app.fmgp:did_3:0.1.0-M16 -r sonatype:snapshots
+ coursier fetch app.fmgp:did_3:0.1.0-M16+2-63d61e64-SNAPSHOT -r sonatype:snapshots
# -r https://oss.sonatype.org/content/repositories/snapshots
-coursier fetch app.fmgp:did_3:0.1.0-M16 -r sonatype:public
+coursier fetch app.fmgp:did_3:0.1.0-M16+2-63d61e64-SNAPSHOT -r sonatype:public
# -r https://oss.sonatype.org/content/repositories/releases
diff --git a/readme.html b/02-quickstart/02-install-dependency.html
similarity index 66%
rename from readme.html
rename to 02-quickstart/02-install-dependency.html
index 42366d5d..cd89e9a0 100644
--- a/readme.html
+++ b/02-quickstart/02-install-dependency.html
@@ -6,7 +6,7 @@
- Scala-did
+ Import Library
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -105,71 +108,68 @@
- Scala-did
- A Scala & Scala.js implementation of DID and DID Comm messaging spec.
- DIDComm is a secure messaging protocol for decentralized identities (DIDs).
- This library allows you to easily integrate DIDComm messaging into your application.
+ Import Library
+ The frist step is to import the Library that you need.
Getting Started with Scala-did
To install ScalaDID in a scala project
- libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16 // for DID and DID Comm
- libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16 // for crypto implementation
- libraryDependencies += "app.fmgp" %% "did-framework" % 0.1.0-M16 //for utils
- libraryDependencies += "app.fmgp" %% "did-peer" % 0.1.0-M16 // for resolver of the did method `peer`
- libraryDependencies += "app.fmgp" %% "did-web" % 0.1.0-M16 // for resolver the did method `web`
- libraryDependencies += "app.fmgp" %% "did-uniresolver" % 0.1.0-M16 // for calling the resolver uniresolver
+ libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for DID and DID Comm
+ libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for crypto implementation
+ libraryDependencies += "app.fmgp" %% "did-framework" % 0.1.0-M16+2-63d61e64-SNAPSHOT //for utils
+ libraryDependencies += "app.fmgp" %% "did-peer" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for resolver of the did method `peer`
+ libraryDependencies += "app.fmgp" %% "did-web" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for resolver the did method `web`
+ libraryDependencies += "app.fmgp" %% "did-uniresolver" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for calling the resolver uniresolver
In a crossProject for the JSPlatform and JVMPlatform this should be %%%
instead of %%
+ You can check the latest available of versions (for JVM and JS) in here:
+
- Site Map
-
- - This readme Scala-did (REAMDE.md)
- - External documentation
- - Quickstart
-
-
- - Get Started
-
-
- - Basic Examples
-
+ Modules
+ Let got module by module
-
- Setup Environment
-
- - scala-cli on docker- recommended way just to get the feeling of the library
- - sbt setup - for any project.
- - coursier download
- with some code samples
-
+ did
-
+
+ -
+
did-imp
+
+ -
+
did-framework
+
+ -
+
did-peer
& did-web
is our implementation of of the did:peer
and did:web
methods.
+
+ -
+
did-uniresolver
is an intregation with the uniresolver.
+ So you can use the uniresolver to resolver the did methods
.
+ You can use the publicly available uniresolver or a custom one.
+
+ -
+
did-example
is just a list DID knowd identities, Like mediator and other agents. Also, contends some utilities.
+
+ -
+
multiformats
is our implementation of Multiformats used by did-peer
- - Test
-
-
- - Test coverage
-
-
diff --git a/example.js.html b/02-quickstart/03-imports.html
similarity index 73%
rename from example.js.html
rename to 02-quickstart/03-imports.html
index 79aac1d2..80f072a7 100644
--- a/example.js.html
+++ b/02-quickstart/03-imports.html
@@ -6,7 +6,7 @@
- Example JS
+ Config imports
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -105,33 +108,31 @@
- Example JS
- To install my project
- import org.scalajs.dom.window._
-import jsdocs._
-
-val progress = new Progress()
-node.innerHTML = progress.tick(5)
-setInterval({ () =>
- // `node` variable is a DOM element in scope.
- node.innerHTML = progress.tick(5)
-}, 100)
+ Config imports
+
+ Common Imports
+ Here are the usfull imports for most of the cases:
+ import zio._
+import zio.json._
+import fmgp.did._
+import fmgp.did.comm._
diff --git a/quickstart-basic-examples.html b/02-quickstart/04-basic-examples.html
similarity index 58%
rename from quickstart-basic-examples.html
rename to 02-quickstart/04-basic-examples.html
index a5af6b95..ed1530ad 100644
--- a/quickstart-basic-examples.html
+++ b/02-quickstart/04-basic-examples.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -108,14 +111,14 @@
-
+
@@ -123,13 +126,6 @@
Basic Example
- Common Imports
- Here are the usfull imports for most of the cases:
- import zio._
-import zio.json._
-import fmgp.did._
-import fmgp.did.comm._
-
Parse a DID Document
val documentString = """{
"@context": "https://www.w3.org/ns/did/v1",
@@ -178,27 +174,26 @@ "not a json".fromJson[DIDDocument]
// res1: Either[String, DIDDocument] = Left(value = "(expected '{' got 'n')")
- """{"some_json": "but_not_a_valid_document"}"""
- .fromJson[DIDDocument]
+ """{"some_json": "but_not_a_valid_document"}""".fromJson[DIDDocument]
// res2: Either[String, DIDDocument] = Left(value = ".id(missing)")
Another Important Point is that there is no failed here everywhere on this library! We work with values.
(Any error/exception will be considered a bug and reports are appreciated)
This this allowed us to this allowed us to build programs build (ZIO) programs. That can are executed at any point in time.
Make DID Peer identities
- import fmgp.crypto._
-import fmgp.did.method.peer._
+ import fmgp.crypto.*
+import fmgp.did.method.peer.*
-val sender = DIDPeer2.makeAgent(
+val alice = DIDPeer2.makeAgent(
Seq(
- OKPPrivateKey(// keyAgreement
+ OKPPrivateKey( // keyAgreement
kty = KTY.OKP,
crv = Curve.X25519,
d = "Z6D8LduZgZ6LnrOHPrMTS6uU2u5Btsrk1SGs4fn8M7c",
x = "Sr4SkIskjN_VdKTn0zkjYbhGTWArdUNE4j_DmUpnQGw",
kid = None
),
- OKPPrivateKey(//keyAuthentication
+ OKPPrivateKey( // keyAuthentication
kty = KTY.OKP,
crv = Curve.Ed25519,
d = "INXCnxFEl0atLIIQYruHzGd5sUivMRyQOzu87qVerug",
@@ -207,46 +202,124 @@ Seq(DIDPeerServiceEncoded("https://alice.did.fmgp.app/"))
-)
+)
+// alice: AgentDIDPeer = fmgp.did.method.peer.DIDPeer2$$anon$4@4f82c453
+
+alice.id.asDIDSubject
+// res3: DIDSubject = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
+
+alice.id.document.toJsonPretty
+// res4: String = """{
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// "authentication" : [
+// {
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd",
+// "controller" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// "type" : "JsonWebKey2020",
+// "publicKeyJwk" : {
+// "kty" : "OKP",
+// "crv" : "Ed25519",
+// "x" : "MBjnXZxkMcoQVVL21hahWAw43RuAG-i64ipbeKKqwoA"
+// }
+// }
+// ],
+// "keyAgreement" : [
+// {
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y",
+// "controller" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// "type" : "JsonWebKey2020",
+// "publicKeyJwk" : {
+// "kty" : "OKP",
+// "crv" : "X25519",
+// "x" : "Sr4SkIskjN_VdKTn0zkjYbhGTWArdUNE4j_DmUpnQGw"
+// }
+// }
+// ],
+// "service" : [
+// {
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#didcommmessaging-0",
+// "type" : "DIDCommMessaging",
+// "serviceEndpoint" : {
+// "uri" : "https://alice.did.fmgp.app/",
+// "accept" : [
+// "didcomm/v2"
+// ...
+
+ Resolve did:peer identities
+ import fmgp.did.method.peer.*
+
+val program1 = DidPeerResolver.didDocument(DIDPeer(alice.id.asDIDSubject))
+// program1: ZIO[Any, Nothing, DIDDocument] = Sync(
+// trace = "fmgp.did.method.peer.DidPeerResolver.genesisDocument(DidPeerResolver.scala:32)",
+// eval = zio.ZIOCompanionVersionSpecific$$Lambda$19107/0x0000000804900040@6f74f3...
+
+Unsafe.unsafe { implicit unsafe => // Run side effect
+ Runtime.default.unsafe
+ .run(program1)
+ .getOrThrowFiberFailure()
+}
+// res5: DIDDocument = DIDDocumentClass(
+// id = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// ...
Trust Ping example
- import fmgp.did.comm.protocol.trustping2._ // For the protocol specific stuff
+ import fmgp.did.comm.protocol.trustping2.* // For the protocol // For the protocol
val ping = TrustPingWithRequestedResponse(
- from = yeah exactly.id,
+ from = alice.id,
to = TO("did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ")
)
-
+// ping: TrustPingWithRequestedResponse = TrustPingWithRequestedResponse(
+// id = "30a2dfdb-e5bc-4224-ab4b-6bd185888834",
+// from = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// to = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
+// )
+
ping.toPlaintextMessage.toJsonPretty
-// val res0: String = {
-// "id" : "3dda13f7-daa3-4ccf-a3f0-9f5f5a8fad47",
+// res6: String = """{
+// "id" : "30a2dfdb-e5bc-4224-ab4b-6bd185888834",
// "type" : "https://didcomm.org/trust-ping/2.0/ping",
// "to" : [
-// "did:peer:2.Ez6LSkGy3e2z54uP4U9HyXJXRpaF2ytsnTuVgh6SNNmCyGZQZ.Vz6Mkjdwvf9hWc6ibZndW9B97si92DSk9hWAhGYBgP9kUFk8Z.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9ib2IuZGlkLmZtZ3AuYXBwLyIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX0"
+// "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
// ],
// "from" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
// "body" : {
// "response_requested" : true
-// }
-// }
+// },
+// "typ" : "application/didcomm-plain+json"
+// }"""
Encrypt
- import Operations._
-val program = for {
+ import Operations.*
+
+val program2 = for {
msg <- authEncrypt(ping.toPlaintextMessage).provideSomeLayer(ZLayer.succeed(alice))
_ <- Console.printLine(msg.toJsonPretty)
-} yield ()
-
-Unsafe.unsafe { implicit unsafe => // Run side effect
+} yield ()
+ Unsafe.unsafe { implicit unsafe => // Run side effect
Runtime.default.unsafe
- .run(program.provide(Operations.layerDefault ++ DidPeerResolver.layer))
+ .run(program2.provide(Operations.layerDefault ++ DidPeerResolver.layer))
.getOrThrowFiberFailure()
-}
+}
+// {
+// "ciphertext" : "-VzKHkBgziPsmpJ0erp9-ZfcNXTLirp-Hy25kZXknTno2TZk1rkbztwLzvhvnzizusvmeffbMgbd_PaYrRe_6liXIdTfE7vEdWMrb5AjGcD6C4D9G_JVMW6378Ip-Bae50iw-M1hDNg0UPDOaSMhuqPtS5O7-NhI9wkeGul9_gR8rVP7U9fJz43MIjFNiyzEDy6FAqWOvYjnbV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
+// }
+// ],
+// "tag" : "AdQxtGVpToXknTzUo2yJqhAW5q8B1Y2XBFCA6_-WvF8",
+// "iv" : "yKsTwk8NcBwF5H4gP3qtTA"
+// }
diff --git a/quickstart-get-started.html b/02-quickstart/05-did-comm-examples.html
similarity index 85%
rename from quickstart-get-started.html
rename to 02-quickstart/05-did-comm-examples.html
index 4135c3b5..02afda86 100644
--- a/quickstart-get-started.html
+++ b/02-quickstart/05-did-comm-examples.html
@@ -6,7 +6,7 @@
- Getting Started with DIDComm Messaging in Scala
+ Getting Started with DIDComm Messaging
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -105,19 +108,19 @@
- Getting Started with DIDComm Messaging in Scala
+ Getting Started with DIDComm Messaging
Here's a basic example of how to send a message using the library:
import zio._
import zio.json._
@@ -132,7 +135,7 @@ Getting S
from = Some(FROM("did:example:456")),
)
// message: BasicMessage = BasicMessage(
-// id = "389f090a-1180-4ca0-8bd0-daecfbf03f7d",
+// id = "2df02e51-0294-4699-945d-c8615b4fdd70",
// to = Set("did:example:123"),
// from = Some(value = "did:example:456"),
// lang = None,
@@ -143,7 +146,7 @@ Getting S
message.toPlaintextMessage.toJsonPretty
// res0: String = """{
-// "id" : "389f090a-1180-4ca0-8bd0-daecfbf03f7d",
+// "id" : "2df02e51-0294-4699-945d-c8615b4fdd70",
// "type" : "https://didcomm.org/basicmessage/2.0/message",
// "to" : [
// "did:example:123"
@@ -165,7 +168,7 @@
diff --git a/limitations.html b/08-others/limitations.html
similarity index 86%
rename from limitations.html
rename to 08-others/limitations.html
index 4c92c8ef..10c1ece9 100644
--- a/limitations.html
+++ b/08-others/limitations.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -112,7 +115,7 @@
Warning about arbitrary JSON
-
+
@@ -152,7 +155,7 @@
diff --git a/test-coverage.html b/08-others/test-coverage.html
similarity index 75%
rename from test-coverage.html
rename to 08-others/test-coverage.html
index 9f41aa1e..9ffdae23 100644
--- a/test-coverage.html
+++ b/08-others/test-coverage.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -108,12 +111,14 @@
-
+
@@ -121,12 +126,14 @@
Test coverage
- sbt clean coverage testJVM
- Run test
+ sbt clean coverage testJVM
- Run tests
sbt coverageReport
- Generate reports
sbt coverageAggregate
- Aggregate reports
Report
+
+ Statement coverage
@@ -137,6 +144,7 @@ did-framework
did-resolver-web
did-resolver-peer
+ uniresolver
multiformats
@@ -150,17 +158,60 @@ 81.58 %
27.50 %
NA
+ NA
2022-01-31
18.88 %
14.25 %
39.63 %
- 19.53 %
+ NA
81.58 %
34.58 %
+ NA
85.77 %
+
+ 2023-12-01
+ 12.79 %
+ 10.82 %
+ 44.02 %
+ NA
+ 81.58 %
+ 81.58 %
+ 12.33
+ 85.77 %
+
+
+
+
+ Branch coverage
+
+
+
+ date
+ all
+ did
+ did-imp
+ did-framework
+ did-resolver-web
+ did-resolver-peer
+ uniresolver
+ multiformats
+
+
+
+
+ 2023-12-01
+ 36.65 %
+ 29.70 %
+ 30.77 %
+ NA
+ 75.00 %
+ 0 %?
+ 100.00 %
+ 81.82 %
+
@@ -181,7 +232,7 @@
diff --git a/troubleshooting.html b/08-others/troubleshooting.html
similarity index 83%
rename from troubleshooting.html
rename to 08-others/troubleshooting.html
index d162bb7e..a2652ce5 100644
--- a/troubleshooting.html
+++ b/08-others/troubleshooting.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -110,7 +113,7 @@
-
+
@@ -145,7 +148,7 @@ Troubleshooting
diff --git a/index.html b/index.html
index 3130e886..110f0ef0 100644
--- a/index.html
+++ b/index.html
@@ -49,19 +49,11 @@ A Scala & Scala.js implementation of DID and DID Comm messaging spec
Documentation
- - README
+ - About
- - Quickstart
+ - Quickstart
- - Examples
-
- - Test Coverage
-
- - Limitations
-
- - Troubleshooting
-
- - Tools and Links
+ - Tools and Links
- Scaladoc
SBT setup
To install the library on sbt
, you can use the following lines to your build.sbt
:
libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16
- libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16 // for the DIDComm implementation
- libraryDependencies += "app.fmgp" %% "did-resolver-peer" % 0.1.0-M16 // for hash utils
+ libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16+2-63d61e64-SNAPSHOT
+ libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for the DIDComm implementation
+ libraryDependencies += "app.fmgp" %% "did-resolver-peer" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for hash utils
In a crossProject for the JSPlatform and JVMPlatform this shoud use this instead:
- libraryDependencies += "app.fmgp" %%% "did" % 0.1.0-M16
- libraryDependencies += "app.fmgp" %%% "did-imp" % 0.1.0-M16 // for the DIDComm implementation
- libraryDependencies += "app.fmgp" %%% "did-resolver-peer" % 0.1.0-M16 // for hash utils
+ libraryDependencies += "app.fmgp" %%% "did" % 0.1.0-M16+2-63d61e64-SNAPSHOT
+ libraryDependencies += "app.fmgp" %%% "did-imp" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for the DIDComm implementation
+ libraryDependencies += "app.fmgp" %%% "did-resolver-peer" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for hash utils
Coursier Download
-coursier fetch app.fmgp:did_3:0.1.0-M16 -r sonatype:snapshots
+ coursier fetch app.fmgp:did_3:0.1.0-M16+2-63d61e64-SNAPSHOT -r sonatype:snapshots
# -r https://oss.sonatype.org/content/repositories/snapshots
-coursier fetch app.fmgp:did_3:0.1.0-M16 -r sonatype:public
+coursier fetch app.fmgp:did_3:0.1.0-M16+2-63d61e64-SNAPSHOT -r sonatype:public
# -r https://oss.sonatype.org/content/repositories/releases
diff --git a/readme.html b/02-quickstart/02-install-dependency.html
similarity index 66%
rename from readme.html
rename to 02-quickstart/02-install-dependency.html
index 42366d5d..cd89e9a0 100644
--- a/readme.html
+++ b/02-quickstart/02-install-dependency.html
@@ -6,7 +6,7 @@
- Scala-did
+ Import Library
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -105,71 +108,68 @@
- Scala-did
- A Scala & Scala.js implementation of DID and DID Comm messaging spec.
- DIDComm is a secure messaging protocol for decentralized identities (DIDs).
- This library allows you to easily integrate DIDComm messaging into your application.
+ Import Library
+ The frist step is to import the Library that you need.
Getting Started with Scala-did
To install ScalaDID in a scala project
- libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16 // for DID and DID Comm
- libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16 // for crypto implementation
- libraryDependencies += "app.fmgp" %% "did-framework" % 0.1.0-M16 //for utils
- libraryDependencies += "app.fmgp" %% "did-peer" % 0.1.0-M16 // for resolver of the did method `peer`
- libraryDependencies += "app.fmgp" %% "did-web" % 0.1.0-M16 // for resolver the did method `web`
- libraryDependencies += "app.fmgp" %% "did-uniresolver" % 0.1.0-M16 // for calling the resolver uniresolver
+ libraryDependencies += "app.fmgp" %% "did" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for DID and DID Comm
+ libraryDependencies += "app.fmgp" %% "did-imp" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for crypto implementation
+ libraryDependencies += "app.fmgp" %% "did-framework" % 0.1.0-M16+2-63d61e64-SNAPSHOT //for utils
+ libraryDependencies += "app.fmgp" %% "did-peer" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for resolver of the did method `peer`
+ libraryDependencies += "app.fmgp" %% "did-web" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for resolver the did method `web`
+ libraryDependencies += "app.fmgp" %% "did-uniresolver" % 0.1.0-M16+2-63d61e64-SNAPSHOT // for calling the resolver uniresolver
In a crossProject for the JSPlatform and JVMPlatform this should be %%%
instead of %%
+ You can check the latest available of versions (for JVM and JS) in here:
+
- Site Map
-
- - This readme Scala-did (REAMDE.md)
- - External documentation
- - Quickstart
-
-
- - Get Started
-
-
- - Basic Examples
-
+ Modules
+ Let got module by module
-
- Setup Environment
-
- - scala-cli on docker- recommended way just to get the feeling of the library
- - sbt setup - for any project.
- - coursier download
- with some code samples
-
+ did
-
+
+ -
+
did-imp
+
+ -
+
did-framework
+
+ -
+
did-peer
& did-web
is our implementation of of the did:peer
and did:web
methods.
+
+ -
+
did-uniresolver
is an intregation with the uniresolver.
+ So you can use the uniresolver to resolver the did methods
.
+ You can use the publicly available uniresolver or a custom one.
+
+ -
+
did-example
is just a list DID knowd identities, Like mediator and other agents. Also, contends some utilities.
+
+ -
+
multiformats
is our implementation of Multiformats used by did-peer
- - Test
-
-
- - Test coverage
-
-
diff --git a/example.js.html b/02-quickstart/03-imports.html
similarity index 73%
rename from example.js.html
rename to 02-quickstart/03-imports.html
index 79aac1d2..80f072a7 100644
--- a/example.js.html
+++ b/02-quickstart/03-imports.html
@@ -6,7 +6,7 @@
- Example JS
+ Config imports
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -105,33 +108,31 @@
- Example JS
- To install my project
- import org.scalajs.dom.window._
-import jsdocs._
-
-val progress = new Progress()
-node.innerHTML = progress.tick(5)
-setInterval({ () =>
- // `node` variable is a DOM element in scope.
- node.innerHTML = progress.tick(5)
-}, 100)
+ Config imports
+
+ Common Imports
+ Here are the usfull imports for most of the cases:
+ import zio._
+import zio.json._
+import fmgp.did._
+import fmgp.did.comm._
diff --git a/quickstart-basic-examples.html b/02-quickstart/04-basic-examples.html
similarity index 58%
rename from quickstart-basic-examples.html
rename to 02-quickstart/04-basic-examples.html
index a5af6b95..ed1530ad 100644
--- a/quickstart-basic-examples.html
+++ b/02-quickstart/04-basic-examples.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -108,14 +111,14 @@
-
+
@@ -123,13 +126,6 @@
Basic Example
- Common Imports
- Here are the usfull imports for most of the cases:
- import zio._
-import zio.json._
-import fmgp.did._
-import fmgp.did.comm._
-
Parse a DID Document
val documentString = """{
"@context": "https://www.w3.org/ns/did/v1",
@@ -178,27 +174,26 @@ "not a json".fromJson[DIDDocument]
// res1: Either[String, DIDDocument] = Left(value = "(expected '{' got 'n')")
- """{"some_json": "but_not_a_valid_document"}"""
- .fromJson[DIDDocument]
+ """{"some_json": "but_not_a_valid_document"}""".fromJson[DIDDocument]
// res2: Either[String, DIDDocument] = Left(value = ".id(missing)")
Another Important Point is that there is no failed here everywhere on this library! We work with values.
(Any error/exception will be considered a bug and reports are appreciated)
This this allowed us to this allowed us to build programs build (ZIO) programs. That can are executed at any point in time.
Make DID Peer identities
- import fmgp.crypto._
-import fmgp.did.method.peer._
+ import fmgp.crypto.*
+import fmgp.did.method.peer.*
-val sender = DIDPeer2.makeAgent(
+val alice = DIDPeer2.makeAgent(
Seq(
- OKPPrivateKey(// keyAgreement
+ OKPPrivateKey( // keyAgreement
kty = KTY.OKP,
crv = Curve.X25519,
d = "Z6D8LduZgZ6LnrOHPrMTS6uU2u5Btsrk1SGs4fn8M7c",
x = "Sr4SkIskjN_VdKTn0zkjYbhGTWArdUNE4j_DmUpnQGw",
kid = None
),
- OKPPrivateKey(//keyAuthentication
+ OKPPrivateKey( // keyAuthentication
kty = KTY.OKP,
crv = Curve.Ed25519,
d = "INXCnxFEl0atLIIQYruHzGd5sUivMRyQOzu87qVerug",
@@ -207,46 +202,124 @@ Seq(DIDPeerServiceEncoded("https://alice.did.fmgp.app/"))
-)
+)
+// alice: AgentDIDPeer = fmgp.did.method.peer.DIDPeer2$$anon$4@4f82c453
+
+alice.id.asDIDSubject
+// res3: DIDSubject = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
+
+alice.id.document.toJsonPretty
+// res4: String = """{
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// "authentication" : [
+// {
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd",
+// "controller" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// "type" : "JsonWebKey2020",
+// "publicKeyJwk" : {
+// "kty" : "OKP",
+// "crv" : "Ed25519",
+// "x" : "MBjnXZxkMcoQVVL21hahWAw43RuAG-i64ipbeKKqwoA"
+// }
+// }
+// ],
+// "keyAgreement" : [
+// {
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y",
+// "controller" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// "type" : "JsonWebKey2020",
+// "publicKeyJwk" : {
+// "kty" : "OKP",
+// "crv" : "X25519",
+// "x" : "Sr4SkIskjN_VdKTn0zkjYbhGTWArdUNE4j_DmUpnQGw"
+// }
+// }
+// ],
+// "service" : [
+// {
+// "id" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#didcommmessaging-0",
+// "type" : "DIDCommMessaging",
+// "serviceEndpoint" : {
+// "uri" : "https://alice.did.fmgp.app/",
+// "accept" : [
+// "didcomm/v2"
+// ...
+
+ Resolve did:peer identities
+ import fmgp.did.method.peer.*
+
+val program1 = DidPeerResolver.didDocument(DIDPeer(alice.id.asDIDSubject))
+// program1: ZIO[Any, Nothing, DIDDocument] = Sync(
+// trace = "fmgp.did.method.peer.DidPeerResolver.genesisDocument(DidPeerResolver.scala:32)",
+// eval = zio.ZIOCompanionVersionSpecific$$Lambda$19107/0x0000000804900040@6f74f3...
+
+Unsafe.unsafe { implicit unsafe => // Run side effect
+ Runtime.default.unsafe
+ .run(program1)
+ .getOrThrowFiberFailure()
+}
+// res5: DIDDocument = DIDDocumentClass(
+// id = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// ...
Trust Ping example
- import fmgp.did.comm.protocol.trustping2._ // For the protocol specific stuff
+ import fmgp.did.comm.protocol.trustping2.* // For the protocol // For the protocol
val ping = TrustPingWithRequestedResponse(
- from = yeah exactly.id,
+ from = alice.id,
to = TO("did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ")
)
-
+// ping: TrustPingWithRequestedResponse = TrustPingWithRequestedResponse(
+// id = "30a2dfdb-e5bc-4224-ab4b-6bd185888834",
+// from = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
+// to = "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
+// )
+
ping.toPlaintextMessage.toJsonPretty
-// val res0: String = {
-// "id" : "3dda13f7-daa3-4ccf-a3f0-9f5f5a8fad47",
+// res6: String = """{
+// "id" : "30a2dfdb-e5bc-4224-ab4b-6bd185888834",
// "type" : "https://didcomm.org/trust-ping/2.0/ping",
// "to" : [
-// "did:peer:2.Ez6LSkGy3e2z54uP4U9HyXJXRpaF2ytsnTuVgh6SNNmCyGZQZ.Vz6Mkjdwvf9hWc6ibZndW9B97si92DSk9hWAhGYBgP9kUFk8Z.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9ib2IuZGlkLmZtZ3AuYXBwLyIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX0"
+// "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ"
// ],
// "from" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ",
// "body" : {
// "response_requested" : true
-// }
-// }
+// },
+// "typ" : "application/didcomm-plain+json"
+// }"""
Encrypt
- import Operations._
-val program = for {
+ import Operations.*
+
+val program2 = for {
msg <- authEncrypt(ping.toPlaintextMessage).provideSomeLayer(ZLayer.succeed(alice))
_ <- Console.printLine(msg.toJsonPretty)
-} yield ()
-
-Unsafe.unsafe { implicit unsafe => // Run side effect
+} yield ()
+ Unsafe.unsafe { implicit unsafe => // Run side effect
Runtime.default.unsafe
- .run(program.provide(Operations.layerDefault ++ DidPeerResolver.layer))
+ .run(program2.provide(Operations.layerDefault ++ DidPeerResolver.layer))
.getOrThrowFiberFailure()
-}
+}
+// {
+// "ciphertext" : "-VzKHkBgziPsmpJ0erp9-ZfcNXTLirp-Hy25kZXknTno2TZk1rkbztwLzvhvnzizusvmeffbMgbd_PaYrRe_6liXIdTfE7vEdWMrb5AjGcD6C4D9G_JVMW6378Ip-Bae50iw-M1hDNg0UPDOaSMhuqPtS5O7-NhI9wkeGul9_gR8rVP7U9fJz43MIjFNiyzEDy6FAqWOvYjnbV5JkBSCoFNnnSg6JTNRU6RzD9s_0n9QrxhtuLMDaLSe3GicRwRkIW727hU_BCIClUSAtu9o6Vu0eFPEqWOh8_s8epUrIbluK0WKtM8mKbZSf01VSbND0yayezz-KWOO59vgxDIn77QOUIb6k7BqgZF4IWj6tSut-IMJUgFqQcuRtLexkpymiAJSrICXEr4JdATTEAaHosRKoAPIWp6qiv6SCvyOTWsWXY-208JVZXoIm-FPfuxux-9mNUOL2j66xhkKfbgqVPjwyVVqx1giCzsyHEFKKkdEFDUqhfSZd0tpqY72PEjZBJh1v5TA0Jbn2aVBN6CNp7ZZ-LCDIs9UiKU2HBgD3TEMPjy2IMkuaULuTkrWqKjk-OjhOgRLgZbOlrSHynwRzJbNWPYRmBmhzLz1IGj01GJA2_IGvd46htD0PCtnTyVWHxMKvQETL99447Pxipc2T6eLh2oqe504gNXLbIlcTf3ONLKW3-cpslU3BZoD8tnI_XKzrb4dXVR0JJSwMLwbIIavJWgaHGwGlWLNHSg4OJ8gSOA9ZVVRUtbr0x6g2cRAfT0QVaJmINLx_NUmUOHhSPZb-CPlgi-R-w9flHDu2r4",
+// "protected" : "ey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MiOiJBMjU2Q0JDLUhTNTEyIiwiYWxnIjoiRUNESC0xUFUrQTI1NktXIn0",
+// "recipients" : [
+// {
+// "encrypted_key" : "sIgNjUOSWX3qEKrWNGzWc3zI2cj6OhT2I58iFB_JuPRcYZGE7Csigdj8tKM3Tp_x5704KYVtRczA2KiPcWXcnIm93pRgv7RM",
+// "header" : {
+// "kid" : "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9hbGljZS5kaWQuZm1ncC5hcHAvIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ#6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y"
+// }
+// }
+// ],
+// "tag" : "AdQxtGVpToXknTzUo2yJqhAW5q8B1Y2XBFCA6_-WvF8",
+// "iv" : "yKsTwk8NcBwF5H4gP3qtTA"
+// }
diff --git a/quickstart-get-started.html b/02-quickstart/05-did-comm-examples.html
similarity index 85%
rename from quickstart-get-started.html
rename to 02-quickstart/05-did-comm-examples.html
index 4135c3b5..02afda86 100644
--- a/quickstart-get-started.html
+++ b/02-quickstart/05-did-comm-examples.html
@@ -6,7 +6,7 @@
- Getting Started with DIDComm Messaging in Scala
+ Getting Started with DIDComm Messaging
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -105,19 +108,19 @@
- Getting Started with DIDComm Messaging in Scala
+ Getting Started with DIDComm Messaging
Here's a basic example of how to send a message using the library:
import zio._
import zio.json._
@@ -132,7 +135,7 @@ Getting S
from = Some(FROM("did:example:456")),
)
// message: BasicMessage = BasicMessage(
-// id = "389f090a-1180-4ca0-8bd0-daecfbf03f7d",
+// id = "2df02e51-0294-4699-945d-c8615b4fdd70",
// to = Set("did:example:123"),
// from = Some(value = "did:example:456"),
// lang = None,
@@ -143,7 +146,7 @@ Getting S
message.toPlaintextMessage.toJsonPretty
// res0: String = """{
-// "id" : "389f090a-1180-4ca0-8bd0-daecfbf03f7d",
+// "id" : "2df02e51-0294-4699-945d-c8615b4fdd70",
// "type" : "https://didcomm.org/basicmessage/2.0/message",
// "to" : [
// "did:example:123"
@@ -165,7 +168,7 @@
diff --git a/limitations.html b/08-others/limitations.html
similarity index 86%
rename from limitations.html
rename to 08-others/limitations.html
index 4c92c8ef..10c1ece9 100644
--- a/limitations.html
+++ b/08-others/limitations.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -112,7 +115,7 @@
Warning about arbitrary JSON
-
+
@@ -152,7 +155,7 @@
diff --git a/test-coverage.html b/08-others/test-coverage.html
similarity index 75%
rename from test-coverage.html
rename to 08-others/test-coverage.html
index 9f41aa1e..9ffdae23 100644
--- a/test-coverage.html
+++ b/08-others/test-coverage.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -108,12 +111,14 @@
-
+
@@ -121,12 +126,14 @@
Test coverage
- sbt clean coverage testJVM
- Run test
+ sbt clean coverage testJVM
- Run tests
sbt coverageReport
- Generate reports
sbt coverageAggregate
- Aggregate reports
Report
+
+ Statement coverage
@@ -137,6 +144,7 @@ did-framework
did-resolver-web
did-resolver-peer
+ uniresolver
multiformats
@@ -150,17 +158,60 @@ 81.58 %
27.50 %
NA
+ NA
2022-01-31
18.88 %
14.25 %
39.63 %
- 19.53 %
+ NA
81.58 %
34.58 %
+ NA
85.77 %
+
+ 2023-12-01
+ 12.79 %
+ 10.82 %
+ 44.02 %
+ NA
+ 81.58 %
+ 81.58 %
+ 12.33
+ 85.77 %
+
+
+
+
+ Branch coverage
+
+
+
+ date
+ all
+ did
+ did-imp
+ did-framework
+ did-resolver-web
+ did-resolver-peer
+ uniresolver
+ multiformats
+
+
+
+
+ 2023-12-01
+ 36.65 %
+ 29.70 %
+ 30.77 %
+ NA
+ 75.00 %
+ 0 %?
+ 100.00 %
+ 81.82 %
+
@@ -181,7 +232,7 @@
diff --git a/troubleshooting.html b/08-others/troubleshooting.html
similarity index 83%
rename from troubleshooting.html
rename to 08-others/troubleshooting.html
index d162bb7e..a2652ce5 100644
--- a/troubleshooting.html
+++ b/08-others/troubleshooting.html
@@ -20,9 +20,9 @@
-
-
-
+
+
+
@@ -40,7 +40,7 @@
-
+
@@ -87,16 +87,19 @@
@@ -110,7 +113,7 @@
-
+
@@ -145,7 +148,7 @@ Troubleshooting
diff --git a/index.html b/index.html
index 3130e886..110f0ef0 100644
--- a/index.html
+++ b/index.html
@@ -49,19 +49,11 @@ A Scala & Scala.js implementation of DID and DID Comm messaging spec
Documentation
- - README
+ - About
- - Quickstart
+ - Quickstart
- - Examples
-
- - Test Coverage
-
- - Limitations
-
- - Troubleshooting
-
- - Tools and Links
+ - Tools and Links
- Scaladoc