Skip to content

Commit

Permalink
feat(prism-agent): remove unused / deprecated DID endpoints (#213)
Browse files Browse the repository at this point in the history
* feat(prism-agent): deprecate unused DID related endpoints

* docs: update doc on DID endpoints
  • Loading branch information
patlo-iog authored Dec 7, 2022
1 parent efcccf5 commit 0308b4f
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 533 deletions.
39 changes: 6 additions & 33 deletions prism-agent/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,9 @@

## Quickstart

### Running PrismAgent service local development
### Running PrismAgent service locally

__Environmental setup__

Set the environment variable `ATALA_GITHUB_TOKEN` so we can pull `prism-crypto` from Github packages.

__Spin up PrismAgent dependencies__

Then we need to spin up services and databases for Castor, Pollux and optionally Iris.
The easiest way is to reuse the `./infrastructure/local/docker-compose.yml` which contains
databases and all the services. It should also apply database migrations on startup.
Some services in `docker-compose.yml` can be commented out if not needed
during local development.

```bash
# From the root directory
./infrastructure/loca/run.sh
```
Then the services should be availble in the following ports

|service|port|
|---|---|
|castor db|5432|
|pollux db|???|
|iris|8081|

Then configure `prism-agent` to use the services listed above.
see `./infrastucture/local/README.md` for instruction

---

Expand All @@ -40,7 +16,7 @@ the operation with private and public keys through the Wallet API abstraction le
The interface for key-mangement is heavily inspired by
[indy-sdk-java-wrapper](https://github.com/hyperledger/indy-sdk/tree/main/wrappers/java).

There is an `key-management` subproject which is responsible for managing and storing DID key-pairs.
There is an `wallet-api` subproject which is responsible for managing and storing DID key-pairs.
The main goal is to wrap Castor and Pollux libraries which does not handle private-keys
and ease the usage by providing key-mangement capabilities.
Similar to [Indy Wallet SDK - secret API](https://github.com/hyperledger/indy-sdk/tree/main/docs/design/003-wallet-storage#secrets-api),
Expand All @@ -55,10 +31,7 @@ Basic documentation on how to execute the Connect flow from command line can be
Basic documentation on how to execute the Issue flow from the command line can be found [here](./issue.md).

---
## Known limitations
## DID lifecycle flow
Basic documentation on how to execute the basic DID lifecycle from command line can be found [here](./did.md)

### Castor `worker` process embedded inside `prism-agent` runnable

Castor worker process which is responsible for async comminucation with other components is temporarily embedded inside `server`.
This impose some restrictions on scalability as it requires some coordination of between `worker` instances.
It should be addressed going forward.
---
97 changes: 0 additions & 97 deletions prism-agent/service/api/http/castor/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,103 +84,6 @@ components:
publicKeyJwk:
$ref: "#/components/schemas/PublicKeyJwk"

CreateDIDRequest:
type: object
required:
- updateCommitment
- recoveryCommitment
- storage
- document
properties:
updateCommitment:
type: string
example: "e0f10749ef6d7ea351cf9e23ef505a933e8386123413a044d11945fd45bad3ba"
description: Forward reference to next update key which is SHA256 of update public key
recoveryCommitment:
type: string
example: "62b4b7f16bdc50dcf3d4c8fb1edb62d73e72d2707b35f468e4e523b3c63d290a"
description: Forward reference to next recovery key which is SHA256 of recovery public key
storage:
type: string
example: "mainnet"
document:
type: object
properties:
publicKeys:
type: array
items:
$ref: "#/components/schemas/PublicKey"
services:
type: array
items:
$ref: "#/components/schemas/Service"

UpdateDIDRequest:
type: object
required:
- did
- updatePublicKey
- previousVersion
- delta
properties:
did:
type: string
example: did:prism:7a3a5cd1beab57a65c18c584848029c513ca27c8edfb69ceb2c7aef3d659bf44?instance=https://offchain-storage.com"
updatePublicKey:
type: string
example: "EiBkRSeixqX-PhOij6PIpuGfPld5Nif5MxcrgtGCw-t6LA"
description: "Base64 of update public key"
previousVersion:
type: string
example: "a56d8c8cee25d810840c6f77b0797af36f2cb7247101a59f4607f9542c8f7aee"
description: SHA256 of the previous operation
delta:
$ref: "#/components/schemas/DeltaUpdate"

DeactivateDIDRequest:
type: object
required:
- did
- recoveryPublicKey
- previousVersion
- signature
properties:
did:
type: string
example: "did:prism:mainnet:7a3a5cd1beab57a65c18c584848029c513ca27c8edfb69ceb2c7aef3d659bf44"
recoveryPublicKey:
type: string
example: "EiBkRSeixqX-PhOij6PIpuGfPld5Nif5MxcrgtGCw-t6LA"
description: "Base64 of recovery public key"
previousVersion:
type: string
example: "a56d8c8cee25d810840c6f77b0797af36f2cb7247101a59f4607f9542c8f7aee"
description: "SHA256 of last DID operation"
signature:
type: string
example: "eyJhbGciOiJFUzI1NksifQ.eyJ1cGRhdGVLZXkiOnsia3R5IjoiRUMiLCJjcnYiOiJzZWNwMjU2azEiLCJ4Ijoid2Z3UUNKM09ScVZkbkhYa1Q4UC1MZ19HdHhCRWhYM3R5OU5VbnduSHJtdyIsInkiOiJ1aWU4cUxfVnVBblJEZHVwaFp1eExPNnFUOWtQcDNLUkdFSVJsVHBXcmZVIn0sImRlbHRhSGFzaCI6IkVpQ3BqTjQ3ZjBNcTZ4RE5VS240aFNlZ01FcW9EU19ycFEyOVd5MVY3M1ZEYncifQ.RwZK1DG5zcr4EsrRImzStb0VX5j2ZqApXZnuoAkA3IoRdErUscNG8RuxNZ0FjlJtjMJ0a-kn-_MdtR0wwvWVgg"
description: "Base64 of signature of data in the request"

RecoverDIDRequest:
type: object
properties:
did:
type: string
example: "did:prism:mainnet:7a3a5cd1beab57a65c18c584848029c513ca27c8edfb69ceb2c7aef3d659bf44"
recoveryPublicKey:
type: string
example: "EiBkRSeixqX-PhOij6PIpuGfPld5Nif5MxcrgtGCw-t6LA"
previousVersion:
type: string
example: "a56d8c8cee25d810840c6f77b0797af36f2cb7247101a59f4607f9542c8f7aee"
description: "SHA256 of last DID operation"
delta:
$ref: "#/components/schemas/Delta"
signature:
type: string
example: "eyJhbGciOiJFUzI1NksifQ.eyJ1cGRhdGVLZXkiOnsia3R5IjoiRUMiLCJjcnYiOiJzZWNwMjU2azEiLCJ4Ijoid2Z3UUNKM09ScVZkbkhYa1Q4UC1MZ19HdHhCRWhYM3R5OU5VbnduSHJtdyIsInkiOiJ1aWU4cUxfVnVBblJEZHVwaFp1eExPNnFUOWtQcDNLUkdFSVJsVHBXcmZVIn0sImRlbHRhSGFzaCI6IkVpQ3BqTjQ3ZjBNcTZ4RE5VS240aFNlZ01FcW9EU19ycFEyOVd5MVY3M1ZEYncifQ.RwZK1DG5zcr4EsrRImzStb0VX5j2ZqApXZnuoAkA3IoRdErUscNG8RuxNZ0FjlJtjMJ0a-kn-_MdtR0wwvWVgg"
description: "Base64 of signature of data in the request"

CreateManagedDidRequest:
type: object
required:
Expand Down
Loading

0 comments on commit 0308b4f

Please sign in to comment.