-
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): add connect/issue doc + allow local execution of m…
…ultiple Prism Agent instances (#178) * chore(prism-agent): do not link DIDComm service port variable to DIDComm service URL variable * chore(infra): add docker-compose config for Connect + only expose th main http port * chore(infra): add HAProxy config for DIDComm service endpoint * chore(prism-agent): bump version number to 0.6.0-SNAPSHOT * docs(prism-agent): add basic documentation on executing Connect and Issue flows * docs(prism-agent): add links in main README.md
- Loading branch information
1 parent
5981a77
commit dc8d86b
Showing
7 changed files
with
170 additions
and
21 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
### Running multiple instances of Prism Agent | ||
--- | ||
|
||
#### Starting an instance for `Inviter` on port `8080` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8080 docker-compose -p inviter -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
#### Starting an instance for `Invitee` on port `8090` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8090 docker-compose -p invitee -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
### Executing the `Connect` flow | ||
--- | ||
|
||
- **Inviter** - Create a connection record containing the invitation | ||
```bash | ||
curl -X 'POST' \ | ||
'http://localhost:8080/prism-agent/connections' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"label": "Connect with Alice" | ||
}' | jq | ||
``` | ||
|
||
- **Inviter** - Retrieving the list of connections | ||
```bash | ||
curl -X 'GET' 'http://localhost:8080/prism-agent/connections' | jq | ||
``` | ||
|
||
- **Invitee** - Accept OOB invitation | ||
|
||
Replace `{RAW_INVITATION}` with the value of the '_oob' query string parameter from the invitation URL above | ||
```bash | ||
curl -X 'POST' \ | ||
'http://localhost:8090/prism-agent/connection-invitations' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"invitation": "{RAW_INVITATION}" | ||
}' | jq | ||
``` | ||
|
||
- **Invitee** - Retrieving the list of connections | ||
```bash | ||
curl -X 'GET' 'http://localhost:8090/prism-agent/connections' | jq | ||
``` |
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,65 @@ | ||
### Running multiple instances of Prism Agent | ||
--- | ||
|
||
#### Starting an instance for `Issuer` on port `8080` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8080 docker-compose -p issuer -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
#### Starting an instance for `Holder` on port `8090` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8090 docker-compose -p holder -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
### Executing the `Issue` flow | ||
--- | ||
|
||
- **Issuer** - Initiate a new issue credential flow | ||
|
||
Replace `{SUBJECT_ID}` with the DID of the holder displayed at startup in the his Prism Agent console logs | ||
```bash | ||
curl -X 'POST' \ | ||
'http://localhost:8080/prism-agent/issue-credentials/credential-offers' \ | ||
-H 'accept: application/json' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"schemaId": "schema:1234", | ||
"subjectId": "{SUBJECT_ID}", | ||
"validityPeriod": 3600, | ||
"automaticIssuance": false, | ||
"awaitConfirmation": false, | ||
"claims": { | ||
"firstname": "Alice", | ||
"lastname": "Wonderland", | ||
"birthdate": "01/01/2000" | ||
} | ||
}' | jq | ||
``` | ||
|
||
- **Holder** - Retrieving the list of issue records | ||
```bash | ||
curl -X 'GET' 'http://localhost:8090/prism-agent/issue-credentials/records' | jq | ||
``` | ||
|
||
- **Holder** - Accepting the credential offer | ||
|
||
Replace `{RECORD_ID}` with the UUID of the record from the previous list | ||
```bash | ||
curl -X 'POST' 'http://localhost:8090/prism-agent/issue-credentials/records/{RECORD_ID}/accept-offer' | jq | ||
``` | ||
|
||
- **Issuer** - Retrieving the list of issue records | ||
```bash | ||
curl -X 'GET' 'http://localhost:8080/prism-agent/issue-credentials/records' | jq | ||
``` | ||
|
||
- **Issuer** - Issuing the credential | ||
|
||
Replace `{RECORD_ID}` with the UUID of the record from the previous list | ||
```bash | ||
curl -X 'POST' 'http://localhost:8080/prism-agent/issue-credentials/records/{RECORD_ID}/issue-credential' | jq | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ThisBuild / version := "0.5.0-SNAPSHOT" | ||
ThisBuild / version := "0.6.0-SNAPSHOT" |