diff --git a/package-lock.json b/package-lock.json index b479c866..43e743dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.4.0-develop.8", "license": "Apache-2.0", "dependencies": { - "@cheqd/did-provider-cheqd": "^3.5.0", + "@cheqd/did-provider-cheqd": "^3.6.0", "@cosmjs/amino": "^0.31.0", "@cosmjs/encoding": "^0.30.1", "@logto/express": "^2.0.2", @@ -21,13 +21,14 @@ "@veramo/did-resolver": "^5.2.0", "@veramo/key-manager": "^5.1.2", "@veramo/kms-local": "^5.1.2", - "@verida/account-node": "^2.3.5", - "@verida/client-ts": "^2.3.5", + "@verida/account-node": "^2.3.6", + "@verida/client-ts": "^2.3.6", "@verida/types": "^2.3.1", - "@verida/vda-did-resolver": "^2.3.5", + "@verida/vda-did-resolver": "^2.3.6", "cookie-parser": "^1.4.6", "copyfiles": "^2.4.1", "cors": "^2.8.5", + "did-jwt": "^7.2.4", "did-resolver": "^4.1.0", "dotenv": "^16.3.1", "express": "^4.18.2", @@ -58,12 +59,12 @@ "@types/express-session": "^1.17.7", "@types/helmet": "^4.0.0", "@types/json-stringify-safe": "^5.0.0", - "@types/node": "^20.4.0", + "@types/node": "^20.4.1", "@types/secp256k1": "^4.0.3", "@types/swagger-ui-express": "^4.1.3", "@types/uuid": "^9.0.2", - "@typescript-eslint/eslint-plugin": "^5.61.0", - "@typescript-eslint/parser": "^5.61.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "buffer": "6.0.3", "conventional-changelog-conventionalcommits": "^6.1.0", "eslint": "^8.44.0", @@ -2364,9 +2365,9 @@ } }, "node_modules/@babel/register/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "optional": true, "peer": true, "bin": { @@ -4069,9 +4070,9 @@ } }, "node_modules/@expo/cli": { - "version": "0.10.9", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.10.9.tgz", - "integrity": "sha512-aK/2ZPC01rD7H4zDiM+GQHorjrOhgo0I+6AGht7RUL3M022TnarlLVc6KJDhVCMeXLaPuerJrsEJm5Hvgl1mNw==", + "version": "0.10.10", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.10.10.tgz", + "integrity": "sha512-YN5ziGfb+CBY51ezZHSRTnZ6FpJT8t8RG4OIKPFyvuO7PWctC52CEXgJ6CJDzgxAaiD/ubogciVAYqjvNa6Lnw==", "optional": true, "peer": true, "dependencies": { @@ -4321,6 +4322,22 @@ "node": ">=8" } }, + "node_modules/@expo/cli/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "optional": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@expo/cli/node_modules/tempy": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/tempy/-/tempy-0.7.1.tgz", @@ -4530,6 +4547,22 @@ "node": ">=8" } }, + "node_modules/@expo/config/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "optional": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@expo/dev-server": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/@expo/dev-server/-/dev-server-0.5.4.tgz", @@ -5038,9 +5071,9 @@ } }, "node_modules/@expo/spawn-async/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "optional": true, "peer": true, "bin": { @@ -7429,9 +7462,9 @@ } }, "node_modules/@react-native-community/cli-doctor/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "optional": true, "peer": true, "bin": { @@ -7870,9 +7903,9 @@ } }, "node_modules/@react-native-community/cli-tools/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "optional": true, "peer": true, "bin": { @@ -7981,9 +8014,9 @@ } }, "node_modules/@react-native-community/cli/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "optional": true, "peer": true, "bin": { @@ -9202,9 +9235,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.40.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.2.tgz", - "integrity": "sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", + "integrity": "sha512-gsF+c/0XOguWgaOgvFs+xnnRqt9GwgTvIks36WpE6ueeI4KCEHHd8K/CKHqhOqrJKsYH8m27kRzQEvWXAwXUTw==", "dev": true, "peer": true, "dependencies": { @@ -9351,9 +9384,9 @@ "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" }, "node_modules/@types/node": { - "version": "20.4.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.0.tgz", - "integrity": "sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g==" + "version": "20.4.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.1.tgz", + "integrity": "sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -9475,15 +9508,15 @@ "devOptional": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.61.0.tgz", - "integrity": "sha512-A5l/eUAug103qtkwccSCxn8ZRwT+7RXWkFECdA4Cvl1dOlDUgTpAOfSEElZn2uSUxhdDpnCdetrf0jvU4qrL+g==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.61.0", - "@typescript-eslint/type-utils": "5.61.0", - "@typescript-eslint/utils": "5.61.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.0", @@ -9509,14 +9542,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.61.0.tgz", - "integrity": "sha512-yGr4Sgyh8uO6fSi9hw3jAFXNBHbCtKKFMdX2IkT3ZqpKmtAq3lHS4ixB/COFuAIJpwl9/AqF7j72ZDWYKmIfvg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.61.0", - "@typescript-eslint/types": "5.61.0", - "@typescript-eslint/typescript-estree": "5.61.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "debug": "^4.3.4" }, "engines": { @@ -9536,13 +9569,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.61.0.tgz", - "integrity": "sha512-W8VoMjoSg7f7nqAROEmTt6LoBpn81AegP7uKhhW5KzYlehs8VV0ZW0fIDVbcZRcaP3aPSW+JZFua+ysQN+m/Nw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.61.0", - "@typescript-eslint/visitor-keys": "5.61.0" + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -9553,13 +9586,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.61.0.tgz", - "integrity": "sha512-kk8u//r+oVK2Aj3ph/26XdH0pbAkC2RiSjUYhKD+PExemG4XSjpGFeyZ/QM8lBOa7O8aGOU+/yEbMJgQv/DnCg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.61.0", - "@typescript-eslint/utils": "5.61.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -9580,9 +9613,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.61.0.tgz", - "integrity": "sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -9593,13 +9626,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.61.0.tgz", - "integrity": "sha512-Fud90PxONnnLZ36oR5ClJBLTLfU4pIWBmnvGwTbEa2cXIqj70AEDEmOmpkFComjBZ/037ueKrOdHuYmSFVD7Rw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.61.0", - "@typescript-eslint/visitor-keys": "5.61.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -9649,17 +9682,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.61.0.tgz", - "integrity": "sha512-mV6O+6VgQmVE6+xzlA91xifndPW9ElFW8vbSF0xCT/czPXVhwDewKila1jOyRwa9AE19zKnrr7Cg5S3pJVrTWQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.61.0", - "@typescript-eslint/types": "5.61.0", - "@typescript-eslint/typescript-estree": "5.61.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -9675,12 +9708,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.61.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.61.0.tgz", - "integrity": "sha512-50XQ5VdbWrX06mQXhy93WywSFZZGsv3EOjq+lqp6WC2t+j3mb6A9xYVdrRxafvK88vg9k9u+CT4l6D8PEatjKg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.61.0", + "@typescript-eslint/types": "5.62.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -10134,12 +10167,12 @@ } }, "node_modules/@verida/account": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@verida/account/-/account-2.3.5.tgz", - "integrity": "sha512-HsBoHfUdy7oD5VWncD6VrgKAVmDAe5YVNJd+LRROJTQjXXTPFocF4VfDlbq08e95bjyG4j1FSlmLP8H+9iUKLQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@verida/account/-/account-2.3.6.tgz", + "integrity": "sha512-olERxgfLoHktFT+GsyLDzqkL0qAYPBNg8TrLRQ8gldi2tgKerR9asgXtdaSPXyGzEJ4Lv+sSGzQUhYp61uHvAQ==", "dependencies": { "@verida/keyring": "^2.3.1", - "@verida/storage-link": "^2.3.5", + "@verida/storage-link": "^2.3.6", "@verida/types": "^2.3.1", "did-jwt": "^6.11.0", "did-resolver": "^4.0.1", @@ -10151,12 +10184,12 @@ } }, "node_modules/@verida/account-node": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@verida/account-node/-/account-node-2.3.5.tgz", - "integrity": "sha512-Hpi+6xFKfeXKcECIE8zYNHQ3i697ySCVKZtO+6qWcTtDVpwLenPWuAF2aTciHfGCGo8KcpUp/85dl+11OZUDhA==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@verida/account-node/-/account-node-2.3.6.tgz", + "integrity": "sha512-bJM418kqr/mV8Km6ZW9xDVVq333yvh+5K8NdazB/G+LZj2cblQnehr6T+Fwoof3p5NZMNJguHSCd52yzBS8t5g==", "dependencies": { - "@verida/account": "^2.3.5", - "@verida/did-client": "^2.3.5", + "@verida/account": "^2.3.6", + "@verida/did-client": "^2.3.6", "@verida/did-document": "^2.3.1", "@verida/encryption-utils": "^2.2.1", "@verida/keyring": "^2.3.1", @@ -10233,16 +10266,16 @@ } }, "node_modules/@verida/client-ts": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@verida/client-ts/-/client-ts-2.3.5.tgz", - "integrity": "sha512-ThcbWXLhThXhgzYBT+jn06yWiDnalcLOj1wVoiN5GvHbRSV6nMvfJuVi5kVBK//k/+t/wQ0lEquNOnS0lrQMdQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@verida/client-ts/-/client-ts-2.3.6.tgz", + "integrity": "sha512-A8QrBBu/QUa3kDZdS4s29G0x6gXMz9WoC5LUX+y1Phd05pt3yCDIuYE8iMpl2UltLQFK4spezprwxfWP9c7jkQ==", "dependencies": { - "@verida/account": "^2.3.5", - "@verida/did-client": "^2.3.5", + "@verida/account": "^2.3.6", + "@verida/did-client": "^2.3.6", "@verida/did-document": "^2.3.1", "@verida/encryption-utils": "^2.2.1", "@verida/keyring": "^2.3.1", - "@verida/storage-link": "^2.3.5", + "@verida/storage-link": "^2.3.6", "@verida/types": "^2.3.1", "@verida/vda-name-client": "^2.3.4", "ajv": "^8.6.3", @@ -10307,14 +10340,14 @@ } }, "node_modules/@verida/did-client": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@verida/did-client/-/did-client-2.3.5.tgz", - "integrity": "sha512-7P28fvFsKbNkmmKhHrlP20TSI6tb+1c5Ox1qOtrGfknqwWQJ5cjS01wa9EaHI17O21ZSoUeCmssGlljAJVfTNg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@verida/did-client/-/did-client-2.3.6.tgz", + "integrity": "sha512-SkWayshca6xLgmyXh7C/XN77orx7nMOOySH2fEjz2meysv9cpIIw6V4nhyp08clrr/UgEYDLuuPj82xyt+pWXw==", "dependencies": { "@verida/did-document": "^2.3.1", "@verida/types": "^2.3.1", "@verida/vda-common": "^2.3.4", - "@verida/vda-did-resolver": "^2.3.5", + "@verida/vda-did-resolver": "^2.3.6", "@verida/web3": "^2.3.4", "axios": "^0.23.0", "deepcopy": "^2.1.0", @@ -10411,11 +10444,11 @@ } }, "node_modules/@verida/storage-link": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@verida/storage-link/-/storage-link-2.3.5.tgz", - "integrity": "sha512-GmAyboA11UJiziUx5Y4WkIXLP7rCe8cJQioekUrg/240ml8wNVd5cvHsDErNsZIIzB9loVzkAIlAvFYvMnoUIg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@verida/storage-link/-/storage-link-2.3.6.tgz", + "integrity": "sha512-I/4Pqi7FVa6sErXsCvXqbNI0aa38pKGnnPDxEG2oMFUCRbFvU79zcg2+jjJVqn7dFN1CEkOkKmxZkVkDzJgoDg==", "dependencies": { - "@verida/did-client": "^2.3.5", + "@verida/did-client": "^2.3.6", "@verida/did-document": "^2.3.1", "@verida/encryption-utils": "^2.2.1", "@verida/keyring": "^2.3.1", @@ -11216,9 +11249,9 @@ } }, "node_modules/@verida/vda-did-resolver": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@verida/vda-did-resolver/-/vda-did-resolver-2.3.5.tgz", - "integrity": "sha512-QSytshBHY/OjqLLCLzgCykVrUXK2R8jc1CYe9sramcmcJzfnN7i4HhxIj9D+WQNDaF9bHultX/VW+jClDelXqw==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@verida/vda-did-resolver/-/vda-did-resolver-2.3.6.tgz", + "integrity": "sha512-3xfxS8P9tVZlZBoHiWTn8GG3j+UYrDcBoQHVkGjUHjC8Y5UXdSoP94pg0WN4bzpd4sQPbNlKiJL2vrUEvtgCBA==", "dependencies": { "@ethersproject/providers": "^5.7.2", "@verida/did-document": "^2.3.1", @@ -13342,9 +13375,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001513", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001513.tgz", - "integrity": "sha512-pnjGJo7SOOjAGytZZ203Em95MRM8Cr6jhCXNF/FAXTpCTRTECnqQWLpiTRqrFtdYcth8hf4WECUpkezuYsMVww==", + "version": "1.0.30001515", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz", + "integrity": "sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==", "devOptional": true, "funding": [ { @@ -13898,9 +13931,9 @@ } }, "node_modules/conventional-changelog-writer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-6.0.0.tgz", - "integrity": "sha512-8PyWTnn7zBIt9l4hj4UusFs1TyG+9Ulu1zlOAc72L7Sdv9Hsc8E86ot7htY3HXCVhXHB/NO0pVGvZpwsyJvFfw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-6.0.1.tgz", + "integrity": "sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==", "dev": true, "dependencies": { "conventional-commits-filter": "^3.0.0", @@ -13908,7 +13941,7 @@ "handlebars": "^4.7.7", "json-stringify-safe": "^5.0.1", "meow": "^8.1.2", - "semver": "^6.3.0", + "semver": "^7.0.0", "split": "^1.0.1" }, "bin": { @@ -13918,15 +13951,6 @@ "node": ">=14" } }, - "node_modules/conventional-changelog-writer/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/conventional-commits-filter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", @@ -14567,9 +14591,9 @@ } }, "node_modules/default-gateway/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "optional": true, "peer": true, "bin": { @@ -15014,9 +15038,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.453", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.453.tgz", - "integrity": "sha512-BU8UtQz6CB3T7RIGhId4BjmjJVXQDujb0+amGL8jpcluFJr6lwspBOvkUbnttfpZCm4zFMHmjrX1QrdPWBBMjQ==", + "version": "1.4.455", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.455.tgz", + "integrity": "sha512-8tgdX0Odl24LtmLwxotpJCVjIndN559AvaOtd67u+2mo+IDsgsTF580NB+uuDCqsHw8yFg53l5+imFV9Fw3cbA==", "devOptional": true }, "node_modules/elliptic": { @@ -15775,14 +15799,14 @@ } }, "node_modules/expo": { - "version": "49.0.0", - "resolved": "https://registry.npmjs.org/expo/-/expo-49.0.0.tgz", - "integrity": "sha512-6Z0niKnAx0/amM0MDA8ekYwjDnhgRA0gCYwMnN9v0z0zH1ObBxWio8MzRgFyki3dCxktS8Z6WzuYLfnIkTY22w==", + "version": "49.0.2", + "resolved": "https://registry.npmjs.org/expo/-/expo-49.0.2.tgz", + "integrity": "sha512-fpUz1vegrd1lPzS+A+HbkOF5Lt+tIq6vKiSmw6sW89JMBx5rpKTnTnVVvDuMOG1pnXxZlmQtYTrw0C6H9zcTNw==", "optional": true, "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "0.10.9", + "@expo/cli": "0.10.10", "@expo/config": "8.1.2", "@expo/config-plugins": "7.2.5", "@expo/vector-icons": "^13.0.0", @@ -15794,7 +15818,7 @@ "expo-font": "~11.4.0", "expo-keep-awake": "~12.3.0", "expo-modules-autolinking": "1.5.0", - "expo-modules-core": "1.5.4", + "expo-modules-core": "1.5.6", "fbemitter": "^3.0.0", "invariant": "^2.2.4", "md5-file": "^3.2.3", @@ -15936,9 +15960,9 @@ } }, "node_modules/expo-modules-core": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-1.5.4.tgz", - "integrity": "sha512-/oID+SnVYUakb1De3FoT/gBPosPjY+docyHc+M8ZoPsA3LOdlCOkrQG9yw2lWEP2wDNVN6SAa/wcyNeLSIbdAw==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-1.5.6.tgz", + "integrity": "sha512-3OsWO8p0BSX7qgkYPnl+B/fz5rCJt1rU3nsa1fi1p3Oy44bvvdb2FVejTBIb87I41i0Rcj7vn2uG1KWuK1TA1Q==", "optional": true, "peer": true, "dependencies": { @@ -16544,9 +16568,9 @@ } }, "node_modules/find-cache-dir/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "optional": true, "peer": true, "bin": { @@ -17356,9 +17380,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz", - "integrity": "sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz", + "integrity": "sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==", "dev": true, "dependencies": { "agent-base": "^7.0.2", @@ -18368,9 +18392,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -20860,9 +20884,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -21019,9 +21043,9 @@ } }, "node_modules/marked-terminal/node_modules/type-fest": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.12.0.tgz", - "integrity": "sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.0.tgz", + "integrity": "sha512-Gur3yQGM9qiLNs0KPP7LPgeRbio2QTt4xXouobMCarR0/wyW3F+F/+OWwshg3NG0Adon7uQfSZBpB46NfhoF1A==", "dev": true, "engines": { "node": ">=14.16" @@ -21278,9 +21302,9 @@ } }, "node_modules/meow/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -26610,9 +26634,9 @@ } }, "node_modules/password-prompt/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "optional": true, "peer": true, "bin": { @@ -28112,9 +28136,9 @@ } }, "node_modules/react-devtools-core": { - "version": "4.27.8", - "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.27.8.tgz", - "integrity": "sha512-KwoH8/wN/+m5wTItLnsgVraGNmFrcTWR3k1VimP1HjtMMw4CNF+F5vg4S/0tzTEKIdpCi2R7mPNTC+/dswZMgw==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.0.tgz", + "integrity": "sha512-E3C3X1skWBdBzwpOUbmXG8SgH6BtsluSMe+s6rRcujNKG1DGi8uIfhdhszkgDpAsMoE55hwqRUzeXCmETDBpTg==", "optional": true, "peer": true, "dependencies": { @@ -28410,9 +28434,9 @@ } }, "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.12.0.tgz", - "integrity": "sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.0.tgz", + "integrity": "sha512-Gur3yQGM9qiLNs0KPP7LPgeRbio2QTt4xXouobMCarR0/wyW3F+F/+OWwshg3NG0Adon7uQfSZBpB46NfhoF1A==", "dev": true, "engines": { "node": ">=14.16" @@ -28519,9 +28543,9 @@ } }, "node_modules/read-pkg/node_modules/type-fest": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.12.0.tgz", - "integrity": "sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.0.tgz", + "integrity": "sha512-Gur3yQGM9qiLNs0KPP7LPgeRbio2QTt4xXouobMCarR0/wyW3F+F/+OWwshg3NG0Adon7uQfSZBpB46NfhoF1A==", "dev": true, "engines": { "node": ">=14.16" @@ -29437,9 +29461,9 @@ } }, "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -30555,7 +30579,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", - "devOptional": true, + "optional": true, + "peer": true, "engines": { "node": ">=8" } @@ -30574,13 +30599,13 @@ } }, "node_modules/tempy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", - "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", "dev": true, "dependencies": { "is-stream": "^3.0.0", - "temp-dir": "^2.0.0", + "temp-dir": "^3.0.0", "type-fest": "^2.12.2", "unique-string": "^3.0.0" }, @@ -30603,6 +30628,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/tempy/node_modules/temp-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, "node_modules/tempy/node_modules/type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", @@ -30633,9 +30667,9 @@ } }, "node_modules/terser": { - "version": "5.18.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.2.tgz", - "integrity": "sha512-Ah19JS86ypbJzTzvUCX7KOsEIhDaRONungA4aYBjEP3JZRf4ocuDzTg4QWZnPn9DEMiMYGJPiSOy7aykoCc70w==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.0.tgz", + "integrity": "sha512-JpcpGOQLOXm2jsomozdMDpd5f8ZHh1rR48OFgWUH3QsyZcfPgv2qDCYbcDEAYNd4OZRj2bWYKpwdll/udZCk/Q==", "devOptional": true, "peer": true, "dependencies": { diff --git a/package.json b/package.json index 0d28994b..8553c8bc 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "README.md" ], "dependencies": { - "@cheqd/did-provider-cheqd": "^3.5.0", + "@cheqd/did-provider-cheqd": "^3.6.0", "@cosmjs/amino": "^0.31.0", "@cosmjs/encoding": "^0.30.1", "@logto/express": "^2.0.2", @@ -55,13 +55,14 @@ "@veramo/did-resolver": "^5.2.0", "@veramo/key-manager": "^5.1.2", "@veramo/kms-local": "^5.1.2", - "@verida/account-node": "^2.3.5", - "@verida/client-ts": "^2.3.5", + "@verida/account-node": "^2.3.6", + "@verida/client-ts": "^2.3.6", "@verida/types": "^2.3.1", - "@verida/vda-did-resolver": "^2.3.5", + "@verida/vda-did-resolver": "^2.3.6", "cookie-parser": "^1.4.6", "copyfiles": "^2.4.1", "cors": "^2.8.5", + "did-jwt": "^7.2.4", "did-resolver": "^4.1.0", "dotenv": "^16.3.1", "express": "^4.18.2", @@ -92,12 +93,12 @@ "@types/express-session": "^1.17.7", "@types/helmet": "^4.0.0", "@types/json-stringify-safe": "^5.0.0", - "@types/node": "^20.4.0", + "@types/node": "^20.4.1", "@types/secp256k1": "^4.0.3", "@types/swagger-ui-express": "^4.1.3", "@types/uuid": "^9.0.2", - "@typescript-eslint/eslint-plugin": "^5.61.0", - "@typescript-eslint/parser": "^5.61.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "buffer": "6.0.3", "conventional-changelog-conventionalcommits": "^6.1.0", "eslint": "^8.44.0", diff --git a/src/controllers/credentials.ts b/src/controllers/credentials.ts index a636e9e8..ec8ff992 100644 --- a/src/controllers/credentials.ts +++ b/src/controllers/credentials.ts @@ -29,6 +29,8 @@ export class CredentialController { return false }) .withMessage('Entry must be a jwt string or an credential'), + check('policies').optional().isObject().withMessage('Verification policies should be an object'), + query('verifyStatus').optional().isBoolean().withMessage('verifyStatus should be a boolean value'), query('publish').optional().isBoolean().withMessage('publish should be a boolean value') ] @@ -41,6 +43,9 @@ export class CredentialController { return false }) .withMessage('Entry must be a jwt string or a presentation'), + check('verifierDid').optional().isString().withMessage('Invalid verifier DID'), + check('policies').optional().isObject().withMessage('Verification policies should be an object'), + query('verifyStatus').optional().isBoolean().withMessage('verifyStatus should be a boolean value') ] public async issue(request: Request, response: Response) { @@ -76,8 +81,18 @@ export class CredentialController { if (!result.isEmpty()) { return response.status(400).json({ error: result.array()[0].msg }) } + + const { credential, policies } = request.body + const verifyStatus = request.query.verifyStatus === 'true' ? true : false try { - const result = await Credentials.instance.verify_credentials(request.body.credential, request.body.statusOptions, response.locals.customerId) + const result = await Identity.instance.verifyCredential( + credential, + { + verifyStatus, + policies + }, + response.locals.customerId + ) if (result.error) { return response.status(400).json({ verified: result.verified, @@ -144,8 +159,18 @@ export class CredentialController { return response.status(400).json({ error: result.array()[0].msg }) } + const { presentation, verifierDid, policies } = request.body + const verifyStatus = request.query.verifyStatus === 'true' ? true : false try { - const result = await Identity.instance.verifyPresentation(request.body.presentation, request.body.statusOptions, response.locals.customerId) + const result = await Identity.instance.verifyPresentation( + presentation, + { + verifyStatus, + policies, + domain: verifierDid + }, + response.locals.customerId + ) if (result.error) { return response.status(400).json({ verified: result.verified, diff --git a/src/services/credentials.ts b/src/services/credentials.ts index d8ddadd6..53dcdbd9 100644 --- a/src/services/credentials.ts +++ b/src/services/credentials.ts @@ -4,7 +4,7 @@ import { VC_CONTEXT, VC_TYPE } from '../types/constants.js' -import { CredentialRequest, VerifyCredentialStatusOptions, VerifyPresentationStatusOptions } from '../types/types.js' +import { CredentialRequest, VerificationOptions } from '../types/types.js' import { Identity } from './identity/index.js' import { VeridaService } from '../services/connectors/verida.js' import { v4 } from 'uuid' @@ -50,15 +50,4 @@ export class Credentials { } return verifiable_credential } - - async verify_credentials(credential: W3CVerifiableCredential | string, statusOptions: VerifyCredentialStatusOptions | null, agentId: string): Promise { - const result = await Identity.instance.verifyCredential(credential, statusOptions, agentId) - delete(result.payload) - return result - } - - async verify_presentation(presentation: W3CVerifiablePresentation, statusOptions: VerifyPresentationStatusOptions | null, agentId: string): Promise { - const result = await Identity.instance.verifyPresentation(presentation, statusOptions, agentId) - return result - } } diff --git a/src/services/identity/IIdentity.ts b/src/services/identity/IIdentity.ts index dbccaba1..8e82d22f 100644 --- a/src/services/identity/IIdentity.ts +++ b/src/services/identity/IIdentity.ts @@ -12,7 +12,7 @@ import type { import type { AbstractPrivateKeyStore } from '@veramo/key-manager' import type { ResourcePayload } from '@cheqd/did-provider-cheqd' import type { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result, RevocationResult, StatusCheckResult, SuspensionResult, UnsuspensionResult } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' -import type { BroadCastStatusListOptions, CheckStatusListOptions, CreateStatusListOptions, CredentialRequest, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerifyCredentialStatusOptions, VerifyPresentationStatusOptions } from '../../types/types' +import type { BroadCastStatusListOptions, CheckStatusListOptions, CreateStatusListOptions, CredentialRequest, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types' export interface IIdentity { agent?: TAgent @@ -30,8 +30,8 @@ export interface IIdentity { importDid(did: string, privateKeyHex: string, publicKeyHex: string, agentId?: string): Promise createResource(network: string, payload: ResourcePayload, agentId?: string): Promise createCredential(credential: CredentialPayload, format: CredentialRequest['format'], statusOptions: StatusOptions | null, agentId?: string): Promise - verifyCredential(credential: VerifiableCredential | string, statusOptions: VerifyCredentialStatusOptions | null, agentId?: string): Promise - verifyPresentation(presentation: VerifiablePresentation | string, statusOptions: VerifyPresentationStatusOptions, agentId?: string): Promise + verifyCredential(credential: VerifiableCredential | string, verificationOptions: VerificationOptions, agentId?: string): Promise + verifyPresentation(presentation: VerifiablePresentation | string, verificationOptions: VerificationOptions, agentId?: string): Promise createStatusList2021(did: string, resourceOptions: ResourcePayload, statusOptions: CreateStatusListOptions, agentId: string): Promise updateStatusList2021(did: string, statusOptions: UpdateStatusListOptions, publish?: boolean, agentId?: string): Promise broadcastStatusList2021(did: string, resourceOptions: ResourcePayload, statusOptions: BroadCastStatusListOptions, agentId?: string): Promise diff --git a/src/services/identity/agent.ts b/src/services/identity/agent.ts index e742e3e0..21bc011e 100644 --- a/src/services/identity/agent.ts +++ b/src/services/identity/agent.ts @@ -14,7 +14,7 @@ import { MinimalImportableKey, TAgent, VerifiableCredential, - VerifiablePresentation, + VerifiablePresentation } from '@veramo/core' import { KeyManager } from '@veramo/key-manager' import { DIDStore, KeyStore } from '@veramo/data-store' @@ -35,6 +35,7 @@ import type { ICheqdRevokeBulkCredentialsWithStatusList2021Args, ICheqdUpdateIdentifierArgs, ICheqdVerifyCredentialWithStatusList2021Args, + ICheqdVerifyPresentationWithStatusList2021Args, } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' import { BroadCastStatusListOptions, @@ -48,10 +49,10 @@ import { SuspensionStatusOptions, UpdateStatusListOptions, VeramoAgent, - VerifyCredentialStatusOptions, - VerifyPresentationStatusOptions + VerificationOptions } from '../../types/types.js' import { VC_PROOF_FORMAT, VC_REMOVE_ORIGINAL_FIELDS } from '../../types/constants.js' +import { decodeJWT } from 'did-jwt' const resolverUrl = "https://resolver.cheqd.net/1.0/identifiers/" @@ -238,16 +239,26 @@ export class Veramo { } } - async verifyCredential(agent: VeramoAgent, credential: string | VerifiableCredential, statusOptions: VerifyCredentialStatusOptions | null): Promise { - if(typeof credential !== 'string' && credential.credentialStatus) { - return await agent.cheqdVerifyCredential({ + async verifyCredential(agent: VeramoAgent, credential: string | VerifiableCredential, verificationOptions: VerificationOptions = {}): Promise { + const decodedCredential = typeof credential === 'string' ? decodeJWT(credential) as unknown as VerifiableCredential : credential + let result: IVerifyResult + if(verificationOptions.verifyStatus) { + result = await agent.cheqdVerifyCredential({ credential: credential as VerifiableCredential, fetchList: true, - ...statusOptions + verificationArgs: { + ...verificationOptions, + fetchRemoteContexts: verificationOptions.fetchRemoteContexts || decodedCredential.proof.jws + } } as ICheqdVerifyCredentialWithStatusList2021Args) + } else { + result = await agent.verifyCredential({ + credential, + ...verificationOptions, + fetchRemoteContexts: verificationOptions.fetchRemoteContexts || decodedCredential.proof.jws + }) } - const result = await agent.verifyCredential({ credential, fetchRemoteContexts: true }) if (result.didResolutionResult) { delete(result.didResolutionResult) } @@ -259,19 +270,28 @@ export class Veramo { if (result.verifiableCredential) { delete(result.verifiableCredential) } + + if (result.payload) { + delete(result.payload) + } + return result } - async verifyPresentation(agent: VeramoAgent, presentation: VerifiablePresentation | string, statusOptions: VerifyPresentationStatusOptions | null): Promise { - // TODO: expose domain in did-provider-cheqd - // if(typeof presentation !== 'string') { - // return await agent.cheqdVerifyPresentation({ - // presentation: presentation as VerifiablePresentation, - // fetchList: true, - // ...statusOptions - // } as ICheqdVerifyPresentationWithStatusList2021Args) - // } - const result = await agent.verifyPresentation({ presentation, fetchRemoteContexts: true, policies: {audience: false} }) + async verifyPresentation(agent: VeramoAgent, presentation: VerifiablePresentation | string, verificationOptions: VerificationOptions = {}): Promise { + let result: IVerifyResult + if(verificationOptions.verifyStatus) { + result = await agent.cheqdVerifyPresentation({ + presentation: presentation as VerifiablePresentation, + fetchList: true, + verificationArgs: { + ...verificationOptions + }, + } as ICheqdVerifyPresentationWithStatusList2021Args) + } else { + result = await agent.verifyPresentation({ presentation, ...verificationOptions, fetchRemoteContexts: verificationOptions.fetchRemoteContexts || false }) + } + if (result.didResolutionResult) { delete(result.didResolutionResult) } @@ -283,6 +303,11 @@ export class Veramo { if (result.verifiablePresentation) { delete(result.verifiablePresentation) } + + if (result.payload) { + delete(result.payload) + } + return result } diff --git a/src/services/identity/local.ts b/src/services/identity/local.ts index f9af6e88..7d07932d 100644 --- a/src/services/identity/local.ts +++ b/src/services/identity/local.ts @@ -12,7 +12,7 @@ import { CheqdDIDProvider, ResourcePayload } from '@cheqd/did-provider-cheqd' import { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result, StatusCheckResult } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' import { CheqdNetwork } from '@cheqd/sdk' -import { BroadCastStatusListOptions, CheckStatusListOptions, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerifyCredentialStatusOptions, VerifyPresentationStatusOptions } from '../../types/types.js' +import { BroadCastStatusListOptions, CheckStatusListOptions, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types.js' import { Connection } from '../../database/connection/connection.js' import { IIdentity } from './IIdentity.js' import { Veramo } from './agent.js' @@ -146,12 +146,12 @@ export class LocalIdentity implements IIdentity { } } - async verifyCredential(credential: VerifiableCredential | string, statusOptions: VerifyCredentialStatusOptions | null): Promise { - return await Veramo.instance.verifyCredential(this.initAgent(), credential, statusOptions) + async verifyCredential(credential: VerifiableCredential | string, verificationOptions: VerificationOptions): Promise { + return await Veramo.instance.verifyCredential(this.initAgent(), credential, verificationOptions) } - async verifyPresentation(presentation: VerifiablePresentation | string, statusOptions: VerifyPresentationStatusOptions | null): Promise { - return await Veramo.instance.verifyPresentation(this.initAgent(), presentation, statusOptions) + async verifyPresentation(presentation: VerifiablePresentation | string, verificationOptions: VerificationOptions): Promise { + return await Veramo.instance.verifyPresentation(this.initAgent(), presentation, verificationOptions) } async createStatusList2021(did: string, resourceOptions: ResourcePayload, statusListOptions: CreateStatusListOptions): Promise { diff --git a/src/services/identity/postgres.ts b/src/services/identity/postgres.ts index d2c410f6..3ad22c53 100644 --- a/src/services/identity/postgres.ts +++ b/src/services/identity/postgres.ts @@ -16,7 +16,7 @@ import { KeyManagementSystem, SecretBox } from '@veramo/kms-local' import { PrivateKeyStore } from '@veramo/data-store' import { CheqdDIDProvider, ResourcePayload } from '@cheqd/did-provider-cheqd' import { CheqdNetwork } from '@cheqd/sdk' -import { BroadCastStatusListOptions, CheckStatusListOptions, cheqdDidRegex, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerifyCredentialStatusOptions, VerifyPresentationStatusOptions } from '../../types/types.js' +import { BroadCastStatusListOptions, CheckStatusListOptions, cheqdDidRegex, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types.js' import { Connection } from '../../database/connection/connection.js' import { CustomerEntity } from '../../database/entities/customer.entity.js' import { IIdentity } from './IIdentity.js' @@ -214,14 +214,14 @@ export class PostgresIdentity implements IIdentity { } } - async verifyCredential(credential: string | VerifiableCredential, statusOptions: VerifyCredentialStatusOptions | null, agentId: string): Promise { + async verifyCredential(credential: string | VerifiableCredential, verificationOptions: VerificationOptions, agentId: string): Promise { const agent = await this.createAgent(agentId) - return await Veramo.instance.verifyCredential(agent, credential, statusOptions) + return await Veramo.instance.verifyCredential(agent, credential, verificationOptions) } - async verifyPresentation(presentation: VerifiablePresentation | string, statusOptions: VerifyPresentationStatusOptions | null, agentId: string): Promise { + async verifyPresentation(presentation: VerifiablePresentation | string, verificationOptions: VerificationOptions, agentId: string): Promise { const agent = await this.createAgent(agentId) - return await Veramo.instance.verifyPresentation(agent, presentation, statusOptions) + return await Veramo.instance.verifyPresentation(agent, presentation, verificationOptions) } async createStatusList2021(did: string, resourceOptions: ResourcePayload, statusOptions: CreateStatusListOptions, agentId: string): Promise { diff --git a/src/static/swagger.json b/src/static/swagger.json index a63d2b34..cac6d529 100644 --- a/src/static/swagger.json +++ b/src/static/swagger.json @@ -1,1495 +1,1266 @@ { - "openapi": "3.0.0", - "servers": [ - { - "url": "/" - } - ], - "info": { - "description": "API service to create and manage DIDs and credentials on cheqd network.", - "version": "2.0.0", - "title": "Credential Service for cheqd network" - }, - "tags": [ - { - "name": "Credential", - "externalDocs": { - "url": "https://github.com/cheqd/credential-service#readme" - } + "openapi": "3.0.0", + "servers": [ + { + "url": "/" + } + ], + "info": { + "description": "API service to create and manage DIDs and credentials on cheqd network.", + "version": "2.0.0", + "title": "Credential Service for cheqd network" + }, + "tags": [ + { + "name": "Credential", + "externalDocs": { + "url": "https://github.com/cheqd/credential-service#readme" } - ], - "paths": { - "/key/create": { - "post": { - "tags": [ - "Key" - ], - "summary": "Create a Keypair", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KeyResult" - } + } + ], + "paths": { + "/key/create": { + "post": { + "tags": [ + "Key" + ], + "summary": "Create a Keypair", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KeyResult" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/key/{kid}": { - "get": { - "tags": [ - "Key" - ], - "summary": "Fetch keypair", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "kid", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KeyResult" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" + } + }, + "/key/{kid}": { + "get": { + "tags": [ + "Key" + ], + "summary": "Fetch keypair", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "kid", + "schema": { + "type": "string" }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "required": true } - } - }, - "/did/create": { - "post": { - "tags": [ - "DID" - ], - "summary": "Create a DID", - "description": "

This endpoint creates a DID by taking a set of input parameters or the whole didDocument itself

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { + ], + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/DIDCreateRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/DIDCreateRequest" + "$ref": "#/components/schemas/KeyResult" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } + } + } + } + } + }, + "/did/create": { + "post": { + "tags": [ + "DID" + ], + "summary": "Create a DID", + "description": "

This endpoint creates a DID by taking a set of input parameters or the whole didDocument itself

", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/DIDCreateRequest" } }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/DIDCreateRequest" } } } - } - }, - "/did/update": { - "post": { - "tags": [ - "DID" - ], - "summary": "Update a DID", - "description": "

This endpoint updates a DID by taking DID document or the particular fields needed to be updated

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { + }, + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/DIDUpdateRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/DIDUpdateRequest" + "$ref": "#/components/schemas/DidResult" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/did/deactivate/{did}": { - "post": { - "tags": [ - "DID" - ], - "summary": "Deactivate a DID", - "description": "

This endpoint deactivates a DID by taking DID document or a verification method as an input.

", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "did", + } + }, + "/did/update": { + "post": { + "tags": [ + "DID" + ], + "summary": "Update a DID", + "description": "

This endpoint updates a DID by taking DID document or the particular fields needed to be updated

", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } + "$ref": "#/components/schemas/DIDUpdateRequest" } }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/DIDUpdateRequest" } } } - } - }, - "/did/list": { - "get": { - "tags": [ - "DID" - ], - "summary": "Fetch DIDs from wallet", - "description": "

This endpoint returns the list of DIDs controlled by the account

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } + }, + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/did/{did}": { - "get": { - "tags": [ - "DID" - ], - "summary": "Resolve a DID", - "description": "

This endpoint resolved a DID

", - "parameters": [ - { - "in": "path", - "name": "did", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidDocument" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" + } + }, + "/did/deactivate/{did}": { + "post": { + "tags": [ + "DID" + ], + "summary": "Deactivate a DID", + "description": "

This endpoint deactivates a DID by taking DID document or a verification method as an input.

", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "required": true } - } - }, - "/credential/issue": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Issue a credential", - "description": "

This endpoint issues a credential. As input it takes the list of attributes, subjectDid, context and expiration date of the credential to be issued.

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { + ], + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialRequest" + "$ref": "#/components/schemas/DidResult" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Credential" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential/verify": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Verify a credential", - "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", - "operationId": "verify", - "requestBody": { + } + }, + "/did/list": { + "get": { + "tags": [ + "DID" + ], + "summary": "Fetch DIDs from wallet", + "description": "

This endpoint returns the list of DIDs controlled by the account

", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { + "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialVerifyRequest" + "type": "array", + "items": { + "type": "string" + } } - }, + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialVerifyRequest" + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential/revoke": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Revoke a credential", - "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", - "operationId": "revoke", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "requestBody": { + } + }, + "/did/{did}": { + "get": { + "tags": [ + "DID" + ], + "summary": "Resolve a DID", + "description": "

This endpoint resolved a DID

", + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" + "$ref": "#/components/schemas/DidDocument" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RevocationResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential/suspend": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Suspend a credential", - "description": "

This endpoint suspends the credential. As input it takes the entire credential itself

", - "operationId": "suspend", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", + } + }, + "/credential/issue": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Issue a credential", + "description": "

This endpoint issues a credential. As input it takes the list of attributes, subjectDid, context and expiration date of the credential to be issued.

", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/CredentialRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRequest" } } - ], - "requestBody": { + } + }, + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" + "$ref": "#/components/schemas/Credential" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SuspensionResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential/reinstate": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Reinstate a credential", - "description": "

This endpoint reinstates the credential. As input it takes the entire credential itself

", - "operationId": "reinstate", - "security": [ - { - "bearerAuth": [] + } + }, + "/credential/verify": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Verify a credential", + "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", + "operationId": "verify", + "parameters": [ + { + "in": "query", + "name": "verifyStatus", + "schema": { + "type": "boolean", + "default": false } - ], - "parameters": [ - { - "in": "query", - "name": "publish", + }, + { + "in": "query", + "name": "fetchRemoteContexts", + "description": "When dealing with JSON-LD you also MUST provide the proper contexts. * Set this to `true` ONLY if you want the `@context` URLs to be fetched in case they are a custom context.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/CredentialVerifyRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialVerifyRequest" } } - ], - "requestBody": { + } + }, + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { + "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" + "$ref": "#/components/schemas/IVerifyResult" } - }, + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnSuspensionResult" - } + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } + } + } + } + } + }, + "/credential/revoke": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Revoke a credential", + "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", + "operationId": "revoke", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" } }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" } } } - } - }, - "/presentation/verify": { - "post": { - "tags": [ - "Presentation" - ], - "summary": "Verify a credential presentation", - "description": "

This endpoint verifies the credential presentation. As input it takes the entire presentation itself

", - "operationId": "presentation", - "requestBody": { + }, + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/PresentationRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/PresentationRequest" + "$ref": "#/components/schemas/RevocationResult" } } } }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/account": { - "post": { - "tags": [ - "Account" - ], - "summary": "Create a client", - "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", - "security": [ - { - "bearerAuth": [] + } + }, + "/credential/suspend": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Suspend a credential", + "description": "

This endpoint suspends the credential. As input it takes the entire credential itself

", + "operationId": "suspend", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "schema": { + "type": "boolean" } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" } }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" } } } }, - "get": { - "tags": [ - "Account" - ], - "summary": "Fetch a client", - "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuspensionResult" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/resource/create/{did}": { - "post": { - "tags": [ - "Resource" - ], - "summary": "Create a Resource", - "parameters": [ - { - "in": "path", - "name": "did", - "required": true, + } + }, + "/credential/reinstate": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Reinstate a credential", + "description": "

This endpoint reinstates the credential. As input it takes the entire credential itself

", + "operationId": "reinstate", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "string" + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" } } - ], - "requestBody": { + } + }, + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { + "application/json": { "schema": { - "$ref": "#/components/schemas/CreateResourceRequest" + "$ref": "#/components/schemas/UnSuspensionResult" } - }, + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateResourceRequest" + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } } }, - "responses": { - "200": { - "description": "The resource is created successfully" - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential-status/create": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Create statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, + } + }, + "/presentation/verify": { + "post": { + "tags": [ + "Presentation" + ], + "summary": "Verify a credential presentation", + "description": "

This endpoint verifies the credential presentation. As input it takes the entire presentation itself

", + "operationId": "presentation", + "parameters": [ + { + "in": "query", + "name": "verifyStatus", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "fetchRemoteContexts", + "description": "When dealing with JSON-LD you also MUST provide the proper contexts. * Set this to `true` ONLY if you want the `@context` URLs to be fetched in case they are a custom context.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] + "$ref": "#/components/schemas/PresentationRequest" } }, - { - "in": "query", - "name": "encrypted", - "required": true, + "application/json": { "schema": { - "type": "boolean", - "default": false + "$ref": "#/components/schemas/PresentationRequest" } } - ], - "requestBody": { + } + }, + "responses": { + "200": { + "description": "The request was successful", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusCreateRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialStatusCreateRequest" + "$ref": "#/components/schemas/IVerifyResult" } } } }, - "responses": { - "200": { - "description": "StatusList is created successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential-status/update": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Publish statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusAction", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revoke", - "suspend", - "reinstate" - ] - } - }, - { - "in": "query", - "name": "publish", - "required": true, - "schema": { - "type": "boolean", - "default": true + } + }, + "/account": { + "post": { + "tags": [ + "Account" + ], + "summary": "Create a client", + "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } } } - ], - "requestBody": { + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", "content": { - "application/x-www-form-urlencoded": { + "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialStatusUpdateRequest" + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialStatusUpdateRequest" + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } - }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } + } + } + }, + "get": { + "tags": [ + "Account" + ], + "summary": "Fetch a client", + "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential-status/publish": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Publish statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, + } + }, + "/resource/create/{did}": { + "post": { + "tags": [ + "Resource" + ], + "summary": "Create a Resource", + "parameters": [ + { + "in": "path", + "name": "did", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] + "$ref": "#/components/schemas/CreateResourceRequest" } }, - { - "in": "query", - "name": "encrypted", - "required": true, + "application/json": { "schema": { - "type": "boolean", - "default": false + "$ref": "#/components/schemas/CreateResourceRequest" } } - ], - "requestBody": { + } + }, + "responses": { + "200": { + "description": "The resource is created successfully" + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusPublishRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialStatusPublishRequest" + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } } }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential-status/check": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Check Credential Status of an index in statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, + } + }, + "/credential-status/create": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Create statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] + "$ref": "#/components/schemas/CredentialStatusCreateRequest" } }, - { - "in": "query", - "name": "encrypted", - "required": true, + "application/json": { "schema": { - "type": "boolean", - "default": false + "$ref": "#/components/schemas/CredentialStatusCreateRequest" } } - ], - "requestBody": { + } + }, + "responses": { + "200": { + "description": "StatusList is created successfully", "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusCheckRequest" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/CredentialStatusCheckRequest" + "$ref": "#/components/schemas/CredentialStatusResult" } } } }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } } } - }, - "/credential-status/search": { - "get": { - "tags": [ - "Credential Status" - ], - "summary": "Fetch statusList's published by a DID", - "parameters": [ - { - "in": "query", - "name": "did", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "statusPurpose", + } + }, + "/credential-status/update": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Publish statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusAction", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revoke", + "suspend", + "reinstate" + ] + } + }, + { + "in": "query", + "name": "publish", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] + "$ref": "#/components/schemas/CredentialStatusUpdateRequest" } }, - { - "in": "query", - "name": "statusListName", + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusUpdateRequest" } } - ], - "responses": { - "200": { - "description": "StatusList is fetched successfully", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "statusListName": { - "type": "string" - }, - "statusListVersion": { - "type": "string" - }, - "statusListId": { - "type": "string" - }, - "statusListNextVersion": { - "type": "string" - } - } - } - } + } + }, + "responses": { + "200": { + "description": "StatusList is published successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" } } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } } } @@ -1497,922 +1268,1246 @@ } } }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - } - }, - "schemas": { - "DidResult": { - "type": "object", - "properties": { - "did": { - "type": "string" - }, - "controllerKeyId": { - "type": "string" - }, - "keys": { - "type": "array", - "items": { - "type": "object" - } - }, - "services": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Service" - } + "/credential-status/publish": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Publish statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] } - } - }, - "KeyResult": { - "type": "object", - "properties": { - "kid": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "Ed25519", - "Secp256k1" - ] - }, - "publicKeyHex": { - "type": "string" + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false } } - }, - "DidDocument": { - "description": "This input field contains a complete DID document", - "type": "object", - "properties": { - "context": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "controller": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - ] - }, - "authentication": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" - ] - }, - "assertionMethod": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilityInvocation": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilityDelegation": { - "type": "array", - "items": { - "type": "string" - } - }, - "keyAgreement": { - "type": "array", - "items": { - "type": "string" - } - }, - "verificationMethod": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VerificationMethod" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" } }, - "service": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Service" + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" } } - }, - "example": { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "controller": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - ], - "verificationMethod": [ - { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "type": "Ed25519VerificationKey2018", - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - } - ], - "authentication": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1" - ] } }, - "VerificationMethod": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" - }, - "type": { - "type": "string", - "example": "Ed25519VerificationKey2018" - }, - "controller": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "publicKeyBase58": { - "type": "string", - "example": "so1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - }, - "publicKeyMultibase": { - "type": "string", - "example": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - }, - "publicKeyJwk": { - "type": "array", - "items": { - "type": "string" + "responses": { + "200": { + "description": "StatusList is published successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" + } } } }, - "example": { - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", - "type": "Ed25519VerificationKey2018" - } - }, - "Service": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#rand" - }, - "type": { - "type": "string", - "example": "rand" - }, - "serviceEndpoint": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "https://rand.in" - ] - } - } - }, - "CredentialRequest": { - "description": "Input fields for the create operation.", - "type": "object", - "additionalProperties": false, - "properties": { - "issuerDid": { - "description": "This input field is the Issuer's DID", - "type": "string" - }, - "subjectDid": { - "description": "This input field is the holder's DID", - "type": "string" - }, - "attributes": { - "description": "Json input of the attributes", - "type": "object" - }, - "@context": { - "description": "Additional contexts to be included in the credential", - "type": "array", - "items": { - "type": "string" + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } } - }, - "type": { - "description": "Additional type property to be included in the credential", - "type": "array", - "items": { - "type": "string" + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } } - }, - "expirationDate": { - "description": "Optional expiration date according to the specification", - "type": "string" - }, - "format": { - "description": "Select one of the supported credential formats, jwt by default", + } + } + } + } + }, + "/credential-status/check": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Check Credential Status of an index in statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { "type": "string", "enum": [ - "jwt", - "lds" + "revocation", + "suspension" ] - }, - "credentialStatus": { - "description": "Optional field to support revocation or suspension, which takes statusListName and statusListPurpose as inputs.", - "type": "object", - "required": [ - "statusPurpose", - "statusListName" - ], - "properties": { - "statusPurpose": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - }, - "statusListName": { - "type": "string" - }, - "statusListIndex": { - "type": "number" - }, - "statusListVersipon": { - "type": "string" - }, - "statusListRangeStart": { - "type": "number" - }, - "statusListRangeEnd": { - "type": "number" - }, - "indexNotIn": { - "type": "number" - } - }, - "example": { - "statusPurpose": "revocation", - "statusListName": "employee-credentials" - } } }, - "required": [ - "issuerDid", - "subjectDid", - "attributes" - ], - "example": { - "issuerDid": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "subjectDid": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", - "attributes": { - "gender": "male", - "name": "Bob" - }, - "@context": [ - "https://schema.org" - ], - "type": [ - "Person" - ], - "format": "jwt", - "credentialStatus": { - "statusPurpose": "revocation", - "statusListName": "employee-credentials", - "statusListIndex": 10 + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false } } - }, - "Credential": { - "description": "Input fields for the update operation.", - "type": "object", - "additionalProperties": false, - "properties": { - "@context": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "array", - "items": { - "type": "string" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCheckRequest" } }, - "expirationDate": { - "type": "string" - }, - "issuer": { - "type": "object", - "properties": { - "id": { - "type": "string" - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCheckRequest" } - }, - "credentialSubject": { - "type": "object", - "properties": { - "id": { - "type": "string" + } + } + }, + "responses": { + "200": { + "description": "StatusList is published successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "revoked": { + "type": "boolean" + }, + "suspended": { + "type": "boolean", + "example": "false" + } + } } } - }, - "credentialStatus": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "statusListIndex": { - "type": "string" - }, - "statusPurpose": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "type": { - "type": "string", - "enum": [ - "StatusList2021Entry" - ] + "example": { + "error": "Invalid Request" } } - }, - "issuanceDate": { - "type": "string" - }, - "proof": { - "type": "object", - "properties": { - "type": { - "type": "string" + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "jwt": { - "type": "string" + "example": { + "error": "Internal Error" } } } - }, - "example": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://schema.org", - "https://veramo.io/contexts/profile/v1" - ], - "credentialSubject": { - "gender": "male", - "id": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", - "name": "Bob" - }, - "credentialStatus": { - "id": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-suspension-1&resourceType=StatusList2021Suspension#20", - "statusListIndex": "20", - "statusPurpose": "suspension", - "type": "StatusList2021Entry" - }, - "issuanceDate": "2023-06-08T13:49:28.000Z", - "issuer": { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "proof": { - "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6Y2hlcWQ6dGVzdG5ldDo3YmY4MWEyMC02MzNjLTRjYzctYmM0YS01YTQ1ODAxMDA1ZTAiLCJuYmYiOjE2ODYyMzIxNjgsInN1YiI6ImRpZDprZXk6ejZNa2hhWGdCWkR2b3REa0w1MjU3ZmFpenRpR2lDMlF0S0xHcGJubkVHdGEyZG9LIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5vcmciLCJodHRwczovL3ZlcmFtby5pby9jb250ZXh0cy9wcm9maWxlL3YxIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImdlbmRlciI6Im1hbGUiLCJuYW1lIjoiQm9iIn0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQZXJzb24iXX19.wMfdR6RtyAZA4eoWya5Aw97wwER2Cm5Guk780Xw8H9fA3sfudIJeLRLboqixpTchqSbYeA7KbuCTAnLgXTD_Cg", - "type": "JwtProof2020" - }, - "type": [ - "VerifiableCredential", - "Person" - ] } - }, - "Customer": { - "type": "object", - "properties": { - "customerId": { - "type": "string" - }, - "address": { + } + } + }, + "/credential-status/search": { + "get": { + "tags": [ + "Credential Status" + ], + "summary": "Fetch statusList's published by a DID", + "parameters": [ + { + "in": "query", + "name": "did", + "required": true, + "schema": { "type": "string" } - } - }, - "InvalidRequest": { - "type": "object", - "properties": { - "error": { + }, + { + "in": "query", + "name": "statusPurpose", + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "statusListName", + "schema": { "type": "string" } } - }, - "UnauthorizedError": { - "description": "Access token is missing or invalid", - "type": "object", - "properties": { - "error": { - "type": "string" + ], + "responses": { + "200": { + "description": "StatusList is fetched successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "statusListName": { + "type": "string" + }, + "statusListVersion": { + "type": "string" + }, + "statusListId": { + "type": "string" + }, + "statusListNextVersion": { + "type": "string" + } + } + } + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } } }, - "example": { - "error": "Unauthorized Error" + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } } - }, - "IVerifyResult": { - "type": "object", - "properties": { - "verified": { - "type": "boolean" - }, - "issuer": { - "type": "string" - }, - "signer": { - "type": "object" - }, - "jwt": { - "type": "string" - }, - "verifiableCredential": { + } + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "DidResult": { + "type": "object", + "properties": { + "did": { + "type": "string" + }, + "controllerKeyId": { + "type": "string" + }, + "keys": { + "type": "array", + "items": { "type": "object" } }, - "example": { - "verified": true, - "policies": {}, - "issuer": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "signer": { - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", - "type": "Ed25519VerificationKey2018" + "services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" } } - }, - "CreateResourceRequest": { - "description": "Input fields for the resource creation", - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "type", - "data", - "encoding" - ], - "properties": { - "data": { - "description": "Provide encoded string for the resource data", + } + }, + "KeyResult": { + "type": "object", + "properties": { + "kid": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "Ed25519", + "Secp256k1" + ] + }, + "publicKeyHex": { + "type": "string" + } + } + }, + "DidDocument": { + "description": "This input field contains a complete DID document", + "type": "object", + "properties": { + "context": { + "type": "array", + "items": { "type": "string" - }, - "encoding": { - "description": "The encoding format of the resource data", - "type": "string", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "name": { - "description": "Resource name", + } + }, + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "controller": { + "type": "array", + "items": { "type": "string" }, - "type": { - "description": "Resource type", + "example": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + ] + }, + "authentication": { + "type": "array", + "items": { "type": "string" }, - "alsoKnownAs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - }, - "version": { + "example": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" + ] + }, + "assertionMethod": { + "type": "array", + "items": { "type": "string" } }, - "example": { - "data": "SGVsbG8gV29ybGQ=", - "name": "ResourceName", - "type": "TextDocument" - } - }, - "RevocationResult": { - "properties": { - "revoked": { - "type": "boolean" + "capabilityInvocation": { + "type": "array", + "items": { + "type": "string" } - } - }, - "SuspensionResult": { - "properties": { - "suspended": { - "type": "boolean" - }, - "statusList": { + }, + "capabilityDelegation": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyAgreement": { + "type": "array", + "items": { "type": "string" } + }, + "verificationMethod": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VerificationMethod" + } + }, + "service": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } } }, - "UnSuspensionResult": { - "properties": { - "unsuspended": { - "type": "boolean" - }, - "statusList": { + "example": { + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "controller": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + ], + "verificationMethod": [ + { + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "type": "Ed25519VerificationKey2018", + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + } + ], + "authentication": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1" + ] + } + }, + "VerificationMethod": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" + }, + "type": { + "type": "string", + "example": "Ed25519VerificationKey2018" + }, + "controller": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "publicKeyBase58": { + "type": "string", + "example": "so1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + }, + "publicKeyMultibase": { + "type": "string", + "example": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + }, + "publicKeyJwk": { + "type": "array", + "items": { "type": "string" } } }, - "DIDCreateRequest": { - "type": "object", - "properties": { - "network": { - "type": "string", - "enum": [ - "testnet", - "mainnet" - ] - }, - "methodSpecificIdAlgo": { - "type": "string", - "enum": [ - "uuid", - "base58btc" - ] - }, - "verificationMethodType": { - "type": "string", - "enum": [ - "Ed25519VerificationKey2018", - "JsonWebKey2020", - "Ed25519VerificationKey2020" - ] - }, - "serviceEndpoint": { + "example": { + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", + "type": "Ed25519VerificationKey2018" + } + }, + "Service": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#rand" + }, + "type": { + "type": "string", + "example": "rand" + }, + "serviceEndpoint": { + "type": "array", + "items": { "type": "string" }, - "assertionMethod": { - "description": "An assertion method is required to issue JSONLD credentials", - "type": "boolean", - "default": true + "example": [ + "https://rand.in" + ] + } + } + }, + "CredentialRequest": { + "description": "Input fields for the create operation.", + "type": "object", + "additionalProperties": false, + "properties": { + "issuerDid": { + "description": "This input field is the Issuer's DID", + "type": "string" + }, + "subjectDid": { + "description": "This input field is the holder's DID", + "type": "string" + }, + "attributes": { + "description": "Json input of the attributes", + "type": "object" + }, + "@context": { + "description": "Additional contexts to be included in the credential", + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "description": "Additional type property to be included in the credential", + "type": "array", + "items": { + "type": "string" + } + }, + "expirationDate": { + "description": "Optional expiration date according to the specification", + "type": "string" + }, + "format": { + "description": "Select one of the supported credential formats, jwt by default", + "type": "string", + "enum": [ + "jwt", + "lds" + ] + }, + "credentialStatus": { + "description": "Optional field to support revocation or suspension, which takes statusListName and statusListPurpose as inputs.", + "type": "object", + "required": [ + "statusPurpose", + "statusListName" + ], + "properties": { + "statusPurpose": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + }, + "statusListName": { + "type": "string" + }, + "statusListIndex": { + "type": "number" + }, + "statusListVersipon": { + "type": "string" + }, + "statusListRangeStart": { + "type": "number" + }, + "statusListRangeEnd": { + "type": "number" + }, + "indexNotIn": { + "type": "number" + } }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" + "example": { + "statusPurpose": "revocation", + "statusListName": "employee-credentials" } } }, - "DIDUpdateRequest": { - "type": "object", - "properties": { - "did": { + "required": [ + "issuerDid", + "subjectDid", + "attributes" + ], + "example": { + "issuerDid": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "subjectDid": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", + "attributes": { + "gender": "male", + "name": "Bob" + }, + "@context": [ + "https://schema.org" + ], + "type": [ + "Person" + ], + "format": "jwt", + "credentialStatus": { + "statusPurpose": "revocation", + "statusListName": "employee-credentials", + "statusListIndex": 10 + } + } + }, + "Credential": { + "description": "Input fields for the update operation.", + "type": "object", + "additionalProperties": false, + "properties": { + "@context": { + "type": "array", + "items": { "type": "string" - }, - "service": { - "type": "array", - "description": "This input field assigns the provided service array to the didDocument", - "items": { - "$ref": "#/components/schemas/Service" + } + }, + "type": { + "type": "array", + "items": { + "type": "string" + } + }, + "expirationDate": { + "type": "string" + }, + "issuer": { + "type": "object", + "properties": { + "id": { + "type": "string" } - }, - "verificationMethod": { - "type": "array", - "description": "This input field assigns the provided verificationMethod array to the didDocument", - "items": { - "$ref": "#/components/schemas/VerificationMethod" + } + }, + "credentialSubject": { + "type": "object", + "properties": { + "id": { + "type": "string" } - }, - "authentication": { - "description": "This input field assigns the provided authentication array to the didDocument", - "type": "array", - "items": { + } + }, + "credentialStatus": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "statusListIndex": { + "type": "string" + }, + "statusPurpose": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + }, + "type": { + "type": "string", + "enum": [ + "StatusList2021Entry" + ] + } + } + }, + "issuanceDate": { + "type": "string" + }, + "proof": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "jwt": { "type": "string" } - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" } } }, - "CredentialVerifyRequest": { - "type": "object", - "properties": { - "credential": { - "description": "This input field takes the credential object or the JWT string", - "allOf": [ - { - "type": "object" - }, - { - "type": "string" - } - ] - } + "example": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://schema.org", + "https://veramo.io/contexts/profile/v1" + ], + "credentialSubject": { + "gender": "male", + "id": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", + "name": "Bob" + }, + "credentialStatus": { + "id": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-suspension-1&resourceType=StatusList2021Suspension#20", + "statusListIndex": "20", + "statusPurpose": "suspension", + "type": "StatusList2021Entry" + }, + "issuanceDate": "2023-06-08T13:49:28.000Z", + "issuer": { + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "proof": { + "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6Y2hlcWQ6dGVzdG5ldDo3YmY4MWEyMC02MzNjLTRjYzctYmM0YS01YTQ1ODAxMDA1ZTAiLCJuYmYiOjE2ODYyMzIxNjgsInN1YiI6ImRpZDprZXk6ejZNa2hhWGdCWkR2b3REa0w1MjU3ZmFpenRpR2lDMlF0S0xHcGJubkVHdGEyZG9LIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5vcmciLCJodHRwczovL3ZlcmFtby5pby9jb250ZXh0cy9wcm9maWxlL3YxIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImdlbmRlciI6Im1hbGUiLCJuYW1lIjoiQm9iIn0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQZXJzb24iXX19.wMfdR6RtyAZA4eoWya5Aw97wwER2Cm5Guk780Xw8H9fA3sfudIJeLRLboqixpTchqSbYeA7KbuCTAnLgXTD_Cg", + "type": "JwtProof2020" + }, + "type": [ + "VerifiableCredential", + "Person" + ] + } + }, + "Customer": { + "type": "object", + "properties": { + "customerId": { + "type": "string" + }, + "address": { + "type": "string" + } + } + }, + "InvalidRequest": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "UnauthorizedError": { + "description": "Access token is missing or invalid", + "type": "object", + "properties": { + "error": { + "type": "string" } }, - "CredentialRevokeRequest": { - "type": "object", - "properties": { - "credential": { - "description": "This input field takes the credential object or the JWT string", - "oneOf": [ - { - "type": "object" - }, - { - "type": "string" - } - ] - } + "example": { + "error": "Unauthorized Error" + } + }, + "IVerifyResult": { + "type": "object", + "properties": { + "verified": { + "type": "boolean" + }, + "issuer": { + "type": "string" + }, + "signer": { + "type": "object" + }, + "jwt": { + "type": "string" + }, + "verifiableCredential": { + "type": "object" } }, - "CredentialStatusCreateRequest": { - "allOf": [ - { + "example": { + "verified": true, + "policies": {}, + "issuer": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "signer": { + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", + "type": "Ed25519VerificationKey2018" + } + } + }, + "CreateResourceRequest": { + "description": "Input fields for the resource creation", + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "type", + "data", + "encoding" + ], + "properties": { + "data": { + "description": "Provide encoded string for the resource data", + "type": "string" + }, + "encoding": { + "description": "The encoding format of the resource data", + "type": "string", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "name": { + "description": "Resource name", + "type": "string" + }, + "type": { + "description": "Resource type", + "type": "string" + }, + "alsoKnownAs": { + "type": "array", + "items": { "type": "object", - "required": [ - "did", - "statusListName" - ], "properties": { - "did": { - "description": "The DID of the statuslist publisher", + "uri": { "type": "string" }, - "statusListName": { - "description": "The name of the statusList to be created", + "description": { "type": "string" - }, - "length": { - "description": "The length of the statusList to be created, The default and minimum length is 140000 which is 16kb", - "type": "number" - }, - "encoding": { - "description": "The encoding format of the statusList to be published", - "type": "string", - "default": "base64url", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", - "type": "string" - }, - "alsoKnownAs": { - "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } } } } - ], - "example": { - "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "statusListName": "cheqd-employee-credentials" + }, + "version": { + "type": "string" } }, - "CredentialStatusUpdateRequest": { - "type": "object", - "required": [ - "did", - "statusListName", - "indices" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be created", + "example": { + "data": "SGVsbG8gV29ybGQ=", + "name": "ResourceName", + "type": "TextDocument" + } + }, + "RevocationResult": { + "properties": { + "revoked": { + "type": "boolean" + } + } + }, + "SuspensionResult": { + "properties": { + "suspended": { + "type": "boolean" + }, + "statusList": { + "type": "string" + } + } + }, + "UnSuspensionResult": { + "properties": { + "unsuspended": { + "type": "boolean" + }, + "statusList": { + "type": "string" + } + } + }, + "DIDCreateRequest": { + "type": "object", + "properties": { + "network": { + "type": "string", + "enum": [ + "testnet", + "mainnet" + ] + }, + "methodSpecificIdAlgo": { + "type": "string", + "enum": [ + "uuid", + "base58btc" + ] + }, + "verificationMethodType": { + "type": "string", + "enum": [ + "Ed25519VerificationKey2018", + "JsonWebKey2020", + "Ed25519VerificationKey2020" + ] + }, + "serviceEndpoint": { + "type": "string" + }, + "assertionMethod": { + "description": "An assertion method is required to issue JSONLD credentials", + "type": "boolean", + "default": true + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + } + } + }, + "DIDUpdateRequest": { + "type": "object", + "properties": { + "did": { + "type": "string" + }, + "service": { + "type": "array", + "description": "This input field assigns the provided service array to the didDocument", + "items": { + "$ref": "#/components/schemas/Service" + } + }, + "verificationMethod": { + "type": "array", + "description": "This input field assigns the provided verificationMethod array to the didDocument", + "items": { + "$ref": "#/components/schemas/VerificationMethod" + } + }, + "authentication": { + "description": "This input field assigns the provided authentication array to the didDocument", + "type": "array", + "items": { "type": "string" - }, - "indices": { - "description": "Provide the list of indices to be updated", - "type": "array", - "items": { + } + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + } + } + }, + "CredentialVerifyRequest": { + "type": "object", + "properties": { + "credential": { + "description": "This input field takes the credential object or the JWT string", + "allOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + }, + "policies": { + "description": "Custom verification policies to execute when verifying credential", + "type": "object", + "properties": { + "now": { + "description": "policy to verify over the now (current time) during the verification check (UNIX time in seconds)", "type": "number" + }, + "issuanceDate": { + "description": "policy to skip the issuanceDate (nbf) timestamp check when set to `false`", + "type": "boolean" + }, + "expirationDate": { + "description": "policy to skip the expirationDate (exp) timestamp check when set to `false`", + "type": "boolean" + }, + "audience": { + "description": "policy to skip the audience check when set to `false`", + "type": "boolean" } - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present uses the provided statusListVersion for the update operation", - "type": "string" } } - }, - "CredentialStatusPublishRequest": { - "allOf": [ - { - "type": "object", - "required": [ - "did", - "encodedList", - "statusListName", - "encoding" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be published", - "type": "string" - }, - "encodedList": { - "description": "Provide encoded string for the resource data", - "type": "string" - }, - "encoding": { - "description": "The encoding format of the statusList provided", - "type": "string", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", - "type": "string" - }, - "alsoKnownAs": { - "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } + } + }, + "CredentialRevokeRequest": { + "type": "object", + "properties": { + "credential": { + "description": "This input field takes the credential object or the JWT string", + "oneOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + } + } + }, + "CredentialStatusCreateRequest": { + "allOf": [ + { + "type": "object", + "required": [ + "did", + "statusListName" + ], + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be created", + "type": "string" + }, + "length": { + "description": "The length of the statusList to be created, The default and minimum length is 140000 which is 16kb", + "type": "number" + }, + "encoding": { + "description": "The encoding format of the statusList to be published", + "type": "string", + "default": "base64url", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", + "type": "string" + }, + "alsoKnownAs": { + "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "description": { + "type": "string" } } } } } - ], - "example": { - "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "name": "cheqd-employee-credentials", - "version": "2023", - "data": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", - "encoding": "base64url" } - }, - "PresentationRequest": { - "type": "object", - "required": [ - "presentation" - ], - "properties": { - "presentation": { - "description": "This input field takes the presentation object or the JWT string", - "allOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] + ], + "example": { + "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "statusListName": "cheqd-employee-credentials" + } + }, + "CredentialStatusUpdateRequest": { + "type": "object", + "required": [ + "did", + "statusListName", + "indices" + ], + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be created", + "type": "string" + }, + "indices": { + "description": "Provide the list of indices to be updated", + "type": "array", + "items": { + "type": "number" } + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present uses the provided statusListVersion for the update operation", + "type": "string" } - }, - "CredentialStatusResult": { - "type": "object", - "properties": { - "success": { - "type": "object", - "properties": { - "created": { - "type": "boolean" - }, - "resourceNetadata": { - "type": "object" - }, - "statusList2021": { + } + }, + "CredentialStatusPublishRequest": { + "allOf": [ + { + "type": "object", + "required": [ + "did", + "encodedList", + "statusListName", + "encoding" + ], + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be published", + "type": "string" + }, + "encodedList": { + "description": "Provide encoded string for the resource data", + "type": "string" + }, + "encoding": { + "description": "The encoding format of the statusList provided", + "type": "string", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", + "type": "string" + }, + "alsoKnownAs": { + "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", + "type": "array", + "items": { "type": "object", "properties": { - "StatusList2021": { - "type": "object", - "properties": { - "encodedList": { - "type": "string" - }, - "type": { - "type": "string" - }, - "validFrom": { - "type": "string" - } - } - } - } - }, - "metadata": { - "type": "string", - "properties": { - "encoding": { + "uri": { "type": "string" }, - "encrypted": { - "type": "boolean" + "description": { + "type": "string" } } } } } + } + ], + "example": { + "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "name": "cheqd-employee-credentials", + "version": "2023", + "data": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", + "encoding": "base64url" + } + }, + "PresentationRequest": { + "type": "object", + "required": [ + "presentation" + ], + "properties": { + "presentation": { + "description": "This input field takes the presentation object or the JWT string", + "allOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] }, - "example": { - "created": true, - "resource": { - "StatusList2021": { - "encodedList": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", - "type": "StatusList2021Revocation", - "validFrom": "2023-06-26T11:45:19.349Z" + "verifierDid": { + "description": "Provide an optional verifier DID (also known as 'domain' parameter), if the verifier DID in the presentation is not managed in the wallet", + "type": "string" + }, + "policies": { + "description": "Custom verification policies to execute when verifying presentation", + "type": "object", + "properties": { + "now": { + "description": "policy to verify over the now (current time) during the verification check (UNIX time in seconds)", + "type": "number" + }, + "issuanceDate": { + "description": "policy to skip the issuanceDate (nbf) timestamp check when set to `false`", + "type": "boolean" + }, + "expirationDate": { + "description": "policy to skip the expirationDate (exp) timestamp check when set to `false`", + "type": "boolean" + }, + "audience": { + "description": "policy to skip the audience check when set to `false`", + "type": "boolean" + } + } + } + } + }, + "CredentialStatusResult": { + "type": "object", + "properties": { + "success": { + "type": "object", + "properties": { + "created": { + "type": "boolean" + }, + "resourceNetadata": { + "type": "object" + }, + "statusList2021": { + "type": "object", + "properties": { + "StatusList2021": { + "type": "object", + "properties": { + "encodedList": { + "type": "string" + }, + "type": { + "type": "string" + }, + "validFrom": { + "type": "string" + } + } + } + } }, "metadata": { - "encoding": "base64url", - "encrypted": false + "type": "string", + "properties": { + "encoding": { + "type": "string" + }, + "encrypted": { + "type": "boolean" + } + } } - }, - "resourceMetadata": { - "checksum": "909e22e371a41afbb96c330a97752cf7c8856088f1f937f87decbef06cbe9ca2", - "created": "2023-06-26T11:45:20Z", - "mediaType": "application/json", - "nextVersionId": null, - "previousVersionId": null, - "resourceCollectionId": "7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "resourceId": "5945233a-a4b5-422b-b893-eaed5cedd2dc", - "resourceName": "cheqd-revocation-1", - "resourceType": "StatusList2021Revocation", - "resourceURI": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e/resources/5945233a-a4b5-422b-b893-eaed5cedd2dc", - "resourceVersion": "2023-06-26T11:45:19.349Z" } } }, - "CredentialStatusCheckRequest": { - "type": "object", - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be published", - "type": "string" - }, - "index": { - "description": "Provide the statusList index to be verified", - "type": "number" + "example": { + "created": true, + "resource": { + "StatusList2021": { + "encodedList": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", + "type": "StatusList2021Revocation", + "validFrom": "2023-06-26T11:45:19.349Z" + }, + "metadata": { + "encoding": "base64url", + "encrypted": false } + }, + "resourceMetadata": { + "checksum": "909e22e371a41afbb96c330a97752cf7c8856088f1f937f87decbef06cbe9ca2", + "created": "2023-06-26T11:45:20Z", + "mediaType": "application/json", + "nextVersionId": null, + "previousVersionId": null, + "resourceCollectionId": "7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "resourceId": "5945233a-a4b5-422b-b893-eaed5cedd2dc", + "resourceName": "cheqd-revocation-1", + "resourceType": "StatusList2021Revocation", + "resourceURI": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e/resources/5945233a-a4b5-422b-b893-eaed5cedd2dc", + "resourceVersion": "2023-06-26T11:45:19.349Z" + } + } + }, + "CredentialStatusCheckRequest": { + "type": "object", + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be published", + "type": "string" + }, + "index": { + "description": "Provide the statusList index to be verified", + "type": "number" } } } } - } \ No newline at end of file + } +} \ No newline at end of file diff --git a/src/types/types.ts b/src/types/types.ts index c5b738ed..f6f563ef 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -6,15 +6,15 @@ import { ICredentialIssuer, ICredentialVerifier, W3CVerifiableCredential, - TAgent + TAgent, + VerificationPolicies } from '@veramo/core' -import { ICheqd, ICheqdCheckCredentialWithStatusList2021StatusOptions, ICheqdStatusList2021Options } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' +import { ICheqd, ICheqdCheckCredentialWithStatusList2021StatusOptions } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' import { ICredentialIssuerLD } from '@veramo/credential-ld' import { AbstractIdentifierProvider } from '@veramo/did-manager' import { AbstractKeyManagementSystem } from '@veramo/key-manager' import { DataSource } from 'typeorm' import { CheqdDIDProvider } from '@cheqd/did-provider-cheqd' -import { CosmosAccessControlCondition } from '@cheqd/did-provider-cheqd/build/types/dkg-threshold/lit-protocol' export type ErrorResponse = { name: string @@ -138,14 +138,6 @@ export type StatusOptions = { export type RevocationStatusOptions = StatusOptions & { statusPurpose: 'revocation' } export type SuspensionStatusOptions = StatusOptions & { statusPurpose: 'suspension' } -export type VerifyCredentialStatusOptions = { - fetchList?: boolean - encryptedSymmetricKey?: string - options?: ICheqdStatusList2021Options -} - -export type VerifyPresentationStatusOptions = Omit - export interface ResourceMetadata { collectionId: string resourceId: string @@ -168,4 +160,11 @@ export interface UpdateStatusListOptions { statusAction: 'revoke' | 'suspend' | 'reinstate' } -export type CheckStatusListOptions = Omit \ No newline at end of file +export type CheckStatusListOptions = Omit + +export interface VerificationOptions { + fetchRemoteContexts?: boolean + policies?: VerificationPolicies + domain?: string + verifyStatus?: boolean +}