Skip to content

Commit

Permalink
feat: Support DID accreditations [DEV-4415] (#601)
Browse files Browse the repository at this point in the history
* feat: Add resource connector in credential issuance

* Add accredit/issue api

* fix swagger

* Implement accredit verify [skip ci]

* Add a separate controller for accreditation

* fix imports

* Update response

* Pause failing test

* Add accreditation tests

* fix bugs

* Add auth rules

* fix resource data format

* fix issue test

* Add accreditation/verify test

* Debug

* fix linting error

* Add additional tests

* Update verify workflow

* Add accredit & attest tests

* Execute sequential tests

* fix verification

* Handle validations

* fix root validation logic

* fix test payloads

* Update swagger

* Use validate decor

* npm update

* Update package-lock.json

* Fix verbatimModuleSyntax error in build

* Setting verbatimModuleSyntax to false

* Update accreditation.ts

* Address PR comments

* Update accreditation auth

* Fix authorize test payload

* Allow didUrl in fragments for verify

* Remove recursion in verification logic

* Update tests

* Add additional tests

* fix validators && swagger

* fix status codes

* Parallelize negative tests

* Fix typo in hasTrustFramewok

* Fix typo

---------

Co-authored-by: Ankur Banerjee <[email protected]>
  • Loading branch information
DaevMithran and ankurdotb authored Oct 7, 2024
1 parent e18d4ac commit 7447516
Show file tree
Hide file tree
Showing 26 changed files with 3,319 additions and 1,767 deletions.
3,326 changes: 1,584 additions & 1,742 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
],
"dependencies": {
"@cheqd/did-provider-cheqd": "^4.2.0",
"@cheqd/sdk": "^4.0.3",
"@cheqd/sdk": "^4.0.4",
"@cheqd/ts-proto": "^3.4.4",
"@cosmjs/amino": "^0.32.4",
"@cosmjs/encoding": "^0.32.4",
"@logto/express": "^2.3.15",
"@logto/express": "^2.3.16",
"@stablelib/ed25519": "^1.0.3",
"@veramo/core": "^6.0.0",
"@veramo/credential-ld": "^6.0.0",
Expand All @@ -83,20 +83,20 @@
"cross-env": "^7.0.3",
"did-resolver": "^4.1.0",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express": "^4.21.0",
"express-session": "^1.18.0",
"express-validator": "^7.2.0",
"helmet": "^7.1.0",
"helmet": "^7.2.0",
"http-status-codes": "^2.3.0",
"js-sha3": "^0.9.3",
"json-stringify-safe": "^5.0.1",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
"loglevel": "^1.9.1",
"multiformats": "^13.2.2",
"loglevel": "^1.9.2",
"multiformats": "^13.3.0",
"node-cache": "^5.1.2",
"pg": "^8.12.0",
"pg-connection-string": "^2.6.4",
"pg": "^8.13.0",
"pg-connection-string": "^2.7.0",
"secp256k1": "^5.0.0",
"sqlite3": "^5.1.7",
"stripe": "^14.25.0",
Expand All @@ -107,11 +107,11 @@
"uri-js": "^4.4.1"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.3.3",
"@semantic-release/github": "^10.3.5",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@types/bcrypt": "^5.0.2",
Expand All @@ -123,29 +123,29 @@
"@types/express-session": "^1.18.0",
"@types/helmet": "^4.0.0",
"@types/json-stringify-safe": "^5.0.3",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^20.16.3",
"@types/jsonwebtoken": "^9.0.7",
"@types/node": "^20.16.10",
"@types/secp256k1": "^4.0.6",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"@types/uuid": "^10.0.0",
"@types/validator": "^13.12.1",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.5.0",
"@types/validator": "^13.12.2",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"buffer": "6.0.3",
"conventional-changelog-conventionalcommits": "^8.0.0",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-typescript": "^3.0.0",
"jest": "^29.7.0",
"prettier": "^3.3.3",
"semantic-release": "^24.1.0",
"semantic-release": "^24.1.2",
"swagger-jsdoc": "^6.2.8",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"uint8arrays": "^5.1.0"
},
"publishConfig": {
Expand Down
13 changes: 13 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { PriceController } from './controllers/admin/prices.js';
import { WebhookController } from './controllers/admin/webhook.js';
import { APIKeyController } from './controllers/admin/api-key.js';
import { OrganisationController } from './controllers/admin/organisation.js';
import { AccreditationController } from './controllers/api/accreditation.js';

dotenv.config();

Expand Down Expand Up @@ -192,6 +193,18 @@ class App {
app.get('/did/list', new DIDController().getDids);
app.get('/did/search/:did', new DIDController().resolveDidUrl);

// Trust Registry API
app.post(
'/trust-registry/accreditation/issue',
AccreditationController.issueValidator,
new AccreditationController().issue
);
app.post(
'/trust-registry/accreditation/verify',
AccreditationController.verifyValidator,
new AccreditationController().verify
);

// Resource API
app.post(
'/resource/create/:did',
Expand Down
Loading

0 comments on commit 7447516

Please sign in to comment.