-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: how to configure the mediator (#60)
How to configure the mediator Update Coordinate-Mediation-Protocol.md For ATL-5359 Signed-off-by: Fabio Pinheiro <[email protected]> Co-authored-by: Anton Baliasnikov <[email protected]> Signed-off-by: Fabio Pinheiro <[email protected]> Signed-off-by: Shailesh Patil <[email protected]>
- Loading branch information
1 parent
c379a62
commit a111a05
Showing
2 changed files
with
144 additions
and
15 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,107 @@ | ||
# Coordinate Mediation Protocol | ||
|
||
This protocol is a part of the [DIDComm](https://didcomm.org/). | ||
|
||
It coordinates the mediation configuration between a mediating agent and the recipient. | ||
|
||
This protocol follows the request-response message exchange pattern, and only requerires the simple state of waiting for a response or to produce a response. | ||
|
||
For a detailed description of the protocol, please, see [Mediator Coordination v2.0](https://didcomm.org/mediator-coordination/2.0/). | ||
|
||
## PIURI | ||
|
||
- `https://didcomm.org/coordinate-mediation/2.0/mediate-request` | ||
**- Mediate Request** | ||
- `https://didcomm.org/coordinate-mediation/2.0/mediate-deny` | ||
**- Mediate Deny** (possible response to deny mediate-request) | ||
- `https://didcomm.org/coordinate-mediation/2.0/mediate-grant` | ||
**- Mediate Grant** (possible response to grant mediate-request) | ||
|
||
- `https://didcomm.org/coordinate-mediation/2.0/keylist-update` | ||
**- Keylist Update** | ||
- `https://didcomm.org/coordinate-mediation/2.0/keylist-update-response` | ||
**- Keylist Response** (response to keylist-update) | ||
|
||
- `https://didcomm.org/coordinate-mediation/2.0/keylist-query` | ||
**- Keylist Query** | ||
- `https://didcomm.org/coordinate-mediation/2.0/keylist` | ||
**- Keylist** (response to keylist-query) | ||
|
||
### Roles | ||
|
||
- mediator | ||
- The agent that will be receiving forward messages on behalf of the recipient. | ||
- recipient | ||
- The agent for whom the forward message payload is intended. | ||
|
||
### Messagem Flow Diagram | ||
|
||
```mermaid | ||
flowchart TD | ||
MediateRequest --> MediateDeny | ||
MediateRequest --> MediateGrant | ||
KeylistUpdate --> KeylistUpdateResponse | ||
KeylistQuery --> Keylist | ||
``` | ||
|
||
### Mediator state machine | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
state MediateRequested <<choice>> | ||
[*] --> MediateRequested: Receive 'mediate-request' | ||
MediateRequested --> StoreNewMediateConfig | ||
StoreNewMediateConfig --> [*]: 'mediate-grant' | ||
MediateRequested --> [*]: 'mediate-deny' | ||
state if_sate2 <<choice>> | ||
[*] --> if_sate2: Receive 'keylist-update' | ||
if_sate2 --> UpdateKeylist | ||
UpdateKeylist --> [*]: 'keylist-update-response' | ||
if_sate2 --> [*]: ignore | ||
state KeylistQueried <<choice>> | ||
[*] --> KeylistQueried: Receive 'keylist-query' | ||
KeylistQueried --> [*]: 'keylist' | ||
KeylistQueried --> [*]: ignore | ||
``` | ||
|
||
### Recipient state machine | ||
|
||
```mermaid | ||
stateDiagram-v2 | ||
direction LR | ||
state fork_state <<fork>> | ||
[*] --> fork_state | ||
fork_state --> RequestMediation | ||
fork_state --> RequestKeylistUpdate | ||
fork_state --> QueryKeylist | ||
state RequestMediation { | ||
[*] --> MediationRequested: send 'mediate-request' | ||
MediationRequested --> MediationDenied: 'mediate-deny' | ||
MediationRequested --> MediationRequested: timeout (retry) | ||
MediationRequested --> [*]: giveup | ||
MediationDenied --> [*] | ||
# MediationDenied --> MediationRequested: retry? | ||
MediationRequested --> MediationGrant: 'mediate-grant' | ||
MediationGrant --> [*] | ||
} | ||
state RequestKeylistUpdate { | ||
[*] --> KeylistUpdateRequested: send 'keylist-update' | ||
KeylistUpdateRequested --> KeylistUpdateRequested: timeout (retry) | ||
KeylistUpdateRequested --> [*]: giveup | ||
KeylistUpdateRequested --> KeylistUpdated: 'keylist-update-response' | ||
KeylistUpdated --> [*] | ||
} | ||
state QueryKeylist { | ||
[*]--> KeylistQueried: send 'keylist-query' | ||
KeylistQueried --> KeylistQueried: timeout (retry) | ||
KeylistQueried --> [*]: giveup | ||
KeylistQueried --> [*]: 'keylist' | ||
} | ||
``` |
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