-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ATL-1738-Aries-RFC-0023-DIDExchange-Protocol (#29)
* Added the readme file for didexchange protocol updated the state digram * Added the readme file for didexchange protocol updated the state digram * Added the readme file for didexchange protocol updated the state digram * added Didexchnage * added Didexchnage * code cleanup * removed the unwanted import Signed-off-by: Shailesh <shailesh.patil@iohk.io> Signed-off-by: Shailesh <shailesh.patil@iohk.io>
- Loading branch information
1 parent
12dd9c2
commit bb4dfe5
Showing
12 changed files
with
136 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
...col/invitation/AttachmentDescriptor.scala → .../mercury/model/AttachmentDescriptor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ediator/models/src/main/scala/io/iohk/atala/mercury/model/AttachmentDescriptorCodec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.iohk.atala.mercury.model | ||
|
||
import io.circe.{Decoder, Encoder} | ||
import io.circe.generic.semiauto.* | ||
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder} | ||
|
||
object AttachmentDescriptorCodec { | ||
|
||
implicit val headerEncoder: Encoder[Header] = deriveEncoder[Header] | ||
implicit val headerDecoder: Decoder[Header] = deriveDecoder[Header] | ||
|
||
implicit val jwsEncoder: Encoder[Jws] = deriveEncoder[Jws] | ||
implicit val jwsDecoder: Decoder[Jws] = deriveDecoder[Jws] | ||
|
||
implicit val jwsDataEncoder: Encoder[JwsData] = deriveEncoder[JwsData] | ||
implicit val jwsDataDecoder: Decoder[JwsData] = deriveDecoder[JwsData] | ||
|
||
implicit val base64Encoder: Encoder[Base64] = deriveEncoder[Base64] | ||
implicit val base64eDecoder: Decoder[Base64] = deriveDecoder[Base64] | ||
|
||
implicit val attachmentDescriptorEncoder: Encoder[AttachmentDescriptor] = deriveEncoder[AttachmentDescriptor] | ||
implicit val attachmentDescriptorDecoder: Decoder[AttachmentDescriptor] = deriveDecoder[AttachmentDescriptor] | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
mercury/prism-mediator/protocol-did-exchange/DidExchange-Protocol.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# DidExchange Protocol | ||
|
||
This Protocol is parte of the DIDComm Messaging Specification. | ||
|
||
Protocol to exchange DIDs between agents when establishing a DID-based relationship | ||
|
||
See [https://github.com/hyperledger/aries-rfcs/tree/main/features/0023-did-exchange] | ||
|
||
## PIURI | ||
|
||
`https://didcomm.org/didexchange/1.0/request` | ||
`https://didcomm.org/didexchange/1.0/problem_report` | ||
`https://didcomm.org/didexchange/1.0/response` | ||
`https://didcomm.org/didexchange/1.0/complete` | ||
|
||
### Roles | ||
|
||
- Requester(Is the receiver in out-of-band protocol) | ||
- Will initiate the did-exchange | ||
- Responder (Is the invitation sender in out-of-band protocol) | ||
- Will respond to did exchange | ||
|
||
|
||
|
||
### Requester request did-exchange | ||
step1-->step2-->step3 Is a happy path flow | ||
|
||
error - error received or sent and state transition | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
[*] --> invitation_received:out-of-band Invitation | ||
invitation_received --> request_sent:step1-send did-exchange request | ||
invitation_received --> abandoned:eror1 unable send problem report | ||
request_sent --> response_received: step2-received did-exchange Response | ||
request_sent --> invitation_received: eror2 received problem report | ||
request_sent --> abandoned:eror2 unable continue after problem report | ||
response_received --> completed:step3-send complete | ||
response_received --> request_sent:eror3 send problem report | ||
response_received --> abandoned:eror3 unable send problem report | ||
abandoned --> [*] | ||
completed --> [*] | ||
``` | ||
|
||
|
||
### Responder responds to did-exchange | ||
step1-->step2-->step3 Is a happy path flow | ||
|
||
error received or sent and state transition | ||
```mermaid | ||
stateDiagram-v2 | ||
[*] --> invitation_sent:out-of-band send Invitation | ||
invitation_sent --> request_received:step1. received did-exchange request | ||
invitation_sent --> abandoned:eror1 unable send problem report | ||
request_received --> response_sent: step2. send did-exchange Response | ||
request_received --> abandoned:eror2 unable send problem report | ||
request_received --> invitation_sent: error2 send problem report | ||
response_sent --> completed: step3. received complete | ||
response_sent --> request_received: error3 receive problem report | ||
response_sent --> abandoned:eror3 unable continue after received problem report | ||
abandoned --> [*] | ||
completed --> [*] | ||
``` |
3 changes: 3 additions & 0 deletions
3
...d-exchange/src/main/scala/io/iohk/atala/mercury/protocol/didexchange/v1/DIDExchange.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.iohk.atala.mercury.protocol.didexchange.v1 | ||
|
||
object DIDExchange {} |
15 changes: 15 additions & 0 deletions
15
...nge/src/main/scala/io/iohk/atala/mercury/protocol/didexchange/v1/DidExchangeRequest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.iohk.atala.mercury.protocol.didexchange.v1 | ||
|
||
import io.iohk.atala.mercury.model.{AttachmentDescriptor, PIURI} | ||
|
||
final case class Thread(thid: String, pthid: String) | ||
|
||
final case class DidExchangeRequest( | ||
`@id`: String, | ||
`@type`: PIURI, | ||
`~thread`: Thread, | ||
label: String, | ||
goal_code: String, | ||
goal: String, | ||
`did_doc~attach`: Option[AttachmentDescriptor] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...nvitation/src/test/scala/io/iohk/atala/mercury/protocol/invitation/v2/OutOfBandSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters