From 09a685efc2b7ec2dceb644468ae39b23452197f4 Mon Sep 17 00:00:00 2001 From: Miroslav Petrovic <89917386+miroslav-inc@users.noreply.github.com> Date: Thu, 27 Apr 2023 18:22:15 +0200 Subject: [PATCH 1/2] Update AriesOpenAPIDemo.md Signed-off-by: Miroslav Petrovic <89917386+miroslav-inc@users.noreply.github.com> --- demo/AriesOpenAPIDemo.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/AriesOpenAPIDemo.md b/demo/AriesOpenAPIDemo.md index e392cbde49..9ffe560a47 100644 --- a/demo/AriesOpenAPIDemo.md +++ b/demo/AriesOpenAPIDemo.md @@ -705,11 +705,11 @@ The following table lists endpoints that you need to call ("REST service") and c | Protocol Step | Faber (Verifier) | Alice (Holder/Prover) | Notes | | -------------------- | ---------------------- | ------------------------- | ----- | | Send Proof Request | **`POST /present-proof-2.0/send-request`** | | REST service | -| Receive Proof Request | | /present_proof_v2_0 | callback | +| Receive Proof Request | | /present_proof_v2_0 | callback(webhook or websocket) | | Find Credentials | | **`GET /present-proof-2.0/records/{pres_ex_id}/credentials`** | REST service | | Select Credentials | | | application or user function | | Send Proof | | **`POST /present-proof-2.0/records/{pres_ex_id}/send-presentation`** | REST service | -| Receive Proof | /present_proof_v2_0 | | callback | +| Receive Proof | /present_proof_v2_0 | | callback(webhook or websocket) | | Validate Proof | **`POST /present-proof-2.0/records/{pres_ex_id}/verify-presentation`** | | REST service | | Save Proof | | | application data | From 2fcf00b227a69739a544fa6ba74d8bd3cc5c92d8 Mon Sep 17 00:00:00 2001 From: Daniel Bluhm Date: Wed, 5 Jul 2023 13:47:48 +0000 Subject: [PATCH 2/2] docs: mention admin api websocket support Signed-off-by: Daniel Bluhm --- AdminAPI.md | 12 ++++++++++++ demo/AriesOpenAPIDemo.md | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/AdminAPI.md b/AdminAPI.md index a5f537a7b4..15cf3584a7 100644 --- a/AdminAPI.md +++ b/AdminAPI.md @@ -29,6 +29,18 @@ When ACA-Py is started with the `--webhook-url {URL}` command line parameter, st When a webhook is dispatched, the record `topic` is appended as a path component to the URL. For example, `https://webhook.host.example` becomes `https://webhook.host.example/topic/connections` when a connection record is updated. A POST request is made to the resulting URL with the body of the request comprising a serialized JSON object. The full set of properties of the current set of webhook payloads are listed below. Note that empty (null-value) properties are omitted. +### Webhooks over WebSocket + +ACA-Py's Admin API also supports delivering webhooks over WebSocket. This can be especially useful when working with scripts that interact with the Admin API but don't have a web server listening to recieve webhooks in response to its actions. No additional command line parameters are required to enable WebSocket support. + +Webhooks received over WebSocket will contain the same data as webhooks posted over http but the structure differs in order to communicate details that would have been received as part of the HTTP request path and headers. + +* `topic`: The topic of the webhook, such as `connections` or `basicmessages` +* `payload`: The payload of the webhook; this is the data usually received in the request body when webhooks are delivered over HTTP +* `wallet_id`: If using multitenancy, this is the wallet ID of the subwallet that emitted the webhook. This value will be omitted if not using multitenancy. + +To open a WebSocket, connect to the `/ws` endpoint of the Admin API. + ### Pairwise Connection Record Updated (`/connections`) * `connection_id`: the unique connection identifier diff --git a/demo/AriesOpenAPIDemo.md b/demo/AriesOpenAPIDemo.md index 9ffe560a47..8f0cd9111d 100644 --- a/demo/AriesOpenAPIDemo.md +++ b/demo/AriesOpenAPIDemo.md @@ -700,16 +700,16 @@ As with the issue credential process, the agents handled some of the presentatio If you would like to perform all of the proof request/response steps manually, you can call all of the individual `/present-proof-2.0` messages. -The following table lists endpoints that you need to call ("REST service") and callbacks that your agent will receive ("callback") that your need to respond to. See the [detailed API docs](../AdminAPI.md). +The following table lists endpoints that you need to call ("REST service") and callbacks that your agent will receive ("callback") that you need to respond to. See the [detailed API docs](../AdminAPI.md). | Protocol Step | Faber (Verifier) | Alice (Holder/Prover) | Notes | | -------------------- | ---------------------- | ------------------------- | ----- | | Send Proof Request | **`POST /present-proof-2.0/send-request`** | | REST service | -| Receive Proof Request | | /present_proof_v2_0 | callback(webhook or websocket) | +| Receive Proof Request | | /present_proof_v2_0 | callback (webhook) | | Find Credentials | | **`GET /present-proof-2.0/records/{pres_ex_id}/credentials`** | REST service | | Select Credentials | | | application or user function | | Send Proof | | **`POST /present-proof-2.0/records/{pres_ex_id}/send-presentation`** | REST service | -| Receive Proof | /present_proof_v2_0 | | callback(webhook or websocket) | +| Receive Proof | /present_proof_v2_0 | | callback (webhook) | | Validate Proof | **`POST /present-proof-2.0/records/{pres_ex_id}/verify-presentation`** | | REST service | | Save Proof | | | application data |