-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prism-agent): implement Connect flow (#130)
* Added first version of open api spec for connect * Added first version of open api spec for connect * Added protocol onnect * updated the protocol connect * Added the Agent for connect * chore(prism-agent): update OAS for Connect * feat(prism-agent): add mock implementation for Connect OAS * chore(connect): Fix typo in class names * chore(prism-agent): return '201' when creating new connection record * chore(connect): bump mercury version to 0.7.0 * chore(pollux): bump version to 0.4.0-SNAPSHOT * chore(pollux): bump mercury version to 0.7.0 * chore(prism-agent): add connect dependency * chore(connect): Fix typo in class names * chore(prism-agent): configure connect Api and DB layers * chore(prism-agent): fix compilation warning * chore(connect): implement all phases of the connection flow * chore(connect): decode and parse raw invitation in ConnectionService * chore(prism-agent): align connect OAS with DIDComm v2 OOB invitation format * chore(prism-agent): execute connect db migrations at startup * chore(prism-agent): add connect DB app config * feat(prism-agent): implement create/get connection(s) + accept invitation * chore(connect): disable Doobie log handler * chore(connect): implement connection request acceptance by inviter * chore(prism-agent): return 'myDid' and 'theirDid' in REST api reponse * feat(prism-agent): implement background job for Connect protocol * feat(prism-agent): implement DIDComm service endpoint for Connect protocol * chore(prism-agent): improve code formatting * chore(prism-agent): move connect API spec to server project * chore(pollux): downgrade to shared 0.1.0 * chore(connect): downgrade to shared 0.1.0 * chore(prism-agent): add removed connect dependency * chore(mercury): bump to pollux:0.4.0 & connect:1.0.0 * chore(prism-agent): use fixed release version of connect => 0.1.0 Co-authored-by: Benjamin Voiturier <[email protected]>
- Loading branch information
1 parent
a01a6dd
commit f7cba3b
Showing
15 changed files
with
678 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
components: | ||
parameters: | ||
connectionId: | ||
in: path | ||
name: connectionId | ||
required: true | ||
description: Id of connection state record. | ||
schema: | ||
type: string | ||
schemas: | ||
CreateConnectionRequest: | ||
type: object | ||
properties: | ||
label: | ||
type: string | ||
example: "Peter" | ||
|
||
AcceptConnectionInvitationRequest: | ||
type: object | ||
required: | ||
- invitation | ||
properties: | ||
invitation: | ||
type: string | ||
example: "eyJAaWQiOiIzZmE4NWY2NC01NzE3LTQ1NjItYjNmYy0yYzk2M2Y2NmFmYTYiLCJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvbXktZmFtaWx5LzEuMC9teS1tZXNzYWdlLXR5cGUiLCJkaWQiOiJXZ1d4cXp0ck5vb0c5MlJYdnhTVFd2IiwiaW1hZ2VVcmwiOiJodHRwOi8vMTkyLjE2OC41Ni4xMDEvaW1nL2xvZ28uanBnIiwibGFiZWwiOiJCb2IiLCJyZWNpcGllbnRLZXlzIjpbIkgzQzJBVnZMTXY2Z21NTmFtM3VWQWpacGZrY0pDd0R3blpuNnozd1htcVBWIl0sInJvdXRpbmdLZXlzIjpbIkgzQzJBVnZMTXY2Z21NTmFtM3VWQWpacGZrY0pDd0R3blpuNnozd1htcVBWIl0sInNlcnZpY2VFbmRwb2ludCI6Imh0dHA6Ly8xOTIuMTY4LjU2LjEwMTo4MDIwIn0=" | ||
|
||
Connection: | ||
type: object | ||
allOf: | ||
- $ref: "#/components/schemas/CreateConnectionRequest" | ||
- type: object | ||
required: | ||
- self | ||
- kind | ||
- connectionId | ||
- state | ||
- createdAt | ||
- invitation | ||
properties: | ||
self: | ||
type: string | ||
example: https://atala-prism-products.io/connections/ABCD-1234 | ||
kind: | ||
type: string | ||
example: ConnectionState | ||
connectionId: | ||
type: string | ||
format: uuid | ||
example: "12345-9876" | ||
myDid: | ||
type: string | ||
example: "did:prism:12345" | ||
theirDid: | ||
type: string | ||
example: "did:peer:12345" | ||
state: | ||
type: string | ||
enum: ["pending", "success", "failed"] | ||
createdAt: | ||
type: string | ||
format: date-time | ||
example: 2021-10-31T09:22:23Z | ||
updatedAt: | ||
type: string | ||
format: date-time | ||
example: 2021-12-31T13:59:60Z | ||
invitation: | ||
$ref: "#/components/schemas/ConnectionInvitation" | ||
|
||
ConnectionCollection: | ||
type: object | ||
required: | ||
- self | ||
- kind | ||
- contents | ||
properties: | ||
self: | ||
type: string | ||
example: https://atala-prism-products.io/connections | ||
kind: | ||
type: string | ||
example: Collection | ||
contents: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/Connection" | ||
|
||
ConnectionInvitation: | ||
type: object | ||
required: | ||
- id | ||
- type | ||
- from | ||
- invitationUrl | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
description: The invitation identifier used as parent thread ID (pthid) for the response message that follows. | ||
example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" | ||
type: | ||
type: string | ||
description: The DIDComm Message Type URI (MTURI) the invitation message coplies with. | ||
example: "https://didcomm.org/out-of-band/2.0/invitation" | ||
from: | ||
type: string | ||
description: The DID representing the sender to be used by recipients for future interactions. | ||
example: "did:prism:1234457" | ||
invitationUrl: | ||
type: string | ||
description: The invitation message encoded as a URL. | ||
example: https://domain.com/path?_oob=eyJAaWQiOiIzZmE4NWY2NC01NzE3LTQ1NjItYjNmYy0yYzk2M2Y2NmFmYTYiLCJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvbXktZmFtaWx5LzEuMC9teS1tZXNzYWdlLXR5cGUiLCJkaWQiOiJXZ1d4cXp0ck5vb0c5MlJYdnhTVFd2IiwiaW1hZ2VVcmwiOiJodHRwOi8vMTkyLjE2OC41Ni4xMDEvaW1nL2xvZ28uanBnIiwibGFiZWwiOiJCb2IiLCJyZWNpcGllbnRLZXlzIjpbIkgzQzJBVnZMTXY2Z21NTmFtM3VWQWpacGZrY0pDd0R3blpuNnozd1htcVBWIl0sInJvdXRpbmdLZXlzIjpbIkgzQzJBVnZMTXY2Z21NTmFtM3VWQWpacGZrY0pDd0R3blpuNnozd1htcVBWIl0sInNlcnZpY2VFbmRwb2ludCI6Imh0dHA6Ly8xOTIuMTY4LjU2LjEwMTo4MDIwIn0= | ||
|
||
ErrorResponse: | ||
type: object | ||
description: An RFC-7807 compliant data structure for reporting errors to the client | ||
required: | ||
- type | ||
- title | ||
- status | ||
- instance | ||
properties: | ||
type: | ||
type: string | ||
description: A URI reference that identifies the problem type. | ||
example: https://example.org/doc/#model-MalformedEmail | ||
title: | ||
type: string | ||
example: "Malformed email" | ||
description: |- | ||
A short, human-readable summary of the problem type. It does not | ||
change from occurrence to occurrence of the problem. | ||
status: | ||
type: integer | ||
format: int32 | ||
example: 400 | ||
description: |- | ||
The HTTP status code for this occurrence of the problem. | ||
detail: | ||
type: string | ||
description: |- | ||
A human-readable explanation specific to this occurrence of the problem. | ||
example: "The received '{}à!è@!.b}' email does not conform to the email format" | ||
instance: | ||
type: string | ||
example: "/problems/d914e" | ||
description: |- | ||
A URI reference that identifies the specific occurrence of the problem. | ||
It may or may not yield further information if dereferenced. |
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
Oops, something went wrong.