├── .eslintrc.json ├── .github └── workflows │ ├── ci-include-breaking.yml │ └── ci-only-passing.yml ├── .gitignore ├── .jshintrc ├── .pr-preview.json ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE.md ├── PR └── 2021-08-03 │ └── index.html ├── README.md ├── docker-compose.yml ├── docs └── README.md ├── lerna.json ├── package-lock.json ├── package.json ├── packages ├── did-core-test-server │ ├── README.md │ ├── __fixtures__ │ │ ├── suitesInput.json │ │ └── suitesOutput.json │ ├── app.js │ ├── index.js │ ├── package-lock.json │ ├── package.json │ ├── report │ │ ├── .gitignore │ │ ├── generate-report.js │ │ ├── generate-test-data.js │ │ ├── report-generator │ │ │ ├── generateDetailedReportByMethods.js │ │ │ ├── generateDetailedReportBySuites.js │ │ │ ├── generateImplementationSummary.js │ │ │ ├── generateSpecStatementSummary.js │ │ │ ├── recursiveRenderSection.js │ │ │ ├── tallyResults.js │ │ │ ├── updateReportMetaInformation.js │ │ │ └── updateSection.js │ │ └── report-template.html │ ├── routes │ │ └── index.js │ ├── run.js │ ├── services │ │ ├── getReportResults.js │ │ ├── runSuite.js │ │ ├── sanitizeAllResults.js │ │ └── swagger.js │ └── suites │ │ ├── did-consumption │ │ ├── default.js │ │ ├── did-consumer.js │ │ ├── did-consumption.spec.js │ │ ├── did-json-consumption.js │ │ └── did-jsonld-consumption.js │ │ ├── did-core-properties │ │ ├── default.js │ │ ├── did-core-properties.js │ │ ├── did-core-properties.spec.js │ │ └── did-metadata-structure.js │ │ ├── did-identifier │ │ ├── default.js │ │ ├── did-identifier.spec.js │ │ ├── did-parameters.js │ │ └── did-syntax.js │ │ ├── did-production │ │ ├── default.js │ │ ├── did-json-production.js │ │ ├── did-jsonld-production.js │ │ ├── did-producer.js │ │ └── did-production.spec.js │ │ ├── did-resolution │ │ ├── default.js │ │ ├── did-resolution.js │ │ └── did-resolution.spec.js │ │ ├── did-url-dereferencing │ │ ├── default.js │ │ ├── did-url-dereferencing.js │ │ └── did-url-dereferencing.spec.js │ │ ├── implementations │ │ ├── dereferencer-3-3box-labs.json │ │ ├── dereferencer-algo.json │ │ ├── dereferencer-art.json │ │ ├── dereferencer-cheqd.json │ │ ├── dereferencer-ethr-2021-consensys-mesh.json │ │ ├── dereferencer-example-didwg.json │ │ ├── dereferencer-knox.json │ │ ├── dereferencer-mattr.json │ │ ├── dereferencer-nft-3box-labs.json │ │ ├── dereferencer-polygon-ayanworks.json │ │ ├── dereferencer-spruce-key.json │ │ ├── dereferencer-spruce-onion.json │ │ ├── dereferencer-spruce-pkh.json │ │ ├── dereferencer-spruce-tz.json │ │ ├── dereferencer-spruce-web.json │ │ ├── dereferencer-spruce-webkey.json │ │ ├── dereferencer-ssb.json │ │ ├── dereferencer-web-transmute.json │ │ ├── did-3-2021-3box-labs.json │ │ ├── did-algo.json │ │ ├── did-art.json │ │ ├── did-cheqd.json │ │ ├── did-ebsi.json │ │ ├── did-elem-transmute.json │ │ ├── did-ethr-2021-consensys-mesh.json │ │ ├── did-example-didwg.json │ │ ├── did-ion.json │ │ ├── did-is.json │ │ ├── did-jnctn.json │ │ ├── did-key-2018-db.json │ │ ├── did-key-2020-db.json │ │ ├── did-key-mattr.json │ │ ├── did-key-spruce.json │ │ ├── did-key-transmute.json │ │ ├── did-kilt-2021.json │ │ ├── did-knox.json │ │ ├── did-lit.json │ │ ├── did-monid.json │ │ ├── did-nft-2021-3box-labs.json │ │ ├── did-onion-spruce.json │ │ ├── did-orb.json │ │ ├── did-photon-transmute.json │ │ ├── did-pkh-spruce.json │ │ ├── did-polygon-ayanworks.json │ │ ├── did-schema.json │ │ ├── did-sov-mattr.json │ │ ├── did-ssb.json │ │ ├── did-trust.json │ │ ├── did-tz-spruce.json │ │ ├── did-unisot.json │ │ ├── did-v1-vof.json │ │ ├── did-vaa.json │ │ ├── did-web-evernym.json │ │ ├── did-web-mattr.json │ │ ├── did-web-spruce.json │ │ ├── did-web-transmute.json │ │ ├── did-webkey-spruce.json │ │ ├── resolver-3-3box-labs.json │ │ ├── resolver-did-cheqd.json │ │ ├── resolver-did-ion.json │ │ ├── resolver-did-orb.json │ │ ├── resolver-ethr-consensys-mesh.json │ │ ├── resolver-example-didwg.json │ │ ├── resolver-kilt-2021.json │ │ ├── resolver-knox.json │ │ ├── resolver-mattr-key.json │ │ ├── resolver-mattr-sov.json │ │ ├── resolver-mattr-web.json │ │ ├── resolver-nft-3box-labs.json │ │ ├── resolver-polygon-ayanworks.json │ │ ├── resolver-spruce-key.json │ │ ├── resolver-spruce-onion.json │ │ ├── resolver-spruce-pkh.json │ │ ├── resolver-spruce-tz.json │ │ ├── resolver-spruce-web.json │ │ ├── resolver-spruce-webkey.json │ │ ├── resolver-ssb.json │ │ ├── universal-resolver-dereferencer-tests.json │ │ ├── universal-resolver-did-ace.json │ │ ├── universal-resolver-did-algo.json │ │ ├── universal-resolver-did-art.json │ │ ├── universal-resolver-did-bba.json │ │ ├── universal-resolver-did-bid.json │ │ ├── universal-resolver-did-btcr.json │ │ ├── universal-resolver-did-ccp.json │ │ ├── universal-resolver-did-ebsi.json │ │ ├── universal-resolver-did-elem.json │ │ ├── universal-resolver-did-emtrust.json │ │ ├── universal-resolver-did-ethr.json │ │ ├── universal-resolver-did-evan.json │ │ ├── universal-resolver-did-gatc.json │ │ ├── universal-resolver-did-github.json │ │ ├── universal-resolver-did-hcr.json │ │ ├── universal-resolver-did-icon.json │ │ ├── universal-resolver-did-io.json │ │ ├── universal-resolver-did-ion.json │ │ ├── universal-resolver-did-jolo.json │ │ ├── universal-resolver-did-key.json │ │ ├── universal-resolver-did-kilt.json │ │ ├── universal-resolver-did-knox.json │ │ ├── universal-resolver-did-lit.json │ │ ├── universal-resolver-did-mpg.json │ │ ├── universal-resolver-did-nacl.json │ │ ├── universal-resolver-did-ont.json │ │ ├── universal-resolver-did-schema.json │ │ ├── universal-resolver-did-sol.json │ │ ├── universal-resolver-did-sov.json │ │ ├── universal-resolver-did-stack.json │ │ ├── universal-resolver-did-trust.json │ │ ├── universal-resolver-did-unisot.json │ │ ├── universal-resolver-did-v1.json │ │ ├── universal-resolver-did-vaa.json │ │ ├── universal-resolver-did-web.json │ │ ├── universal-resolver-did-work.json │ │ ├── universal-resolver-identifier-tests.json │ │ └── universal-resolver-resolver-tests.json │ │ ├── resolution-utils.js │ │ ├── suite-config.js │ │ └── utils.js └── jest-did-matcher │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ └── src │ ├── index.js │ └── matchers │ ├── index.js │ ├── toBeAsciiString │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeBase58String │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeDidCoreDatetime │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeDidDocumentMap │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeDidDocumentPropertyValueType │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeInfraMap │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeInfraString │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeMediaType │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeMultibaseString │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeValidDid │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeValidDidUrl │ ├── index.js │ ├── index.test.js │ └── predicate.js │ ├── toBeValidUri │ ├── index.js │ ├── index.test.js │ └── predicate.js │ └── toBeValidUrl │ ├── index.js │ ├── index.test.js │ └── predicate.js └── w3c.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "es2017": true, 6 | "node": true, 7 | "jest": true 8 | }, 9 | "extends": [ 10 | "eslint:recommended" 11 | ], 12 | "parserOptions": {}, 13 | "plugins": [], 14 | "rules": {} 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/ci-include-breaking.yml: -------------------------------------------------------------------------------- 1 | name: Include Breaking 2 | on: [push] 3 | jobs: 4 | ci: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Begin CI... 8 | uses: actions/checkout@v2 9 | - name: Use Node 14 10 | uses: actions/setup-node@v1 11 | with: 12 | node-version: 14.x 13 | - name: Install 14 | run: npm install 15 | - name: Lint 16 | run: npm run lint 17 | - name: Build Report 18 | run: DID_WG_INCLUDE_BREAKING=1 npm run test-and-generate-report 19 | - name: Deploy Report 20 | uses: peaceiris/actions-gh-pages@v3 21 | with: 22 | github_token: ${{ secrets.GITHUB_TOKEN }} 23 | publish_dir: ./docs 24 | -------------------------------------------------------------------------------- /.github/workflows/ci-only-passing.yml: -------------------------------------------------------------------------------- 1 | name: Only Passing 2 | on: [push] 3 | jobs: 4 | ci: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Begin CI... 8 | uses: actions/checkout@v2 9 | - name: Use Node 14 10 | uses: actions/setup-node@v1 11 | with: 12 | node-version: 14.x 13 | - name: Install 14 | run: npm install 15 | - name: Lint 16 | run: npm run lint 17 | - name: Test 18 | run: npm run test 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[nop] 2 | *.py[co] 3 | *~ 4 | .DS_Store 5 | .project 6 | .settings 7 | TAGS 8 | config.json 9 | node_modules 10 | 11 | .idea 12 | *.iml 13 | .vscode 14 | 15 | docs/index.html -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esversion": 8 3 | } 4 | -------------------------------------------------------------------------------- /.pr-preview.json: -------------------------------------------------------------------------------- 1 | { 2 | "src_file": "index.html", 3 | "type": "respec" 4 | } 5 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners will be the default owners for everything in 2 | # the repo. Unless a later match takes precedence, 3 | # they will be requested for review when someone opens a 4 | # pull request. 5 | * @OR13 @msporny 6 | 7 | # See CODEOWNERS syntax here: https://help.github.com/articles/about-codeowners/#codeowners-syntax -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | All documentation, code and communication under this repository are covered by the [W3C Code of Ethics and Professional Conduct](https://www.w3.org/Consortium/cepc/). 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Decentralized Identifier Working Group 2 | 3 | Contributions to this repository are intended to become part of 4 | Recommendation-track documents governed by the 5 | [W3C Patent Policy](https://www.w3.org/Consortium/Patent-Policy-20040205/) 6 | and 7 | [Document License](https://www.w3.org/Consortium/Legal/copyright-documents). 8 | To make substantive contributions to specifications, you must either 9 | participate in the relevant W3C Working Group or make a non-member patent 10 | licensing commitment. 11 | 12 | If you are not the sole contributor to a contribution (pull request), 13 | please identify all contributors in the pull request comment. 14 | 15 | To add a contributor (other than yourself, that's automatic), mark them one 16 | per line as follows: 17 | 18 | ``` 19 | +@github_username 20 | ``` 21 | 22 | If you added a contributor by mistake, you can remove them in a comment 23 | with: 24 | 25 | ``` 26 | -@github_username 27 | ``` 28 | 29 | If you are making a pull request on behalf of someone else but you had no 30 | part in designing the feature, you can remove yourself with the above 31 | syntax. 32 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM node:14 3 | 4 | WORKDIR /usr/src/app 5 | 6 | COPY ./packages/did-core-test-server/run.js ./packages/did-core-test-server/run.js 7 | COPY ./packages/did-core-test-server/app.js ./packages/did-core-test-server/app.js 8 | COPY ./packages/did-core-test-server/__fixtures__ ./packages/did-core-test-server/__fixtures__ 9 | COPY ./packages/did-core-test-server/services ./packages/did-core-test-server/services 10 | COPY ./packages/did-core-test-server/routes ./packages/did-core-test-server/routes 11 | COPY ./packages/did-core-test-server/suites ./packages/did-core-test-server/suites 12 | COPY ./packages/did-core-test-server/package.json ./packages/did-core-test-server/package.json 13 | 14 | COPY ./packages/jest-did-matcher/src ./packages/jest-did-matcher/src 15 | COPY ./packages/jest-did-matcher/package.json ./packages/jest-did-matcher/package.json 16 | 17 | COPY ./package.json ./package.json 18 | COPY ./lerna.json ./lerna.json 19 | 20 | RUN npm install -g lerna 21 | RUN lerna bootstrap 22 | RUN lerna run build 23 | 24 | EXPOSE 8080 25 | 26 | CMD [ "node", "./packages/did-core-test-server/run.js" ] 27 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | All documents in this Repository are licensed by contributors 2 | under the 3 | [W3C Document License](https://www.w3.org/Consortium/Legal/copyright-documents). 4 | 5 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | did-core-test-server: 4 | build: . 5 | ports: 6 | - 8080:8080 7 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | This directory is used to serve GitHub Pages. -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "0.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "version": "0.0.1", 4 | "license": "Apache-2.0", 5 | "private": true, 6 | "description": "Decentralized Identifiers Test Suite", 7 | "homepage": "https://github.com/w3c/did-test-suite#readme", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/w3c/did-test-suite" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/w3c/did-test-suite/issues" 14 | }, 15 | "keywords": [ 16 | "test", 17 | "suite", 18 | "w3c" 19 | ], 20 | "scripts": { 21 | "install:ci": "npm install --ignore-scripts && lerna link && lerna bootstrap --since origin/main --include-dependencies", 22 | "postinstall": "lerna bootstrap", 23 | "prepare": "lerna run prepare", 24 | "start": "npm run docker:up", 25 | "lint": "lerna run lint --stream", 26 | "test": "lerna run test --stream", 27 | "docker:up": "docker-compose up", 28 | "docker:build": "docker-compose up --build", 29 | "generate-test-data": "lerna run generate-test-data --stream", 30 | "generate-report": "lerna run generate-report", 31 | "test-and-generate-report": "lerna run test-and-generate-report" 32 | }, 33 | "devDependencies": { 34 | "lerna": "^3.22.1" 35 | }, 36 | "prettier": { 37 | "printWidth": 80, 38 | "semi": true, 39 | "singleQuote": true, 40 | "trailingComma": "es5" 41 | }, 42 | "engines": { 43 | "node": ">=14" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/did-core-test-server/__fixtures__/suitesInput.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "test-suite-a", 4 | "a": 1, 5 | "b": 2 6 | }, 7 | { 8 | "name": "test-suite-b", 9 | "x": 3, 10 | "y": 4 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /packages/did-core-test-server/__fixtures__/suitesOutput.json: -------------------------------------------------------------------------------- 1 | { 2 | "suitesReportTerminal": "G1s5OTlEG1tLG1swbRtbN20bWzFtG1szMm0gUEFTUyAbWzM5bRtbMjJtG1syN20bWzBtIBtbMm1zdWl0ZXMvdGVzdC1zdWl0ZS1hLxtbMjJtG1sxbXRlc3Qtc3VpdGUtYS5zcGVjLmpzG1syMm0KICB0ZXN0LXN1aXRlLWEKICAgIBtbMzJt4pyTG1szOW0gG1sybXN1aXRlIGNvbmZpZyBzaG91bGQgaGF2ZSBjb3JyZWN0IG5hbWUgKDEgbXMpG1syMm0KICAgIBtbMzJt4pyTG1szOW0gG1sybWEgc2hvdWxkIGJlIDEbWzIybQogICAgG1szMm3inJMbWzM5bSAbWzJtYiBzaG91bGQgYmUgMiAoMSBtcykbWzIybQoKG1s5OTlEG1tLG1sxbVRlc3QgU3VpdGVzOiAbWzIybRtbMW0bWzMybTEgcGFzc2VkG1szOW0bWzIybSwgMSB0b3RhbAobWzFtVGVzdHM6ICAgICAgIBtbMjJtG1sxbRtbMzJtMyBwYXNzZWQbWzM5bRtbMjJtLCAzIHRvdGFsChtbMW1TbmFwc2hvdHM6ICAgG1syMm0wIHRvdGFsChtbMW1UaW1lOhtbMjJtICAgICAgICAwLjgzNCBzLCBlc3RpbWF0ZWQgMSBzChtbMm1SYW4gYWxsIHRlc3Qgc3VpdGVzG1syMm0bWzJtLhtbMjJtChtbOTk5RBtbSxtbMG0bWzdtG1sxbRtbMzJtIFBBU1MgG1szOW0bWzIybRtbMjdtG1swbSAbWzJtc3VpdGVzL3Rlc3Qtc3VpdGUtYi8bWzIybRtbMW10ZXN0LXN1aXRlLWIuc3BlYy5qcxtbMjJtCiAgdGVzdC1zdWl0ZS1iCiAgICAbWzMybeKckxtbMzltIBtbMm1zdWl0ZSBjb25maWcgc2hvdWxkIGhhdmUgY29ycmVjdCBuYW1lG1syMm0KICAgIBtbMzJt4pyTG1szOW0gG1sybXggc2hvdWxkIGJlIDMbWzIybQogICAgG1szMm3inJMbWzM5bSAbWzJteSBzaG91bGQgYmUgNCAoMSBtcykbWzIybQoKG1s5OTlEG1tLG1sxbVRlc3QgU3VpdGVzOiAbWzIybRtbMW0bWzMybTEgcGFzc2VkG1szOW0bWzIybSwgMSB0b3RhbAobWzFtVGVzdHM6ICAgICAgIBtbMjJtG1sxbRtbMzJtMyBwYXNzZWQbWzM5bRtbMjJtLCAzIHRvdGFsChtbMW1TbmFwc2hvdHM6ICAgG1syMm0wIHRvdGFsChtbMW1UaW1lOhtbMjJtICAgICAgICAwLjE1OSBzLCBlc3RpbWF0ZWQgMSBzChtbMm1SYW4gYWxsIHRlc3Qgc3VpdGVzG1syMm0bWzJtLhtbMjJtCg==", 3 | "suitesReportJson": [ 4 | { 5 | "suite": "test-suite-a", 6 | "testResults": [ 7 | { 8 | "ancestors": [ 9 | "test-suite-a" 10 | ], 11 | "title": "suite config should have correct name", 12 | "status": "passed" 13 | }, 14 | { 15 | "ancestors": [ 16 | "test-suite-a" 17 | ], 18 | "title": "a should be 1", 19 | "status": "passed" 20 | }, 21 | { 22 | "ancestors": [ 23 | "test-suite-a" 24 | ], 25 | "title": "b should be 2", 26 | "status": "passed" 27 | } 28 | ] 29 | }, 30 | { 31 | "suite": "test-suite-b", 32 | "testResults": [ 33 | { 34 | "ancestors": [ 35 | "test-suite-b" 36 | ], 37 | "title": "suite config should have correct name", 38 | "status": "passed" 39 | }, 40 | { 41 | "ancestors": [ 42 | "test-suite-b" 43 | ], 44 | "title": "x should be 3", 45 | "status": "passed" 46 | }, 47 | { 48 | "ancestors": [ 49 | "test-suite-b" 50 | ], 51 | "title": "y should be 4", 52 | "status": "passed" 53 | } 54 | ] 55 | } 56 | ] 57 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/app.js: -------------------------------------------------------------------------------- 1 | const fastify = require("fastify"); 2 | const { registerSwagger } = require("./services/swagger"); 3 | const { registerRoutes } = require("./routes"); 4 | 5 | const opts = { 6 | ignoreTrailingSlash: true, 7 | }; 8 | 9 | const app = fastify(opts); 10 | app.register(require("fastify-cors")); 11 | 12 | registerSwagger(app); 13 | registerRoutes(app); 14 | 15 | module.exports = { app }; 16 | -------------------------------------------------------------------------------- /packages/did-core-test-server/index.js: -------------------------------------------------------------------------------- 1 | const getReportResults = require("./services/getReportResults"); 2 | const suitesInput = require("./__fixtures__/suitesInput.json"); 3 | const suitesOutput = require("./__fixtures__/suitesOutput.json"); 4 | 5 | module.exports = { getReportResults, suitesInput, suitesOutput }; 6 | -------------------------------------------------------------------------------- /packages/did-core-test-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "did-core-test-server", 3 | "author": "Orie Steele", 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "start": "npm run serve", 9 | "test": "jest", 10 | "serve": "node run.js", 11 | "generate-test-data": "node report/generate-test-data.js", 12 | "generate-report": "node report/generate-report.js", 13 | "test-and-generate-report": "node report/generate-test-data.js; node report/generate-report.js; mv ./report/index.html ../../docs", 14 | "docker:build": "docker build --tag or13/did-core-test-server:1.0 .", 15 | "docker:run": "docker run --publish 8080:8080 or13/did-core-test-server:1.0", 16 | "docker:publish": "docker push or13/did-core-test-server:1.0" 17 | }, 18 | "dependencies": { 19 | "base64url": "^3.0.1", 20 | "cheerio": "*", 21 | "fastify": "^3.9.1", 22 | "fastify-cors": "^5.0.0", 23 | "fastify-swagger": "^3.5.0", 24 | "jest": "^26.6.3", 25 | "jest-did-matcher": "^0.0.1", 26 | "jest-extended": "^0.11.5", 27 | "jose": "^2.0.4", 28 | "moment": "^2.29.1", 29 | "node-fetch": "^2.6.1", 30 | "node-jose": "^2.0.0", 31 | "querystring": "^0.2.0", 32 | "uri-js": "^4.4.1" 33 | }, 34 | "jest": { 35 | "setupFilesAfterEnv": [ 36 | "jest-extended", 37 | "jest-did-matcher" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | index.html 3 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/generate-report.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const cheerio = require('cheerio'); 4 | 5 | const tallyResults = require("./report-generator/tallyResults"); 6 | const updateReportMetaInformation = require("./report-generator/updateReportMetaInformation"); 7 | const generateDetailedReportBySuites = require("./report-generator/generateDetailedReportBySuites"); 8 | const generateDetailedReportByMethods = require("./report-generator/generateDetailedReportByMethods"); 9 | const generateImplementationSummary = require("./report-generator/generateImplementationSummary"); 10 | const generateSpecStatementSummary = require("./report-generator/generateSpecStatementSummary"); 11 | 12 | const latestResults = require('./tmp/did-spec-test-run.latest.json'); 13 | const talliedResults = tallyResults(latestResults); 14 | const systemSuitesConfig = require('../suites/suite-config.js'); 15 | 16 | const reportTemplate = path.resolve(__dirname, './report-template.html'); 17 | const reportOutput = path.resolve(__dirname, './index.html'); 18 | 19 | (async () => { 20 | const spec = fs.readFileSync(reportTemplate).toString(); 21 | const $ = cheerio.load(spec); 22 | 23 | updateReportMetaInformation($, systemSuitesConfig); 24 | 25 | generateImplementationSummary($, talliedResults); 26 | generateSpecStatementSummary($, talliedResults); 27 | generateDetailedReportBySuites($, talliedResults); 28 | generateDetailedReportByMethods($, talliedResults); 29 | 30 | const updatedSpec = $.html(); 31 | fs.writeFileSync(reportOutput, updatedSpec); 32 | 33 | })(); 34 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/generate-test-data.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const getReportResults = require('../services/getReportResults'); 5 | const systemSuitesConfig = require('../suites/suite-config.js'); 6 | 7 | let temp_dir = path.resolve(__dirname, './tmp'); 8 | if (!fs.existsSync(temp_dir)) { 9 | fs.mkdirSync(temp_dir); 10 | } 11 | 12 | (async () => { 13 | const report = await getReportResults(systemSuitesConfig); 14 | 15 | fs.writeFileSync( 16 | `${temp_dir}/did-spec-test-run.latest.json`, 17 | JSON.stringify(report.suitesReportJson, null, 2) 18 | ); 19 | })(); 20 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/report-generator/generateDetailedReportByMethods.js: -------------------------------------------------------------------------------- 1 | const recursiveRenderSection = require("./recursiveRenderSection"); 2 | const updateSection = require("./updateSection"); 3 | 4 | module.exports = generateDetailedReportsummaryByMethod = ($, talliedResults) => { 5 | let section_id = 'report-by-methods'; 6 | let section_title = 'Report by Methods'; 7 | 8 | if (!talliedResults) { 9 | updateSection($, section_id, section_title, ''); 10 | return; 11 | } 12 | let byMethod = talliedResults.byMethod; 13 | let method2id = talliedResults.method2id; 14 | let title2id = talliedResults.title2id; 15 | let level = 3; 16 | let testResultReport = recursiveRenderSection( 17 | section_id, 18 | byMethod, 19 | null, 20 | (id, key, section_number) => method2id[key], 21 | (key, value) => `

Total Implementations for ${key} : ${Object.keys(value).length}

`, 22 | level, 23 | ["Suite", "Statement"], 24 | tr => { return `${tr.suite_name}${tr.title_clip}`; }, 25 | (a,b) => { // sort function 26 | let order1 = a.suite.localeCompare(b.suite); // order by suite 27 | return order1 == 0 && a.title.localeCompare(b.title); // then title 28 | } 29 | ); 30 | 31 | let preamble = ` 32 |

Note: Report generator shortens longer parameters and replaces them 33 | with an ellipsis (\u{2026}) for readability.

34 | `; 35 | 36 | updateSection($, section_id, section_title, preamble, testResultReport); 37 | }; -------------------------------------------------------------------------------- /packages/did-core-test-server/report/report-generator/generateDetailedReportBySuites.js: -------------------------------------------------------------------------------- 1 | const recursiveRenderSection = require("./recursiveRenderSection"); 2 | const updateSection = require("./updateSection"); 3 | 4 | module.exports = generateDetailedReportBySuites = ($, talliedResults) => { 5 | let section_id = 'report-by-test-suites'; 6 | let section_title = 'Report by Test Suites'; 7 | 8 | if (!talliedResults) { 9 | updateSection($, section_id, section_title, ''); 10 | return; 11 | } 12 | let bySuite = talliedResults.bySuite; 13 | let title2id = talliedResults.title2id; 14 | 15 | let level = 3; 16 | let testResultReport = recursiveRenderSection( 17 | section_id, 18 | bySuite, 19 | title2id, 20 | (id, key, section_number) => `${id}-${key}`, 21 | (key, value) => "", 22 | level, ["Method", "Implementation"], 23 | tr => `${tr.did_method}${tr.implementation}` 24 | ); 25 | 26 | let preamble = ` 27 |

Note: Report generator shortens longer parameters and replaces them 28 | with an ellipsis (\u{2026}) for readability.

29 | `; 30 | 31 | updateSection($, section_id, section_title, preamble, testResultReport); 32 | }; 33 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/report-generator/generateImplementationSummary.js: -------------------------------------------------------------------------------- 1 | const updateSection = require("./updateSection"); 2 | 3 | module.exports = generateImplementationSummary = ($, talliedResults) => { 4 | let section_id = "implementation-summary"; 5 | let section_title = "Summary by Method Implementation"; 6 | let method2id = talliedResults.method2id; 7 | 8 | if (!talliedResults) { 9 | updateSection($, section_id, section_title, ''); 10 | return; 11 | } 12 | let summaryByMethod = talliedResults.summaryByMethod; 13 | let suiteNames = talliedResults.suiteNames; 14 | 15 | let result_table = ` 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | ${ suiteNames.map(n => ``).join("") } 25 | 26 | 27 | `; 28 | Object.keys(summaryByMethod).sort().forEach( method => { 29 | Object.keys(summaryByMethod[method]).map( implementation => { 30 | result_table += `` + 31 | suiteNames.map( suite => { 32 | let r = summaryByMethod[method][implementation][suite]; 33 | return !r ? `` : ` 34 | 38 | `; 39 | }).join("\n") + `\n`; 40 | }); 41 | }); 42 | result_table += ` 43 |
MethodImplementationTest Suites
${n}
${method}${implementation}${r.failed ? ` (${r.failed})` : ''} 35 | ${r.passed ? ` (${r.passed})` : ''} 36 | ${r.todo ? ` (${r.todo})` : ''} 37 |
44 | `; 45 | 46 | let preamble = ``; 47 | 48 | updateSection($, section_id, section_title, preamble, result_table); 49 | }; 50 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/report-generator/generateSpecStatementSummary.js: -------------------------------------------------------------------------------- 1 | const updateSection = require("./updateSection"); 2 | 3 | const plural = (v, s) => { 4 | return `${v} ${s}${v == 1 ? '' : 's'}`; 5 | }; 6 | 7 | const count_or_null = (n) => { 8 | return n == 1 ? "" : `(${n})`; 9 | }; 10 | 11 | module.exports = generateSpecStatementSummary = ($, talliedResults) => { 12 | let section_id = "spec-statement-summary"; 13 | let section_title = "Summary by Specification Statements"; 14 | let method2id = talliedResults.method2id; 15 | let title2id = talliedResults.title2id; 16 | 17 | if (!talliedResults) { 18 | updateSection($, section_id, section_title, ''); 19 | return; 20 | } 21 | let summaryByTitle= talliedResults.summaryByTitle; 22 | 23 | let result_table = ` 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | `; 32 | Object.keys(summaryByTitle).sort().forEach( title => { 33 | let passed_methods = []; 34 | let failed_methods = []; 35 | let todo_methods = []; 36 | 37 | Object.keys(summaryByTitle[title]).sort().map( method => { 38 | if(method === 'did:example') { 39 | return; 40 | } 41 | 42 | let m = method.replace(/^did:(.*)$/, "$1"); 43 | let status = summaryByTitle[title][method]; 44 | if (status['passed']) { 45 | passed_methods.push(`${m}${count_or_null(status['passed'].length)}`); 46 | } 47 | if (status['failed']) { 48 | failed_methods.push(`${m}${count_or_null(status['failed'].length)}`); 49 | } 50 | if (status['todo']) { 51 | todo_methods.push(`${m}${count_or_null(status['todo'].length)}`); 52 | } 53 | }); 54 | 55 | let status_set = []; 56 | const method_status_line = (class_name, method_list) => { 57 | if (method_list.length != 0) { 58 | status_set.push( 59 | `[${plural(method_list.length, 'method')}]: ` + 60 | method_list.map((m) => { 61 | let mid = m.replace(/^(.*)\(\d+\)?$/, "$1"); 62 | return `${m}`; 63 | }).join(", ") + 64 | ``); 65 | } 66 | }; 67 | method_status_line('passed', passed_methods); 68 | method_status_line('failed', failed_methods); 69 | method_status_line('todo', todo_methods); 70 | 71 | result_table += `\n`; 72 | }); 73 | result_table += ` 74 |
Specification StatementMethods
${title}` + status_set.join("
\n") + `
75 | `; 76 | 77 | let preamble = ` 78 |

Numbers in parentheses denote the number of implementations. 79 | If the number of implementations is one, the report generator suppresses 80 | the number and parentheses "(1)" for readability.

81 | `; 82 | updateSection($, section_id, section_title, preamble, result_table); 83 | }; 84 | -------------------------------------------------------------------------------- /packages/did-core-test-server/report/report-generator/updateReportMetaInformation.js: -------------------------------------------------------------------------------- 1 | const moment = require('moment'); 2 | 3 | module.exports = updateReportMetaInformation = ($, systemSuitesConfig) => { 4 | $('#did-spec-suite-configuration').replaceWith( 5 | `
10 |   ${JSON.stringify(systemSuitesConfig, null, 2)}
11 |         
` 12 | ); 13 | 14 | $('#did-spec-report-date').replaceWith( 15 | `

16 | These test results were last generated 17 | 18 | ${moment().format('LLLL')} 19 | 20 |

` 21 | ); 22 | 23 | }; -------------------------------------------------------------------------------- /packages/did-core-test-server/report/report-generator/updateSection.js: -------------------------------------------------------------------------------- 1 | module.exports = updateSection = ($, target, title, preamble, report) => { 2 | $(`#${target}`).replaceWith(` 3 |
4 |

${title}

5 | ${preamble} 6 | ${report} 7 |
8 | 9 | `); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/did-core-test-server/routes/index.js: -------------------------------------------------------------------------------- 1 | const getReportResults = require("../services/getReportResults"); 2 | 3 | const suitesInput = require("../__fixtures__/suitesInput.json"); 4 | const suitesOutput = require("../__fixtures__/suitesOutput.json"); 5 | 6 | const registerRoutes = (server) => { 7 | server.get( 8 | "/", 9 | { 10 | schema: { 11 | hide: true, 12 | }, 13 | }, 14 | (req, reply) => { 15 | reply.redirect("/api/docs"); 16 | } 17 | ); 18 | server.post( 19 | "/test-suite-manager/generate-report", 20 | { 21 | schema: { 22 | tags: ["Test Suite Manager"], 23 | summary: "Generate Report", 24 | description: "Run tests on supplied suites", 25 | body: { 26 | type: "object", 27 | example: suitesInput, 28 | additionalProperties: true, 29 | }, 30 | response: { 31 | 200: { 32 | description: "Success", 33 | type: "object", 34 | example: suitesOutput, 35 | additionalProperties: true, 36 | }, 37 | }, 38 | }, 39 | }, 40 | async (req, reply) => { 41 | try { 42 | response = await getReportResults(req.body); 43 | reply.send(response); 44 | } catch (e) { 45 | reply.status(500).send({ error: e.message }); 46 | } 47 | } 48 | ); 49 | }; 50 | 51 | module.exports = { registerRoutes }; 52 | -------------------------------------------------------------------------------- /packages/did-core-test-server/run.js: -------------------------------------------------------------------------------- 1 | const { app } = require("./app"); 2 | 3 | const port = 8080; 4 | 5 | app.listen(port, "0.0.0.0", (err, address) => { 6 | if (err) { 7 | console.error(err); 8 | } 9 | console.log(`🚧 server listening on ${address}`); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/did-core-test-server/services/getReportResults.js: -------------------------------------------------------------------------------- 1 | const runSuite = require("./runSuite"); 2 | 3 | const sanitizeAllResults = require("./sanitizeAllResults"); 4 | 5 | async function capture(fn, p) { 6 | const originalWrite = p.write; 7 | let output = ""; 8 | try { 9 | p.write = (chunk) => { 10 | if (typeof chunk === "string") { 11 | output += chunk; 12 | } 13 | return true; 14 | }; 15 | await fn(); 16 | } catch (e) { 17 | throw e; 18 | } finally { 19 | p.write = originalWrite; 20 | } 21 | return output; 22 | } 23 | 24 | module.exports = getReportResults = async (suites) => { 25 | let allResults = []; 26 | const runAll = async () => { 27 | await Promise.all( 28 | suites.suites.map(async (s) => { 29 | const results = await runSuite(s.suite_name, s); 30 | allResults.push(results); 31 | }) 32 | ); 33 | }; 34 | const capturedReport = await capture(runAll, process.stderr); 35 | return { 36 | suitesReportTerminal: Buffer.from(capturedReport).toString("base64"), 37 | suitesReportJson: sanitizeAllResults(allResults), 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /packages/did-core-test-server/services/runSuite.js: -------------------------------------------------------------------------------- 1 | const jestRunner = require("jest"); 2 | const path = require("path"); 3 | 4 | module.exports = async (suiteName, config) => { 5 | let results = await jestRunner.runCLI( 6 | { 7 | // json: true, 8 | // ci: true, 9 | // silent: true, 10 | roots: [path.resolve(__dirname, `../suites/${suiteName}`)], 11 | globals: JSON.stringify({ systemSuiteConfig: config }), 12 | }, 13 | [process.cwd()] 14 | ); 15 | return results; 16 | }; 17 | -------------------------------------------------------------------------------- /packages/did-core-test-server/services/sanitizeAllResults.js: -------------------------------------------------------------------------------- 1 | module.exports = sanitizeAllResults = (allResults) => { 2 | let clean = []; 3 | 4 | allResults.forEach((element) => { 5 | clean.push({ 6 | suite: element.results.testResults[0].testResults[0].ancestorTitles[0], 7 | testResults: element.results.testResults[0].testResults.map((tr) => { 8 | return { 9 | ancestors: tr.ancestorTitles, 10 | title: tr.title, 11 | status: tr.status, 12 | }; 13 | }), 14 | }); 15 | }); 16 | 17 | return clean.sort((a, b) => 18 | JSON.stringify(a).localeCompare(JSON.stringify(b)) 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /packages/did-core-test-server/services/swagger.js: -------------------------------------------------------------------------------- 1 | const fastifySwagger = require('fastify-swagger'); 2 | 3 | const registerSwagger = (server) => { 4 | server.register(fastifySwagger, { 5 | swagger: { 6 | info: { 7 | title: 'DID Core Test Server', 8 | description: 'DID Core Test Conformance.', 9 | version: '0.0.0', 10 | license: { 11 | name: 'DID Core Specification', 12 | url: 'https://github.com/w3c/did-core', 13 | }, 14 | contact: { 15 | name: 'GitHub Source Code', 16 | url: 'https://github.com/w3c/did-test-suite', 17 | }, 18 | }, 19 | 20 | basePath: '', 21 | }, 22 | routePrefix: 'api/docs', 23 | exposeRoute: true, 24 | }); 25 | }; 26 | 27 | module.exports = { registerSwagger }; 28 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-consumption/default.js: -------------------------------------------------------------------------------- 1 | 2 | const brokenFixtures = process.env.DID_WG_INCLUDE_BREAKING ? [ 3 | require('../implementations/did-unisot.json'), 4 | ] : [] 5 | 6 | module.exports = { 7 | name: 'did-consumption', 8 | didMethods: [ 9 | require('../implementations/did-example-didwg.json'), 10 | require('../implementations/did-is.json'), 11 | require('../implementations/did-key-2018-db.json'), 12 | require('../implementations/did-key-2020-db.json'), 13 | require('../implementations/did-kilt-2021.json'), 14 | require('../implementations/did-3-2021-3box-labs.json'), 15 | require('../implementations/did-ethr-2021-consensys-mesh.json'), 16 | require('../implementations/did-trust.json'), 17 | require('../implementations/did-v1-vof.json'), 18 | require('../implementations/did-monid.json'), 19 | require('../implementations/did-vaa.json'), 20 | require('../implementations/did-ion.json'), 21 | require('../implementations/did-orb.json'), 22 | require('../implementations/did-lit.json'), 23 | require('../implementations/did-schema.json'), 24 | require('../implementations/did-nft-2021-3box-labs.json'), 25 | require('../implementations/did-key-transmute.json'), 26 | require('../implementations/did-web-transmute.json'), 27 | require('../implementations/did-photon-transmute.json'), 28 | require('../implementations/did-elem-transmute.json'), 29 | require('../implementations/did-key-mattr.json'), 30 | require('../implementations/did-web-mattr.json'), 31 | require('../implementations/did-sov-mattr.json'), 32 | require('../implementations/did-polygon-ayanworks.json'), 33 | require('../implementations/did-key-spruce.json'), 34 | require('../implementations/did-web-spruce.json'), 35 | require('../implementations/did-tz-spruce.json'), 36 | require('../implementations/did-onion-spruce.json'), 37 | require('../implementations/did-pkh-spruce.json'), 38 | require('../implementations/did-webkey-spruce.json'), 39 | require('../implementations/did-web-evernym.json'), 40 | require('../implementations/did-ebsi.json'), 41 | require('../implementations/did-ssb.json'), 42 | require('../implementations/did-algo.json'), 43 | require('../implementations/did-cheqd.json'), 44 | require('../implementations/did-art.json'), 45 | require('../implementations/did-knox.json'), 46 | ...brokenFixtures 47 | ] 48 | }; 49 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-consumption/did-consumption.spec.js: -------------------------------------------------------------------------------- 1 | let { systemSuiteConfig } = global; 2 | if (!systemSuiteConfig) { // when run via command line 3 | systemSuiteConfig = {}; 4 | } 5 | defaultSuiteConfig = require('./default'); 6 | runtimeSuiteConfig = Object.assign({}, defaultSuiteConfig, systemSuiteConfig); 7 | 8 | runtimeSuiteConfig.didMethods.forEach((didMethodSuiteConfig) => { 9 | const {didMethod, implementation, implementer} = didMethodSuiteConfig; 10 | let suiteName = 11 | `6.x Consumption - ${didMethod} - ${implementation} - ${implementer}`; 12 | 13 | describe(suiteName, () => { 14 | describe(`IMPLEMENTATION ::${didMethod}::${implementation}::${implementer}::`, () => { 15 | require('./did-consumer').didConsumerTests( 16 | didMethodSuiteConfig 17 | ); 18 | require('./did-json-consumption').didJsonConsumptionTests( 19 | didMethodSuiteConfig 20 | ); 21 | require('./did-jsonld-consumption').didJsonldConsumptionTests( 22 | didMethodSuiteConfig 23 | ); 24 | }); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-consumption/did-jsonld-consumption.js: -------------------------------------------------------------------------------- 1 | const generateJsonldConsumptionTests = ( 2 | {did, didDocumentDataModel, resolutionResult}) => { 3 | const didDocument = { 4 | ...didDocumentDataModel.properties, 5 | ...didDocumentDataModel.representationSpecificEntries 6 | }; 7 | const {representation} = resolutionResult; 8 | 9 | it('6.3.2 JSON-LD Consumption - The DID document and any DID document ' + 10 | 'data structures expressed by a JSON-LD representation MUST be ' + 11 | 'deserialized into the data model according to the JSON ' + 12 | 'representation consumption rules as defined in § 6.2 JSON.', async () => { 13 | const consumedDidDocument = JSON.parse(representation); 14 | expect(didDocument).toEqual(consumedDidDocument); 15 | }); 16 | } 17 | 18 | const didJsonldConsumptionTests = (suiteConfig) => { 19 | describe('6.3.2 JSON-LD Consumption', () => { 20 | suiteConfig.dids.forEach((did) => { 21 | describe(did, () => { 22 | for(const [mediaType, resolutionResult] of Object.entries(suiteConfig[did])) { 23 | if(mediaType === 'application/did+ld+json') { 24 | const {didDocumentDataModel} = suiteConfig[did]; 25 | didDocumentDataModel.representationSpecificEntries = 26 | resolutionResult.didDocumentDataModel. 27 | representationSpecificEntries; 28 | 29 | generateJsonldConsumptionTests( 30 | {did, didDocumentDataModel, resolutionResult}); 31 | } 32 | } 33 | }); 34 | }); 35 | }); 36 | }; 37 | 38 | module.exports = { didJsonldConsumptionTests }; 39 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-core-properties/default.js: -------------------------------------------------------------------------------- 1 | const brokenFixtures = process.env.DID_WG_INCLUDE_BREAKING ? [ 2 | require('../implementations/did-ion.json'), 3 | ] : [] 4 | 5 | module.exports = { 6 | name: 'did-spec', 7 | didMethods: [ 8 | require('../implementations/did-example-didwg.json'), 9 | require('../implementations/did-is.json'), 10 | require('../implementations/did-key-2018-db.json'), 11 | require('../implementations/did-key-2020-db.json'), 12 | require('../implementations/did-kilt-2021.json'), 13 | require('../implementations/did-3-2021-3box-labs.json'), 14 | require('../implementations/did-ethr-2021-consensys-mesh.json'), 15 | require('../implementations/did-trust.json'), 16 | require('../implementations/did-v1-vof.json'), 17 | require('../implementations/did-monid.json'), 18 | require('../implementations/did-unisot.json'), 19 | require('../implementations/did-vaa.json'), 20 | require('../implementations/did-lit.json'), 21 | require('../implementations/did-schema.json'), 22 | require('../implementations/did-orb.json'), 23 | require('../implementations/did-nft-2021-3box-labs.json'), 24 | require('../implementations/did-key-transmute.json'), 25 | require('../implementations/did-web-transmute.json'), 26 | require('../implementations/did-photon-transmute.json'), 27 | require('../implementations/did-elem-transmute.json'), 28 | require('../implementations/did-key-mattr.json'), 29 | require('../implementations/did-web-mattr.json'), 30 | require('../implementations/did-sov-mattr.json'), 31 | require('../implementations/did-polygon-ayanworks.json'), 32 | require('../implementations/did-jnctn.json'), 33 | require('../implementations/did-key-spruce.json'), 34 | require('../implementations/did-web-spruce.json'), 35 | require('../implementations/did-tz-spruce.json'), 36 | require('../implementations/did-onion-spruce.json'), 37 | require('../implementations/did-pkh-spruce.json'), 38 | require('../implementations/did-webkey-spruce.json'), 39 | require('../implementations/did-web-evernym.json'), 40 | require('../implementations/did-ebsi.json'), 41 | require('../implementations/did-ssb.json'), 42 | require('../implementations/did-algo.json'), 43 | require('../implementations/did-cheqd.json'), 44 | require('../implementations/did-art.json'), 45 | require('../implementations/did-knox.json'), 46 | ...brokenFixtures 47 | ], 48 | }; 49 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-core-properties/did-core-properties.spec.js: -------------------------------------------------------------------------------- 1 | let { systemSuiteConfig } = global; 2 | if (!systemSuiteConfig) { // when run via command line 3 | systemSuiteConfig = {}; 4 | } 5 | defaultSuiteConfig = require('./default'); 6 | runtimeSuiteConfig = Object.assign({}, defaultSuiteConfig, systemSuiteConfig); 7 | 8 | describe("suites/did-core-properties", () => { 9 | runtimeSuiteConfig.didMethods.forEach((didMethodSuiteConfig) => { 10 | const {didMethod, implementation, implementer} = didMethodSuiteConfig; 11 | 12 | describe(`IMPLEMENTATION ::${didMethod}::${implementation}::${implementer}::`, () => { 13 | let suiteName = 14 | `5.x Core Properties - ${didMethod} - ${implementation} - ${implementer}`; 15 | describe(suiteName, () => { 16 | require('./did-core-properties').didCorePropertiesTests( 17 | didMethodSuiteConfig); 18 | }); 19 | 20 | suiteName = `7.3 Metadata Structure - ` + 21 | `${didMethod} - ${implementation} - ${implementer}`; 22 | describe(suiteName, () => { 23 | require('./did-metadata-structure').didMetadataStructureTests( 24 | didMethodSuiteConfig); 25 | }); 26 | }); 27 | }); 28 | }); -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-core-properties/did-metadata-structure.js: -------------------------------------------------------------------------------- 1 | const didMetadataStructureTests = (suiteConfig) => { 2 | suiteConfig.dids.forEach((didExample) => { 3 | describe(didExample, () => { 4 | suiteConfig.supportedContentTypes.forEach((contentType) => { 5 | describe(contentType, () => { 6 | const didDocumentMetadata = suiteConfig[didExample][contentType].didDocumentMetadata; 7 | if (didDocumentMetadata) { 8 | it('7.3 Metadata Structure - ' + 9 | 'The structure used to communicate this metadata MUST be a map of properties.', () => { 10 | expect(didDocumentMetadata).toBeInfraMap(); 11 | }); 12 | 13 | it('7.3 Metadata Structure - ' + 14 | 'Each property name MUST be a string.', () => { 15 | Object.keys(didDocumentMetadata).forEach((property_name) => { 16 | expect(property_name).toBeString(); 17 | }); 18 | }); 19 | 20 | it('7.3 Metadata Structure - ' + 21 | 'Each property value MUST be a string, map, list, ordered set, boolean, or null.', () => { 22 | Object.keys(didDocumentMetadata).forEach((property_name) => { 23 | expect(didDocumentMetadata[property_name]).toBeDidDocumentPropertyValueType(); 24 | }); 25 | }); 26 | 27 | it('7.3 Metadata Structure - ' + 28 | 'The values within any complex data structures such as maps and lists ' + 29 | 'MUST be one of these data types as well.', () => { 30 | Object.keys(didDocumentMetadata).forEach((property_name) => { 31 | if (typeof didDocumentMetadata[property_name] == "object") { 32 | expect(didDocumentMetadata[property_name]).toBeDidDocumentMap(); 33 | } 34 | }); 35 | }); 36 | 37 | it('7.3 Metadata Structure - ' + 38 | 'The entire metadata structure MUST be serializable according to the JSON ' + 39 | 'serialization rules in the [INFRA] specification.', () => { 40 | // Checking this by serialize/deserialize to/from JSON, then compare the result 41 | var obj = {}; 42 | expect(() => { 43 | obj = JSON.parse(JSON.stringify(didDocumentMetadata)); 44 | }).not.toThrow(); 45 | expect(didDocumentMetadata).toEqual(obj); 46 | }); 47 | 48 | } 49 | }); 50 | }); 51 | }); 52 | }); 53 | }; 54 | 55 | module.exports = { didMetadataStructureTests }; 56 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-identifier/default.js: -------------------------------------------------------------------------------- 1 | const brokenFixtures = process.env.DID_WG_INCLUDE_BREAKING ? [ 2 | require('../implementations/did-unisot.json'), 3 | ] : [] 4 | 5 | 6 | module.exports = { 7 | name: 'did-identity', 8 | didMethods: [ 9 | require('../implementations/did-example-didwg.json'), 10 | require('../implementations/did-is.json'), 11 | require('../implementations/did-key-2018-db.json'), 12 | require('../implementations/did-key-2020-db.json'), 13 | require('../implementations/did-kilt-2021.json'), 14 | require('../implementations/did-3-2021-3box-labs.json'), 15 | require('../implementations/did-ethr-2021-consensys-mesh.json'), 16 | require('../implementations/did-trust.json'), 17 | require('../implementations/did-v1-vof.json'), 18 | require('../implementations/did-monid.json'), 19 | require('../implementations/did-vaa.json'), 20 | require('../implementations/did-ion.json'), 21 | require('../implementations/did-orb.json'), 22 | require('../implementations/did-lit.json'), 23 | require('../implementations/did-schema.json'), 24 | require('../implementations/did-nft-2021-3box-labs.json'), 25 | require('../implementations/did-key-transmute.json'), 26 | require('../implementations/did-web-transmute.json'), 27 | require('../implementations/did-photon-transmute.json'), 28 | require('../implementations/did-elem-transmute.json'), 29 | require('../implementations/did-key-mattr.json'), 30 | require('../implementations/did-web-mattr.json'), 31 | require('../implementations/did-sov-mattr.json'), 32 | require('../implementations/universal-resolver-identifier-tests.json'), 33 | require('../implementations/did-polygon-ayanworks.json'), 34 | require('../implementations/did-jnctn.json'), 35 | require('../implementations/did-key-spruce.json'), 36 | require('../implementations/did-web-spruce.json'), 37 | require('../implementations/did-tz-spruce.json'), 38 | require('../implementations/did-onion-spruce.json'), 39 | require('../implementations/did-pkh-spruce.json'), 40 | require('../implementations/did-webkey-spruce.json'), 41 | require('../implementations/did-web-evernym.json'), 42 | require('../implementations/did-ebsi.json'), 43 | require('../implementations/did-ssb.json'), 44 | require('../implementations/did-algo.json'), 45 | require('../implementations/did-cheqd.json'), 46 | require('../implementations/did-art.json'), 47 | require('../implementations/did-knox.json'), 48 | ...brokenFixtures 49 | ], 50 | }; 51 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-identifier/did-identifier.spec.js: -------------------------------------------------------------------------------- 1 | let { systemSuiteConfig } = global; 2 | if (!systemSuiteConfig) { // when run via command line 3 | systemSuiteConfig = {}; 4 | } 5 | defaultSuiteConfig = require('./default'); 6 | runtimeSuiteConfig = Object.assign({}, defaultSuiteConfig, systemSuiteConfig); 7 | 8 | describe("suites/did-identifier", () => { 9 | runtimeSuiteConfig.didMethods.forEach((didMethodSuiteConfig) => { 10 | const {didMethod, implementation, implementer} = didMethodSuiteConfig; 11 | 12 | describe(`IMPLEMENTATION ::${didMethod}::${implementation}::${implementer}::`, () => { 13 | const suiteName = 14 | `3.x Identifier - ${didMethod} - ${implementation} - ${implementer}`; 15 | describe(suiteName, () => { 16 | require('./did-syntax').didSyntaxTests(didMethodSuiteConfig); 17 | require('./did-parameters').didParametersTests(didMethodSuiteConfig); 18 | }); 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-identifier/did-parameters.js: -------------------------------------------------------------------------------- 1 | const utils = require('../utils'); 2 | 3 | // https://www.w3.org/TR/xmlschema11-2/#nt-dateTimeRep 4 | // Constrained to UTC and without sub-second decimal precision. 5 | // Note: day-of-month constraints not applied. 6 | const versionTimeRe = /^(-?(?:[1-9][0-9]{3,})|(?:0[0-9]{3}))-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T((?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]|24:00:00)(?:\.0+)?(?:Z|[+-]00:00)$/; 7 | 8 | const didParametersTests = (suiteConfig) => { 9 | if(suiteConfig.didParameters) { 10 | describe('3.2 DID URL Syntax', () => { 11 | Object.keys(suiteConfig.didParameters).forEach((didParameter) => { 12 | describe(didParameter, () => { 13 | const didUrl = suiteConfig.didParameters[didParameter]; 14 | const param = utils.getQueryParamValueFromDidUri( 15 | didUrl, 16 | didParameter 17 | ); 18 | 19 | if (didParameter === 'service') { 20 | it('3.2.1 DID Parameters - service - If present, the associated value MUST be an ASCII string.', async () => { 21 | expect(param).toBeAsciiString(); 22 | }); 23 | } 24 | 25 | if (didParameter === 'relativeRef') { 26 | it('3.2.1 DID Parameters - relativeRef - If present, the associated value MUST be an ASCII string and MUST use percent-encoding for certain characters as specified in RFC3986 Section 2.1.', async () => { 27 | expect(param).toBeAsciiString(); 28 | if (param.includes('/')) { 29 | expect(didUrl.includes('%2F')).toBe(true); 30 | } 31 | }); 32 | } 33 | 34 | if (didParameter === 'versionId') { 35 | it('3.2.1 DID Parameters - versionId - If present, the associated value MUST be an ASCII string.', async () => { 36 | expect(param).toBeAsciiString(); 37 | }); 38 | } 39 | 40 | if (didParameter === 'versionTime') { 41 | it('3.2.1 DID Parameters - versionTime - If present, the associated value MUST be an ASCII string which is a valid XML datetime value, as defined in section 3.3.7 of W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes [XMLSCHEMA11-2]. This datetime value MUST be normalized to UTC 00:00:00 and without sub-second decimal precision. For example: 2020-12-20T19:17:47Z.', async () => { 42 | expect(param).toBeAsciiString(); 43 | expect(param).toBeDidCoreDatetime(); 44 | }); 45 | } 46 | 47 | if (didParameter === 'hl') { 48 | it('3.2.1 DID Parameters - hl - If present, the associated value MUST be an ASCII string.', async () => { 49 | expect(param).toBeAsciiString(); 50 | }); 51 | } 52 | 53 | }); 54 | }); 55 | }); 56 | } 57 | }; 58 | 59 | module.exports = { didParametersTests }; 60 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-identifier/did-syntax.js: -------------------------------------------------------------------------------- 1 | const utils = require('../utils'); 2 | 3 | const didSyntaxTests = (suiteConfig) => { 4 | describe('3.1 DID Syntax', () => { 5 | suiteConfig.dids.forEach((didExample) => { 6 | describe(didExample, () => { 7 | it('3.1 DID Syntax - All DIDs MUST conform to the DID Syntax ' + 8 | 'ABNF Rules.', async () => { 9 | expect(didExample).toBeValidDid(); 10 | }); 11 | }); 12 | }); 13 | }); 14 | }; 15 | 16 | module.exports = { didSyntaxTests }; 17 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-production/default.js: -------------------------------------------------------------------------------- 1 | const brokenFixtures = process.env.DID_WG_INCLUDE_BREAKING ? [ 2 | require('../implementations/did-unisot.json'), 3 | ] : [] 4 | 5 | 6 | module.exports = { 7 | name: 'did-production', 8 | didMethods: [ 9 | require('../implementations/did-example-didwg.json'), 10 | require('../implementations/did-is.json'), 11 | require('../implementations/did-key-2018-db.json'), 12 | require('../implementations/did-key-2020-db.json'), 13 | require('../implementations/did-kilt-2021.json'), 14 | require('../implementations/did-3-2021-3box-labs.json'), 15 | require('../implementations/did-ethr-2021-consensys-mesh.json'), 16 | require('../implementations/did-trust.json'), 17 | require('../implementations/did-v1-vof.json'), 18 | require('../implementations/did-monid.json'), 19 | require('../implementations/did-vaa.json'), 20 | require('../implementations/did-ion.json'), 21 | require('../implementations/did-orb.json'), 22 | require('../implementations/did-lit.json'), 23 | require('../implementations/did-schema.json'), 24 | require('../implementations/did-nft-2021-3box-labs.json'), 25 | require('../implementations/did-key-transmute.json'), 26 | require('../implementations/did-web-transmute.json'), 27 | require('../implementations/did-photon-transmute.json'), 28 | require('../implementations/did-elem-transmute.json'), 29 | require('../implementations/did-key-mattr.json'), 30 | require('../implementations/did-sov-mattr.json'), 31 | require('../implementations/did-web-mattr.json'), 32 | require('../implementations/did-polygon-ayanworks.json'), 33 | require('../implementations/did-jnctn.json'), 34 | require('../implementations/did-key-spruce.json'), 35 | require('../implementations/did-web-spruce.json'), 36 | require('../implementations/did-tz-spruce.json'), 37 | require('../implementations/did-onion-spruce.json'), 38 | require('../implementations/did-pkh-spruce.json'), 39 | require('../implementations/did-webkey-spruce.json'), 40 | require('../implementations/did-web-evernym.json'), 41 | require('../implementations/did-ebsi.json'), 42 | require('../implementations/did-ssb.json'), 43 | require('../implementations/did-algo.json'), 44 | require('../implementations/did-cheqd.json'), 45 | require('../implementations/did-art.json'), 46 | require('../implementations/did-knox.json'), 47 | ...brokenFixtures 48 | ], 49 | }; 50 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-production/did-jsonld-production.js: -------------------------------------------------------------------------------- 1 | const generateJsonldProductionTests = ( 2 | {did, didDocumentDataModel, resolutionResult}) => { 3 | const didDocument = { 4 | ...didDocumentDataModel.properties, 5 | ...didDocumentDataModel.representationSpecificEntries 6 | }; 7 | 8 | it('6.3.1 JSON-LD Production - The DID document and any DID document ' + 9 | 'data structures expressed by the data model MUST be serialized to the ' + 10 | 'JSON-LD representation according to the JSON representation production ' + 11 | 'rules as defined in § 6.2 JSON.', async () => { 12 | reserializedDidDocument = JSON.parse(JSON.stringify(didDocument)); 13 | expect(didDocument).toEqual(reserializedDidDocument); 14 | }); 15 | 16 | it('6.3.1 JSON-LD Production - In addition to using the JSON ' + 17 | 'representation production rules, JSON-LD production MUST include the ' + 18 | 'representation-specific @context entry.', async () => { 19 | expect(didDocument).toHaveProperty('@context'); 20 | }); 21 | 22 | it('6.3.1 JSON-LD Production - The serialized value of @context ' + 23 | 'MUST be the JSON String https://www.w3.org/ns/did/v1, or a JSON ' + 24 | 'Array where the first item is the JSON String ' + 25 | 'https://www.w3.org/ns/did/v1 and the subsequent items are serialized ' + 26 | 'according to the JSON representation production rules.', async () => { 27 | const context = didDocument['@context']; 28 | 29 | if(typeof context === 'string') { 30 | expect(context).toBe('https://www.w3.org/ns/did/v1'); 31 | } else if(Array.isArray(context)) { 32 | expect(context[0]).toBe('https://www.w3.org/ns/did/v1'); 33 | reserializedContext = JSON.parse(JSON.stringify(context)); 34 | expect(context).toEqual(reserializedContext); 35 | } else { 36 | throw new Error('Invalid @context value '+ context); 37 | } 38 | }); 39 | 40 | it('6.3.1 JSON-LD Production - When serializing a JSON-LD ' + 41 | 'representation of a DID document, a conforming producer MUST specify a ' + 42 | 'media type of application/did+ld+json to downstream applications such ' + 43 | 'as described in § 7.1.2 DID Resolution Metadata.', async () => { 44 | const {contentType} = resolutionResult.didResolutionMetadata; 45 | expect(contentType).toBe('application/did+ld+json'); 46 | }); 47 | } 48 | 49 | const didJsonldProductionTests = (suiteConfig) => { 50 | describe('6.3.1 JSON-LD Production', () => { 51 | suiteConfig.dids.forEach((did) => { 52 | describe(did, () => { 53 | for(const [mediaType, resolutionResult] of Object.entries(suiteConfig[did])) { 54 | if(mediaType === 'application/did+ld+json') { 55 | const {didDocumentDataModel} = suiteConfig[did]; 56 | didDocumentDataModel.representationSpecificEntries = 57 | resolutionResult.didDocumentDataModel. 58 | representationSpecificEntries; 59 | 60 | generateJsonldProductionTests( 61 | {did, didDocumentDataModel, resolutionResult}); 62 | } 63 | } 64 | }); 65 | }); 66 | }); 67 | }; 68 | 69 | module.exports = { didJsonldProductionTests }; 70 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-production/did-producer.js: -------------------------------------------------------------------------------- 1 | const utils = require('../utils'); 2 | const jsonMediaTypes = ['application/did+ld+json', 'application/did+json']; 3 | 4 | const generateDidProducerTests = ( 5 | {did, didDocumentDataModel, resolutionResult}) => { 6 | 7 | const dmProperties = didDocumentDataModel.properties; 8 | const dmRse = didDocumentDataModel.representationSpecificEntries; 9 | const {representation} = resolutionResult; 10 | const contentType = resolutionResult.didResolutionMetadata['contentType']; 11 | 12 | describe(contentType, () => { 13 | it('6.1 Production and Consumption - A conforming producer MUST take a ' + 14 | 'DID document data model and a representation-specific entries map as ' + 15 | 'input into the production process. The conforming producer MAY accept ' + 16 | 'additional options as input into the production process.', async () => { 17 | expect(dmProperties).toBeDefined(); 18 | expect(dmRse).toBeDefined(); 19 | }); 20 | 21 | it('6.1 Production and Consumption - A conforming producer MUST ' + 22 | 'serialize all entries in the DID document data model, and the ' + 23 | 'representation-specific entries map, that do not have explicit ' + 24 | 'processing rules for the representation being produced using only the ' + 25 | 'representation\'s data type processing rules and return the ' + 26 | 'serialization after the production process completes.', async () => { 27 | if(jsonMediaTypes.includes(contentType)) { 28 | const dataModel = {...dmRse, ...dmProperties}; 29 | const parsedDataModel = JSON.parse(representation); 30 | expect(dataModel).toEqual(parsedDataModel); 31 | } else { 32 | throw new Error('Unknown producer for content-type: '+ contentType); 33 | } 34 | }); 35 | 36 | it('6.1 Production and Consumption - A conforming producer MUST return ' + 37 | 'the Media Type string associated with the representation after the ' + 38 | 'production process completes.', async () => { 39 | expect(typeof contentType === 'string').toBe(true); 40 | }); 41 | 42 | it('6.1 Production and Consumption - A conforming producer MUST NOT ' + 43 | 'produce non-conforming DIDs or DID documents.', async () => { 44 | if(jsonMediaTypes.includes(contentType)) { 45 | const dataModel = {...dmRse, ...dmProperties}; 46 | parsedDataModel = JSON.parse(JSON.stringify(dataModel)); 47 | expect(dataModel).toEqual(parsedDataModel); 48 | } else { 49 | throw new Error('Unknown producer for content-type: '+ contentType); 50 | } 51 | }); 52 | }); 53 | } 54 | 55 | const didProducerTests = (suiteConfig) => { 56 | describe('6.1 Production', () => { 57 | suiteConfig.dids.forEach((did) => { 58 | describe(did, () => { 59 | for(const [mediaType, resolutionResult] of Object.entries(suiteConfig[did])) { 60 | if(resolutionResult.didDocumentDataModel === undefined) continue; 61 | 62 | const {didDocumentDataModel} = suiteConfig[did]; 63 | didDocumentDataModel.representationSpecificEntries = 64 | resolutionResult.didDocumentDataModel.representationSpecificEntries; 65 | 66 | generateDidProducerTests( 67 | {did, didDocumentDataModel, resolutionResult}); 68 | } 69 | }); 70 | }); 71 | }); 72 | }; 73 | 74 | module.exports = { didProducerTests }; 75 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-production/did-production.spec.js: -------------------------------------------------------------------------------- 1 | let { systemSuiteConfig } = global; 2 | if (!systemSuiteConfig) { // when run via command line 3 | systemSuiteConfig = {}; 4 | } 5 | defaultSuiteConfig = require('./default'); 6 | runtimeSuiteConfig = Object.assign({}, defaultSuiteConfig, systemSuiteConfig); 7 | 8 | describe("suites/did-production", () => { 9 | runtimeSuiteConfig.didMethods.forEach((didMethodSuiteConfig) => { 10 | const {didMethod, implementation, implementer} = didMethodSuiteConfig; 11 | 12 | describe(`IMPLEMENTATION ::${didMethod}::${implementation}::${implementer}::`, () => { 13 | let suiteName = 14 | `6.x Production - ${didMethod} - ${implementation} - ${implementer}`; 15 | 16 | require('./did-producer').didProducerTests( 17 | didMethodSuiteConfig 18 | ); 19 | require('./did-json-production').didJsonProductionTests( 20 | didMethodSuiteConfig 21 | ); 22 | require('./did-jsonld-production').didJsonldProductionTests( 23 | didMethodSuiteConfig 24 | ); 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-resolution/did-resolution.spec.js: -------------------------------------------------------------------------------- 1 | let { systemSuiteConfig } = global; 2 | if (!systemSuiteConfig) { // when run via command line 3 | systemSuiteConfig = {}; 4 | } 5 | defaultSuiteConfig = require('./default'); 6 | runtimeSuiteConfig = Object.assign({}, defaultSuiteConfig, systemSuiteConfig); 7 | 8 | const utils = require('../resolution-utils'); 9 | 10 | describe("suites/did-resolution", () => { 11 | runtimeSuiteConfig.resolvers.forEach((imp) => { 12 | const {didMethod, implementation, implementer} = imp; 13 | 14 | describe(`IMPLEMENTATION ::${didMethod}::${implementation}::${implementer}::`, () => { 15 | let suiteName = `7.1.x DID Resolution - ${imp.implementation} - ${imp.implementer}`; 16 | 17 | describe(suiteName, () => { 18 | it('All conformant DID resolvers MUST implement the DID resolution functions for at least one DID method and MUST be able to return a DID document in at least one conformant representation.', async () => { 19 | expect(imp.executions).not.toBeEmpty(); 20 | const execution = imp.executions.find((execution) => (execution.function === 'resolveRepresentation')); 21 | expect(execution).not.toBeFalsy(); 22 | utils.expectConformantDidDocumentRepresentation(execution.output.didDocumentStream, execution.output.didResolutionMetadata.contentType); 23 | }); 24 | let i = 0; 25 | imp.executions.forEach((execution) => { 26 | const expectedOutcome = utils.findExpectedOutcome(imp.expectedOutcomes, i++); 27 | require('./did-resolution').didResolutionTests(execution, expectedOutcome, implementation); 28 | }); 29 | }); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-url-dereferencing/default.js: -------------------------------------------------------------------------------- 1 | const brokenFixtures = process.env.DID_WG_INCLUDE_BREAKING ? [ 2 | require('../implementations/dereferencer-example-didwg.json'), 3 | ] : [] 4 | 5 | module.exports = { 6 | "name": "DID URL Dereferencing", 7 | "dereferencers": [ 8 | require('../implementations/dereferencer-ethr-2021-consensys-mesh.json'), 9 | require('../implementations/dereferencer-3-3box-labs.json'), 10 | require('../implementations/dereferencer-nft-3box-labs.json'), 11 | require('../implementations/dereferencer-web-transmute.json'), 12 | require('../implementations/universal-resolver-dereferencer-tests.json'), 13 | require('../implementations/dereferencer-mattr.json'), 14 | require('../implementations/dereferencer-polygon-ayanworks.json'), 15 | require('../implementations/dereferencer-spruce-key.json'), 16 | require('../implementations/dereferencer-spruce-web.json'), 17 | require('../implementations/dereferencer-spruce-tz.json'), 18 | require('../implementations/dereferencer-spruce-onion.json'), 19 | require('../implementations/dereferencer-spruce-pkh.json'), 20 | require('../implementations/dereferencer-spruce-webkey.json'), 21 | require('../implementations/dereferencer-ssb.json'), 22 | require('../implementations/dereferencer-cheqd.json'), 23 | require('../implementations/dereferencer-art.json'), 24 | require('../implementations/dereferencer-knox.json'), 25 | ...brokenFixtures 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/did-url-dereferencing/did-url-dereferencing.spec.js: -------------------------------------------------------------------------------- 1 | let { systemSuiteConfig } = global; 2 | if (!systemSuiteConfig) { // when run via command line 3 | systemSuiteConfig = {}; 4 | } 5 | defaultSuiteConfig = require('./default'); 6 | runtimeSuiteConfig = Object.assign({}, defaultSuiteConfig, systemSuiteConfig); 7 | 8 | const utils = require('../resolution-utils'); 9 | 10 | describe("suites/did-url-dereferencing", () => { 11 | runtimeSuiteConfig.dereferencers.forEach((imp) => { 12 | const {didMethod, implementation, implementer} = imp; 13 | 14 | describe(`IMPLEMENTATION ::${didMethod}::${implementation}::${implementer}::`, () => { 15 | let suiteName = `7.2.x DID URL Dereferencing - ${imp.implementation} - ${imp.implementer}`; 16 | 17 | describe(suiteName, () => { 18 | let i = 0; 19 | imp.executions.forEach((execution) => { 20 | const expectedOutcome = utils.findExpectedOutcome(imp.expectedOutcomes, i++); 21 | require('./did-url-dereferencing').didUrlDereferencingTests(execution, expectedOutcome, imp); 22 | }); 23 | }); 24 | }); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-algo.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:algo", 3 | "implementation": "DID Algo Test Suite", 4 | "implementer": "AID:Tech and Algorand Foundation", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1 ] 7 | }, 8 | "executions": [ 9 | { 10 | "function": "dereference", 11 | "input": { 12 | "didUrl": "did:algo:56da1708-eead-4e2d-9558-f53d684003fd", 13 | "dereferenceOptions": { 14 | "accept": "application/did+json" 15 | } 16 | }, 17 | "output": { 18 | "dereferencingMetadata": { 19 | "contentType": "application/did+ld+json" 20 | }, 21 | "contentStream": "{ \"@context\": [ \"https://www.w3.org/ns/did/v1\", \"https://w3id.org/security/suites/ed25519-2020/v1\", \"https://w3id.org/security/suites/x25519-2020/v1\", \"https://did-ns.aidtech.network/v1\" ], \"id\": \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd\", \"verificationMethod\": [ { \"id\": \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd#master\", \"type\": \"Ed25519VerificationKey2020\", \"controller\": \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd\", \"publicKeyMultibase\": \"z8sdBpaoefmAi7iFbY96ZkP1ff9VoRSRTJs4NQEyLfunH\" } ], \"authentication\": [ \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd#master\" ], \"service\": [ { \"id\": \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd#algo-connect\", \"type\": \"AlgorandExternalService\", \"serviceEndpoint\": \"https://did.algorand.foundation\", \"extensions\": [ { \"id\": \"algo-address\", \"version\": \"0.1.0\", \"data\": [ { \"address\": \"GZAURFQR7VRUL2TRVMUJ3G3IGFYSFXBWHBFFQBEITXWDLFVVHTICFNY2LE\", \"asset\": \"ALGO\", \"network\": \"testnet\" } ] } ] } ] }", 22 | "contentMetadata": {} 23 | } 24 | }, 25 | { 26 | "function": "dereference", 27 | "input": { 28 | "didUrl": "did:algo:56da1708-eead-4e2d-9558-f53d684003fd#master", 29 | "dereferenceOptions": { 30 | "accept": "application/did+json" 31 | } 32 | }, 33 | "output": { 34 | "dereferencingMetadata": { 35 | "contentType": "application/did+json" 36 | }, 37 | "contentStream": "{ \"id\": \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd#master\", \"type\": \"Ed25519VerificationKey2020\", \"controller\": \"did:algo:56da1708-eead-4e2d-9558-f53d684003fd\", \"publicKeyMultibase\": \"z8sdBpaoefmAi7iFbY96ZkP1ff9VoRSRTJs4NQEyLfunH\" }", 38 | "contentMetadata": {} 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-art.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:art", 3 | "implementation": "ArtracID DID Method", 4 | "implementer": "ART GROUP LIMITED ARTRACX.COM", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1 ] 7 | }, 8 | "executions": [ 9 | { 10 | "function": "dereference", 11 | "input": { 12 | "didUrl": "did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c", 13 | "dereferenceOptions": { 14 | "accept": "application/did+json" 15 | } 16 | }, 17 | "output": { 18 | "dereferencingMetadata": { 19 | "contentType": "application/did+ld+json" 20 | }, 21 | "contentStream": "{ \"@context\": [ \"https://www.w3.org/ns/did/v1\", \"https://w3c-ccg.github.io/ld-cryptosuite-registry/#ecdsasecp256k1signature2019\" ], \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\", \"verificationMethod\": [ { \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\", \"type\": \"EcdsaSecp256k1VerificationKey2019\", \"controller\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\", \"publicKeyMultibase\": \"fef2823c7d237bd094d633a1765d5896b0f442481a997da2f83d7a928ddce7e65\", \"blockchainAccountId\":\"enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\" } ], \"authentication\": [ \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\" ], \"assertionMethod\": [ \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\" ], \"service\": [ { \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#service\", \"type\": \"LinkedDomains\", \"serviceEndpoint\": \"https://did.artrac.id\" } ] }", 22 | "contentMetadata": {} 23 | } 24 | }, 25 | { 26 | "function": "dereference", 27 | "input": { 28 | "didUrl": "did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey", 29 | "dereferenceOptions": { 30 | "accept": "application/did+json" 31 | } 32 | }, 33 | "output": { 34 | "dereferencingMetadata": { 35 | "contentType": "application/did+json" 36 | }, 37 | "contentStream": "{ \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\", \"type\": \"EcdsaSecp256k1VerificationKey2019\", \"controller\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\", \"publicKeyMultibase\": \"fef2823c7d237bd094d633a1765d5896b0f442481a997da2f83d7a928ddce7e65\", \"blockchainAccountId\":\"enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\" }", 38 | "contentMetadata": {} 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-ethr-2021-consensys-mesh.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "ethr-did-resolver", 3 | "implementer": "ConsenSys Mesh", 4 | "didMethod" : "did:ethr", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1 ], 7 | "invalidDidUrlErrorOutcome": [ ], 8 | "notFoundErrorOutcome": [ ] 9 | }, 10 | "executions": [ 11 | { 12 | "function": "dereference", 13 | "input": { 14 | "didUrl": "did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388?versionId=1", 15 | "dereferenceOptions": { 16 | "accept": "application/did+json" 17 | } 18 | }, 19 | "output": { 20 | "dereferencingMetadata": { 21 | "contentType": "application/did+json" 22 | }, 23 | "contentStream": "{\"id\":\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388\",\"verificationMethod\":[{\"id\":\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388#controller\",\"type\":\"EcdsaSecp256k1RecoveryMethod2020\",\"controller\":\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388\",\"blockchainAccountId\":\"0x26bF14321004e770E7A8b080b7a526d8eed8b388@eip155:1\"}],\"authentication\":[\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388#controller\"],\"assertionMethod\":[\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388#controller\"]}", 24 | "contentMetadata": { 25 | "nextVersionId":"12090175", 26 | "nextUpdate":"2021-03-22T18:14:29Z" 27 | } 28 | } 29 | }, 30 | { 31 | "function": "dereference", 32 | "input": { 33 | "didUrl": "did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388?versionId=1", 34 | "dereferenceOptions": { 35 | "accept": "application/did+ld+json" 36 | } 37 | }, 38 | "output": { 39 | "dereferencingMetadata": { 40 | "contentType": "application/did+ld+json" 41 | }, 42 | "contentStream": "{\"@context\":[\"https:\/\/www.w3.org\/ns\/did\/v1\",\"https:\/\/identity.foundation\/EcdsaSecp256k1RecoverySignature2020\/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld\"],\"id\":\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388\",\"verificationMethod\":[{\"id\":\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388#controller\",\"type\":\"EcdsaSecp256k1RecoveryMethod2020\",\"controller\":\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388\",\"blockchainAccountId\":\"0x26bF14321004e770E7A8b080b7a526d8eed8b388@eip155:1\"}],\"authentication\":[\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388#controller\"],\"assertionMethod\":[\"did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388#controller\"]}", 43 | "contentMetadata": { 44 | "nextVersionId":"12090175", 45 | "nextUpdate":"2021-03-22T18:14:29Z" 46 | } 47 | } 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-example-didwg.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Example Dereferencer", 3 | "implementer": "DID Working Group", 4 | "didMethod": "did:example", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1 ], 7 | "invalidDidUrlErrorOutcome": [ 2 ], 8 | "notFoundErrorOutcome": [ 3 ] 9 | }, 10 | "executions": [ 11 | { 12 | "function": "dereference", 13 | "input": { 14 | "didUrl": "did:example:222", 15 | "dereferenceOptions": { 16 | "accept": "application/did+json" 17 | } 18 | }, 19 | "output": { 20 | "dereferencingMetadata": { 21 | "contentType": "application/did+json" 22 | }, 23 | "contentStream": "{\"id\": \"did:example:222\",\"verificationMethod\": [{\"id\": \"did:example:222#key-1\",\"controller\": \"did:example:222\",\"publicKeyBase58\": \"F6NxfeuPJ5NhmDM6QT2TeSFxcnnkQBgtv6yfQziS5NPM\"}],\"service\": []}", 24 | "contentMetadata": { 25 | } 26 | } 27 | }, 28 | { 29 | "function": "dereference", 30 | "input": { 31 | "didUrl": "did:example:222#key-1", 32 | "dereferenceOptions": { 33 | "accept": "application/did+json" 34 | } 35 | }, 36 | "output": { 37 | "dereferencingMetadata": { 38 | "contentType": "application/did+json" 39 | }, 40 | "contentStream": "{\"id\": \"did:example:222#key-1\",\"controller\": \"did:example:222\",\"publicKeyBase58\": \"F6NxfeuPJ5NhmDM6QT2TeSFxcnnkQBgtv6yfQziS5NPM\"}", 41 | "contentMetadata": { 42 | } 43 | } 44 | }, 45 | { 46 | "function": "dereference", 47 | "input": { 48 | "didUrl": "did:example_333", 49 | "dereferenceOptions": { 50 | "accept": "application/did+json" 51 | } 52 | }, 53 | "output": { 54 | "dereferencingMetadata": { 55 | "error": "invalidDidUrl" 56 | }, 57 | "contentStream": "", 58 | "contentMetadata": { 59 | } 60 | } 61 | }, 62 | { 63 | "function": "dereference", 64 | "input": { 65 | "didUrl": "did:example:444", 66 | "dereferenceOptions": { 67 | "accept": "application/did+ld+json" 68 | } 69 | }, 70 | "output": { 71 | "dereferencingMetadata": { 72 | "error": "notFound" 73 | }, 74 | "contentStream": "", 75 | "contentMetadata": { 76 | } 77 | } 78 | } 79 | ] 80 | } 81 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-nft-3box-labs.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "@ceramicnetwork/nft-did-resolver", 3 | "implementer": "3Box Labs", 4 | "didMethod": "did:nft", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1 ], 7 | "invalidDidUrlErrorOutcome": [ ], 8 | "notFoundErrorOutcome": [ ] 9 | }, 10 | "executions": [ 11 | { 12 | "function": "dereference", 13 | "input": { 14 | "didUrl": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2?versionTime=2021-03-16T10:09:21Z", 15 | "dereferenceOptions": { 16 | "accept": "application/did+json" 17 | } 18 | }, 19 | "output": { 20 | "dereferencingMetadata": { 21 | "contentType": "application/did+json" 22 | }, 23 | "contentStream": "{\"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"controller\": \"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\", \"verificationMethod\":[{ \"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner\", \"type\":\"BlockchainVerificationMethod2021\", \"controller\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"blockchainAccountId\":\"0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1\"}]}", 24 | "contentMetadata": { } 25 | } 26 | }, 27 | { 28 | "function": "dereference", 29 | "input": { 30 | "didUrl": "did:3:kjzl6cwe1jw145m7jxh4jpa6iw1ps3jcjordpo81e0w04krcpz8knxvg5ygiabd?versionId=bafyreidmpfv7aumgqeqacprb2yv3t7sapsoro6dpopopyxtelknfbxifia", 31 | "dereferenceOptions": { 32 | "accept": "application/did+ld+json" 33 | } 34 | }, 35 | "output": { 36 | "dereferencingMetadata": { 37 | "contentType": "application/did+json" 38 | }, 39 | "contentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"controller\": \"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\", \"verificationMethod\":[{ \"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner\", \"type\":\"BlockchainVerificationMethod2021\", \"controller\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"blockchainAccountId\":\"0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1\"}]}", 40 | "contentMetadata": { } 41 | } 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-polygon-ayanworks.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "polygon-did-dereferencer", 3 | "implementer": "Ayanworks", 4 | "didMethod": "did:polygon", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [0, 1, 2, 3, 4, 5, 6], 7 | "invalidDidUrlErrorOutcome": [7], 8 | "notFoundErrorOutcome": [8] 9 | }, 10 | "executions": [{ 11 | "function": "dereference", 12 | "input": { 13 | "didUrl": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 14 | "dereferenceOptions": { 15 | "accept": "application/did+json" 16 | } 17 | }, 18 | "output": { 19 | "dereferencingMetadata": { 20 | "contentType": "application/did+json" 21 | }, 22 | "contentStream": "{\n\t\"@context\": \"https://w3id.org/did/v1\",\n\t\"id\": \"did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E\",\n\t\"verificationMethod\": [{\n\t\t\"id\": \"did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E\",\n\t\t\"type\": \"EcdsaSecp256k1VerificationKey2019\",\n\t\t\"controller\": \"did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E\",\n\t\t\"publicKeyBase58\": \"7Lnm1evgNdC3VNWRea5kMHqMWKDNzTbFjPLV4rtCbPHjDP29xQu58dgS5DRk9kaVzbFxFkbeWVEt5hAd5TPmXx6AHYHDw\"\n\t}]\n}", 23 | "contentMetadata": {} 24 | } 25 | }, 26 | { 27 | "function": "dereference", 28 | "input": { 29 | "didUrl": "did:polygon_3:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 30 | "dereferenceOptions": { 31 | "accept": "application/did+json" 32 | } 33 | }, 34 | "output": { 35 | "dereferencingMetadata": { 36 | "error": "invalidDidUrl" 37 | }, 38 | "contentStream": "", 39 | "contentMetadata": {} 40 | } 41 | }, 42 | { 43 | "function": "dereference", 44 | "input": { 45 | "didUrl": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 46 | "dereferenceOptions": { 47 | "accept": "application/did+ld+json" 48 | } 49 | }, 50 | "output": { 51 | "dereferencingMetadata": { 52 | "error": "notFound" 53 | }, 54 | "contentStream": "", 55 | "contentMetadata": {} 56 | } 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-spruce-key.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:key", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-key", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1 9 | ], 10 | "invalidDidUrlErrorOutcome": [ 11 | 2 12 | ] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "dereference", 17 | "input": { 18 | "didUrl": "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH", 19 | "dereferenceOptions": {} 20 | }, 21 | "output": { 22 | "dereferencingMetadata": { 23 | "contentType": "application/did+ld+json" 24 | }, 25 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"Ed25519VerificationKey2018\":\"https://w3id.org/security#Ed25519VerificationKey2018\",\"publicKeyJwk\":{\"@id\":\"https://w3id.org/security#publicKeyJwk\",\"@type\":\"@json\"}}],\"id\":\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\",\"verificationMethod\":[{\"id\":\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH#z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\",\"type\":\"Ed25519VerificationKey2018\",\"controller\":\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\",\"publicKeyJwk\":{\"kty\":\"OKP\",\"crv\":\"Ed25519\",\"x\":\"lJZrfAjkBXdfjebMHEUI9usidAPhAlssitLXR3OYxbI\"}}],\"authentication\":[\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH#z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\"],\"assertionMethod\":[\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH#z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\"]}", 26 | "contentMetadata": {} 27 | } 28 | }, 29 | { 30 | "function": "dereference", 31 | "input": { 32 | "didUrl": "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH#z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH", 33 | "dereferenceOptions": {} 34 | }, 35 | "output": { 36 | "dereferencingMetadata": { 37 | "contentType": "application/ld+json" 38 | }, 39 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"Ed25519VerificationKey2018\":\"https://w3id.org/security#Ed25519VerificationKey2018\",\"publicKeyJwk\":{\"@id\":\"https://w3id.org/security#publicKeyJwk\",\"@type\":\"@json\"}}],\"id\":\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH#z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\",\"type\":\"Ed25519VerificationKey2018\",\"controller\":\"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\",\"publicKeyJwk\":{\"kty\":\"OKP\",\"crv\":\"Ed25519\",\"x\":\"lJZrfAjkBXdfjebMHEUI9usidAPhAlssitLXR3OYxbI\"}}", 40 | "contentMetadata": {} 41 | } 42 | }, 43 | { 44 | "function": "dereference", 45 | "input": { 46 | "didUrl": "bad:invalid", 47 | "dereferenceOptions": {} 48 | }, 49 | "output": { 50 | "dereferencingMetadata": { 51 | "error": "invalidDidUrl" 52 | }, 53 | "contentStream": "", 54 | "contentMetadata": {} 55 | } 56 | } 57 | ] 58 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-spruce-onion.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:onion", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-onion", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1 9 | ] 10 | }, 11 | "executions": [ 12 | { 13 | "function": "dereference", 14 | "input": { 15 | "didUrl": "did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid", 16 | "dereferenceOptions": {} 17 | }, 18 | "output": { 19 | "dereferencingMetadata": { 20 | "contentType": "application/did+ld+json" 21 | }, 22 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"@base\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\"}],\"id\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\",\"verificationMethod\":[{\"id\":\"#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E\",\"type\":\"JsonWebKey2020\",\"controller\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\",\"publicKeyJwk\":{\"kty\":\"OKP\",\"crv\":\"Ed25519\",\"x\":\"LIUp9Jdi2R17QcZnbPFZOYyV5oyotNHU2J5dQUdTUa4\"}},{\"id\":\"#5CRqmSH-XbX2V1qysBH0vPWzgveQEZObyOrAiaOY9U8\",\"type\":\"JsonWebKey2020\",\"controller\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\",\"publicKeyJwk\":{\"kty\":\"OKP\",\"crv\":\"X25519\",\"x\":\"785EYGRUOU2sNrWMZJgsCgQFs4lXpVWgvM9K6CyBogU\"}},{\"id\":\"#iFPG3dtLcg-0jI4CVa9b94g06KadgrpM8rC9EMI94nA\",\"type\":\"Ed25519VerificationKey2018\",\"controller\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\",\"publicKeyBase58\":\"3zni9pmFAWvFvuGCnnMVSRxYkjv5gkFMKsMsAtqX1SJq\"}],\"authentication\":[\"#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E\"],\"assertionMethod\":[\"#iFPG3dtLcg-0jI4CVa9b94g06KadgrpM8rC9EMI94nA\"],\"keyAgreement\":[\"#5CRqmSH-XbX2V1qysBH0vPWzgveQEZObyOrAiaOY9U8\"],\"capabilityInvocation\":[\"#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E\"],\"capabilityDelegation\":[\"#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E\"]}", 23 | "contentMetadata": {} 24 | } 25 | }, 26 | { 27 | "function": "dereference", 28 | "input": { 29 | "didUrl": "did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E", 30 | "dereferenceOptions": {} 31 | }, 32 | "output": { 33 | "dereferencingMetadata": { 34 | "contentType": "application/ld+json" 35 | }, 36 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"@base\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\"}],\"id\":\"#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E\",\"type\":\"JsonWebKey2020\",\"controller\":\"did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid\",\"publicKeyJwk\":{\"kty\":\"OKP\",\"crv\":\"Ed25519\",\"x\":\"LIUp9Jdi2R17QcZnbPFZOYyV5oyotNHU2J5dQUdTUa4\"}}", 37 | "contentMetadata": {} 38 | } 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-spruce-pkh.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:pkh", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-pkh", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1 9 | ] 10 | }, 11 | "executions": [ 12 | { 13 | "function": "dereference", 14 | "input": { 15 | "didUrl": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L", 16 | "dereferenceOptions": {} 17 | }, 18 | "output": { 19 | "dereferencingMetadata": { 20 | "contentType": "application/did+ld+json" 21 | }, 22 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"EcdsaSecp256k1RecoveryMethod2020\":\"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoveryMethod2020\",\"blockchainAccountId\":\"https://w3id.org/security#blockchainAccountId\"}],\"id\":\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L\",\"verificationMethod\":[{\"id\":\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\",\"type\":\"EcdsaSecp256k1RecoveryMethod2020\",\"controller\":\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L\",\"blockchainAccountId\":\"DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L@bip122:1a91e3dace36e2be3bf030a65679fe82\"}],\"authentication\":[\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\"],\"assertionMethod\":[\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\"]}", 23 | "contentMetadata": {} 24 | } 25 | }, 26 | { 27 | "function": "dereference", 28 | "input": { 29 | "didUrl": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId", 30 | "dereferenceOptions": {} 31 | }, 32 | "output": { 33 | "dereferencingMetadata": { 34 | "contentType": "application/ld+json" 35 | }, 36 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"EcdsaSecp256k1RecoveryMethod2020\":\"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoveryMethod2020\",\"blockchainAccountId\":\"https://w3id.org/security#blockchainAccountId\"}],\"id\":\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\",\"type\":\"EcdsaSecp256k1RecoveryMethod2020\",\"controller\":\"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L\",\"blockchainAccountId\":\"DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L@bip122:1a91e3dace36e2be3bf030a65679fe82\"}", 37 | "contentMetadata": {} 38 | } 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-spruce-tz.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:tz", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-tezos", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1 9 | ] 10 | }, 11 | "executions": [ 12 | { 13 | "function": "dereference", 14 | "input": { 15 | "didUrl": "did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x", 16 | "dereferenceOptions": {} 17 | }, 18 | "output": { 19 | "dereferencingMetadata": { 20 | "contentType": "application/did+ld+json" 21 | }, 22 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021\":\"https://w3id.org/security#Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021\",\"blockchainAccountId\":\"https://w3id.org/security#blockchainAccountId\"}],\"id\":\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x\",\"verificationMethod\":[{\"id\":\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x#blockchainAccountId\",\"type\":\"Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021\",\"controller\":\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x\",\"blockchainAccountId\":\"tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x@tezos:mainnet\"}],\"authentication\":[\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x#blockchainAccountId\"],\"assertionMethod\":[\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x#blockchainAccountId\"]}", 23 | "contentMetadata": {} 24 | } 25 | }, 26 | { 27 | "function": "dereference", 28 | "input": { 29 | "didUrl": "did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x#blockchainAccountId", 30 | "dereferenceOptions": {} 31 | }, 32 | "output": { 33 | "dereferencingMetadata": { 34 | "contentType": "application/ld+json" 35 | }, 36 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021\":\"https://w3id.org/security#Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021\",\"blockchainAccountId\":\"https://w3id.org/security#blockchainAccountId\"}],\"id\":\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x#blockchainAccountId\",\"type\":\"Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021\",\"controller\":\"did:tz:tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x\",\"blockchainAccountId\":\"tz1YwA1FwpgLtc1G8DKbbZ6e6PTb1dQMRn5x@tezos:mainnet\"}", 37 | "contentMetadata": {} 38 | } 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-spruce-web.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:web", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-web", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 1, 8 | 2 9 | ], 10 | "notFoundErrorOutcome": [ 11 | 0 12 | ] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "dereference", 17 | "input": { 18 | "didUrl": "did:web:did.actor:nonexistent", 19 | "dereferenceOptions": {} 20 | }, 21 | "output": { 22 | "dereferencingMetadata": { 23 | "error": "notFound" 24 | }, 25 | "contentStream": "", 26 | "contentMetadata": {} 27 | } 28 | }, 29 | { 30 | "function": "dereference", 31 | "input": { 32 | "didUrl": "did:web:demo.spruceid.com:2021:07:14:service-example", 33 | "dereferenceOptions": {} 34 | }, 35 | "output": { 36 | "dereferencingMetadata": { 37 | "contentType": "application/did+ld+json" 38 | }, 39 | "contentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\"],\"id\":\"did:web:demo.spruceid.com:2021:07:14:service-example\",\"service\":[{\"id\":\"#hello\",\"type\":\"#HelloService\",\"serviceEndpoint\":\"https://demo.spruceid.com/2021/07/14/service-example/hello.txt\"}]}", 40 | "contentMetadata": {} 41 | } 42 | }, 43 | { 44 | "function": "dereference", 45 | "input": { 46 | "didUrl": "did:web:demo.spruceid.com:2021:07:14:service-example?service=hello", 47 | "dereferenceOptions": {} 48 | }, 49 | "output": { 50 | "dereferencingMetadata": { 51 | "contentType": "text/url" 52 | }, 53 | "contentStream": "https://demo.spruceid.com/2021/07/14/service-example/hello.txt?service=hello", 54 | "contentMetadata": {} 55 | } 56 | } 57 | ] 58 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-ssb.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:ssb", 3 | "implementation": "ssb-did-resolver", 4 | "implementer": "Secure Scuttlebutt Consortium", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1, 9 | 2 10 | ] 11 | }, 12 | "executions": [ 13 | { 14 | "function": "dereference", 15 | "input": { 16 | "didUrl": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU", 17 | "dereferenceOptions": {} 18 | }, 19 | "output": { 20 | "dereferencingMetadata": { 21 | "contentType": "application/did+ld+json" 22 | }, 23 | "contentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU\",\"controller\":\"did:key:z6Mko4u4GMcQu12BjNqBWbZdVFJ2fiGLKfcrxiZV8u3gmBCG\",\"alsoKnownAs\":[\"did:ssb:ed25519:lOUVT-Phkvai9a_cCS_RKo-S9hnPAQdVixms_7ldpPA\",\"did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc\"]}", 24 | "contentMetadata": { 25 | "versionId": "%CdDGtStGYtoPVQAlhMwebMMohagJfIfZVregZD3xKFo=.sha256", 26 | "created": "2021-07-24T03:38:45Z", 27 | "updated": "2021-07-24T04:09:03Z" 28 | } 29 | } 30 | }, 31 | { 32 | "function": "dereference", 33 | "input": { 34 | "didUrl": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU?versionId=%25Vlo6kAc%2BIbGGBhD2MUi2r3ULz%2FNAGBWwGb%2FEMa4w4FI%3D.sha256", 35 | "dereferenceOptions": {} 36 | }, 37 | "output": { 38 | "dereferencingMetadata": { 39 | "contentType": "application/did+ld+json" 40 | }, 41 | "contentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU\",\"controller\":\"did:key:z6Mko4u4GMcQu12BjNqBWbZdVFJ2fiGLKfcrxiZV8u3gmBCG\"}", 42 | "contentMetadata": { 43 | "versionId": "%Vlo6kAc+IbGGBhD2MUi2r3ULz/NAGBWwGb/EMa4w4FI=.sha256", 44 | "nextVersionId": "%CdDGtStGYtoPVQAlhMwebMMohagJfIfZVregZD3xKFo=.sha256", 45 | "nextUpdate": "2021-07-24T04:09:03Z", 46 | "created": "2021-07-24T03:38:45Z", 47 | "updated": "2021-07-24T04:05:23Z" 48 | } 49 | } 50 | }, 51 | { 52 | "function": "dereference", 53 | "input": { 54 | "didUrl": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU?versionTime=2021-07-24T03:38:46Z", 55 | "dereferenceOptions": {} 56 | }, 57 | "output": { 58 | "dereferencingMetadata": { 59 | "contentType": "application/did+ld+json" 60 | }, 61 | "contentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU\"}", 62 | "contentMetadata": { 63 | "versionId": "%dT3InSxC/BNRqbC/aN01+ubmjxp/ETHPbFcRb3hODG0=.sha256", 64 | "nextVersionId": "%Vlo6kAc+IbGGBhD2MUi2r3ULz/NAGBWwGb/EMa4w4FI=.sha256", 65 | "nextUpdate": "2021-07-24T04:05:23Z", 66 | "created": "2021-07-24T03:38:45Z" 67 | } 68 | } 69 | } 70 | ] 71 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/dereferencer-web-transmute.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "https://github.com/OR13/deno-did-pm", 3 | "implementer": "Transmute", 4 | "didMethod": "did:web", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1 ], 7 | "invalidDidUrlErrorOutcome": [ ], 8 | "notFoundErrorOutcome": [ ] 9 | }, 10 | "executions": [ 11 | { 12 | "function": "dereference", 13 | "input": { 14 | "didUrl": "did:web:or13.github.io:deno-did-pm?service=github&relativeRef=%2FOR13%2Fdeno-did-pm%2Fmaster%2Fdocs%2Fexample-mod%2Fmod.ts", 15 | "dereferenceOptions": { 16 | "accept": "application/typescript" 17 | } 18 | }, 19 | "output": { 20 | "dereferencingMetadata": { 21 | "contentType": "application/typescript; charset=utf-8" 22 | }, 23 | "contentStream": "// DENO DID PM Module as:\n// http://localhost:8000/did-modules/did:web:or13.github.io:deno-did-pm?service=github&relativeRef=/OR13/deno-did-pm/master/docs/example-mod/mod.ts\n// GitHub URL as:\n// https://raw.githubusercontent.com/OR13/deno-did-pm/master/docs/example-mod/mod.ts\n\nexport const sayHello = () => {\n console.info(\"hello\");\n};", 24 | "contentMetadata": {} 25 | } 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-ebsi.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:ebsi", 3 | "implementation": "EBSI libraries and APIs", 4 | "implementer": "EBSI", 5 | "supportedContentTypes": ["application/did+ld+json", "application/did+json"], 6 | "dids": ["did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m"], 7 | "didParameters": {}, 8 | "did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m": { 9 | "didDocumentDataModel": { 10 | "properties": { 11 | "id": "did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m", 12 | "verificationMethod": [ 13 | { 14 | "id": "did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1", 15 | "type": "Secp256k1VerificationKey2018", 16 | "controller": "did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m", 17 | "publicKeyJwk": { 18 | "kty": "EC", 19 | "crv": "secp256k1", 20 | "x": "Ou6y1zrJBeVnpV739kcTyez7RmQZFYg3F9bWGm6V5dQ", 21 | "y": "jOq6B8CsOxoXj-WXAGY28PH0Ype1x6bnOB6_YOo3lK0" 22 | } 23 | } 24 | ], 25 | "authentication": ["did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1"], 26 | "assertionMethod": ["did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1"] 27 | } 28 | }, 29 | "application/did+json": { 30 | "didDocumentDataModel": { 31 | "representationSpecificEntries": {} 32 | }, 33 | "representation": "{\"id\":\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m\",\"verificationMethod\":[{\"id\":\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1\",\"type\":\"Secp256k1VerificationKey2018\",\"controller\":\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m\",\"publicKeyJwk\":{\"kty\":\"EC\",\"crv\":\"secp256k1\",\"x\":\"Ou6y1zrJBeVnpV739kcTyez7RmQZFYg3F9bWGm6V5dQ\",\"y\":\"jOq6B8CsOxoXj-WXAGY28PH0Ype1x6bnOB6_YOo3lK0\"}}],\"authentication\":[\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1\"],\"assertionMethod\":[\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1\"]}", 34 | "didDocumentMetadata": {}, 35 | "didResolutionMetadata": { 36 | "contentType": "application/did+json" 37 | } 38 | }, 39 | "application/did+ld+json": { 40 | "didDocumentDataModel": { 41 | "representationSpecificEntries": { 42 | "@context": "https://www.w3.org/ns/did/v1" 43 | } 44 | }, 45 | "representation": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m\",\"verificationMethod\":[{\"id\":\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1\",\"type\":\"Secp256k1VerificationKey2018\",\"controller\":\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m\",\"publicKeyJwk\":{\"kty\":\"EC\",\"crv\":\"secp256k1\",\"x\":\"Ou6y1zrJBeVnpV739kcTyez7RmQZFYg3F9bWGm6V5dQ\",\"y\":\"jOq6B8CsOxoXj-WXAGY28PH0Ype1x6bnOB6_YOo3lK0\"}}],\"authentication\":[\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1\"],\"assertionMethod\":[\"did:ebsi:znHeZWvhAK2FK2Dk1jXNe7m#keys-1\"]}", 46 | "didDocumentMetadata": {}, 47 | "didResolutionMetadata": { 48 | "contentType": "application/did+ld+json" 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-jnctn.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:jnctn", 3 | "implementation": "DID JNCTN Test Suite", 4 | "implementer": "JNCTN Limited", 5 | "supportedContentTypes": [ 6 | "application/did+json" 7 | ], 8 | "dids": [ 9 | "did:jnctn:187c4af8932a444a9e9503fb96cb672f" 10 | ], 11 | "didParameters": {}, 12 | "did:jnctn:187c4af8932a444a9e9503fb96cb672f": { 13 | "didDocumentDataModel": { 14 | "properties": { 15 | "id": "did:jnctn:187c4af8932a444a9e9503fb96cb672f", 16 | "verificationMethod": [ 17 | { 18 | "id": "did:jnctn:187c4af8932a444a9e9503fb96cb672f#key-0", 19 | "controller": "did:jnctn:70a40d1680b648ae8c77959a6a28d365", 20 | "type": "Ed25519VerificationKey2020", 21 | "publicKeyMultibase": "m82ogFXXXP/V17+8muZyd6h0sH4Q6SiTBCUl3/VatWAE" 22 | } 23 | ], 24 | "assertionMethod": [ 25 | "#key-0" 26 | ] 27 | } 28 | }, 29 | "application/did+json": { 30 | "didDocumentDataModel": { 31 | "representationSpecificEntries": {} 32 | }, 33 | "representation": "{\"verificationMethod\":[{\"id\":\"did:jnctn:187c4af8932a444a9e9503fb96cb672f#key-0\",\"type\":\"Ed25519VerificationKey2020\",\"controller\":\"did:jnctn:70a40d1680b648ae8c77959a6a28d365\",\"publicKeyMultibase\":\"m82ogFXXXP/V17+8muZyd6h0sH4Q6SiTBCUl3/VatWAE\"}],\"assertionMethod\":[\"#key-0\"],\"id\":\"did:jnctn:187c4af8932a444a9e9503fb96cb672f\"}", 34 | "didDocumentMetadata": { 35 | "created": "2021-06-26T10:20:18.187Z" 36 | }, 37 | "didResolutionMetadata": { 38 | "retrieved": "2021-06-26T10:20:20.137Z", 39 | "contentType": "application/did+json", 40 | "sequence": 0, 41 | "proof": { 42 | "type": "Ed25519VerificationKey2020", 43 | "publicKeyMultibase": "m82ogFXXXP/V17+8muZyd6h0sH4Q6SiTBCUl3/VatWAE" 44 | }, 45 | "duration": 6 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-monid.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:monid", 3 | "implementation": "did-method-monid (2021 lx tech)", 4 | "implementer": "Min Ju", 5 | "supportedContentTypes": ["application/did+ld+json"], 6 | "dids": [ 7 | "did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2" 8 | ], 9 | "didParameters": {}, 10 | "did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2": { 11 | "didDocumentDataModel": { 12 | "properties": { 13 | "id": "did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2", 14 | "verificationMethod": [ 15 | { 16 | "id": "did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2#keys-1", 17 | "type": "Secp256k1VerificationKey2018", 18 | "controller": "did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2", 19 | "publicKeyHex": "0298a5f231fc9224ca466bdbd0b27cb34d27939d0e8aa4b65ba4ef1ed805f14975" 20 | } 21 | ], 22 | "authentication": ["#keys-1"], 23 | "assertionMethod": ["#keys-1"], 24 | "capabilityInvocation": ["#keys-1"], 25 | "capabilityDelegation": ["#keys-1"], 26 | "keyAgreement": ["#keys-1"] 27 | } 28 | }, 29 | "application/did+ld+json": { 30 | "didDocumentDataModel": { 31 | "representationSpecificEntries": { 32 | "@context": [ 33 | "https://www.w3.org/ns/did/v1" 34 | ] 35 | } 36 | }, 37 | "representation": "{\"@context\":[\"https://www.w3.org/ns/did/v1\"],\"id\":\"did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2\",\"verificationMethod\":[{\"id\":\"did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2#keys-1\",\"type\":\"Secp256k1VerificationKey2018\",\"controller\":\"did:monid:1fb352353ff51248c5104b407f9c04c3666627fcf5a167d693c9fc84b75964e2\",\"publicKeyHex\":\"0298a5f231fc9224ca466bdbd0b27cb34d27939d0e8aa4b65ba4ef1ed805f14975\"}],\"authentication\":[\"#keys-1\"],\"assertionMethod\":[\"#keys-1\"],\"capabilityDelegation\":[\"#keys-1\"],\"capabilityInvocation\":[\"#keys-1\"],\"keyAgreement\":[\"#keys-1\"]}", 38 | "didDocumentMetadata": {}, 39 | "didResolutionMetadata": { 40 | "contentType": "application/did+ld+json" 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-nft-2021-3box-labs.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:nft", 3 | "implementation": "@ceramicnetwork/nft-did-resolver", 4 | "implementer": "3Box Labs", 5 | "supportedContentTypes": [ 6 | "application/did+ld+json", 7 | "application/did+json" 8 | ], 9 | "dids": ["did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2"], 10 | "didParameters": { 11 | "versionTime": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2?versionTime=2021-03-16T10:09:21Z" 12 | }, 13 | "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2": { 14 | "didDocumentDataModel": { 15 | "properties": { 16 | "id": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 17 | "controller": "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH", 18 | "verificationMethod": [ 19 | { 20 | "id": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner", 21 | "type": "BlockchainVerificationMethod2021", 22 | "controller": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 23 | "blockchainAccountId": "0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1" 24 | } 25 | ] 26 | } 27 | }, 28 | "application/did+json": { 29 | "didDocumentDataModel": { 30 | "representationSpecificEntries": { 31 | } 32 | }, 33 | "representation": "{\"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"controller\": \"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\", \"verificationMethod\":[{ \"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner\", \"type\":\"BlockchainVerificationMethod2021\", \"controller\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"blockchainAccountId\":\"0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1\"}]}", 34 | "didResolutionMetadata":{ 35 | "contentType":"application/did+json" 36 | }, 37 | "didDocumentMetadata":{ } 38 | }, 39 | "application/did+ld+json": { 40 | "didDocumentDataModel":{ 41 | "representationSpecificEntries": { 42 | "@context": "https://www.w3.org/ns/did/v1" 43 | } 44 | }, 45 | "representation": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"controller\": \"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\", \"verificationMethod\":[{ \"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner\", \"type\":\"BlockchainVerificationMethod2021\", \"controller\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"blockchainAccountId\":\"0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1\"}]}", 46 | "didResolutionMetadata":{ 47 | "contentType":"application/did+ld+json" 48 | }, 49 | "didDocumentMetadata":{ } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-polygon-ayanworks.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:polygon", 3 | "implementation": "https://github.com/ayanworks/polygon-did-registrar", 4 | "implementer": "Ayanworks", 5 | "supportedContentTypes": [ 6 | "application/did+json" 7 | ], 8 | "dids": ["did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E"], 9 | "didParameters": {}, 10 | "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E": { 11 | "didDocumentDataModel": { 12 | "properties": { 13 | "@context": "https://w3id.org/did/v1", 14 | "id": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 15 | "verificationMethod": [{ 16 | "id": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 17 | "type": "EcdsaSecp256k1VerificationKey2019", 18 | "controller": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 19 | "publicKeyBase58": "7Lnm1evgNdC3VNWRea5kMHqMWKDNzTbFjPLV4rtCbPHjDP29xQu58dgS5DRk9kaVzbFxFkbeWVEt5hAd5TPmXx6AHYHDw" 20 | }] 21 | } 22 | }, 23 | "application/did+json": { 24 | "didDocumentDataModel": { 25 | "representationSpecificEntries": {} 26 | }, 27 | "representation": "{\n\t\"@context\": \"https://w3id.org/did/v1\",\n\t\"id\": \"did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E\",\n\t\"verificationMethod\": [{\n\t\t\"id\": \"did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E\",\n\t\t\"type\": \"EcdsaSecp256k1VerificationKey2019\",\n\t\t\"controller\": \"did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E\",\n\t\t\"publicKeyBase58\": \"7Lnm1evgNdC3VNWRea5kMHqMWKDNzTbFjPLV4rtCbPHjDP29xQu58dgS5DRk9kaVzbFxFkbeWVEt5hAd5TPmXx6AHYHDw\"\n\t}]\n}", 28 | "didDocumentMetadata": {}, 29 | "didResolutionMetadata": { 30 | "contentType": "application/did+json" 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:schema", 3 | "implementation": "@51nodes/decentralized-schema-registry", 4 | "implementer": "51nodes GmbH", 5 | "supportedContentTypes": [ 6 | "application/did+json", 7 | "application/did+ld+json" 8 | ], 9 | "dids": [ 10 | "did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5" 11 | ], 12 | "didParameters": {}, 13 | "did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5": { 14 | "didDocumentDataModel": { 15 | "properties": { 16 | "id": "did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5", 17 | "service": [ 18 | { 19 | "id": "did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5#get", 20 | "type": "GetSchemaService", 21 | "serviceEndpoint": "https://ipfs.infura.io/ipfs/QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5" 22 | } 23 | ] 24 | } 25 | }, 26 | "application/did+json": { 27 | "didDocumentDataModel": { 28 | "representationSpecificEntries": { 29 | } 30 | }, 31 | "representation": "{\"id\":\"did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5\",\"service\":[{\"id\":\"did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5#get\",\"type\":\"GetSchemaService\",\"serviceEndpoint\":\"https://ipfs.infura.io/ipfs/QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5\"}]}", 32 | "didDocumentMetadata": {}, 33 | "didResolutionMetadata": { 34 | "contentType": "application/did+json" 35 | } 36 | }, 37 | "application/did+ld+json": { 38 | "didDocumentDataModel": { 39 | "representationSpecificEntries": { 40 | "@context": "https://www.w3.org/ns/did/v1" 41 | } 42 | }, 43 | "representation": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5\",\"service\":[{\"id\":\"did:schema:public-ipfs:xsd:QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5#get\",\"type\":\"GetSchemaService\",\"serviceEndpoint\":\"https://ipfs.infura.io/ipfs/QmUQAxKQ5sbWWrcBZzwkThktfUGZvuPQyTrqMzb3mZnLE5\"}]}", 44 | "didResolutionMetadata": { 45 | "contentType": "application/did+ld+json" 46 | }, 47 | "didDocumentMetadata": {} 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-ssb.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:ssb", 3 | "implementation": "ssb-did-resolver", 4 | "implementer": "Secure Scuttlebutt Consortium", 5 | "supportedContentTypes": [ 6 | "application/did+ld+json" 7 | ], 8 | "dids": [ 9 | "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU" 10 | ], 11 | "didParameters": { 12 | "versionId": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU?versionId=%25Vlo6kAc%2BIbGGBhD2MUi2r3ULz%2FNAGBWwGb%2FEMa4w4FI%3D.sha256", 13 | "versionTime": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU?versionTime=2021-07-24T03:38:46Z" 14 | }, 15 | "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU": { 16 | "didDocumentDataModel": { 17 | "properties": { 18 | "id": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU", 19 | "controller": "did:key:z6Mko4u4GMcQu12BjNqBWbZdVFJ2fiGLKfcrxiZV8u3gmBCG", 20 | "alsoKnownAs": [ 21 | "did:ssb:ed25519:lOUVT-Phkvai9a_cCS_RKo-S9hnPAQdVixms_7ldpPA", 22 | "did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc" 23 | ] 24 | } 25 | }, 26 | "application/did+ld+json": { 27 | "didDocumentDataModel": { 28 | "representationSpecificEntries": { 29 | "@context": "https://www.w3.org/ns/did/v1" 30 | } 31 | }, 32 | "representation": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU\",\"controller\":\"did:key:z6Mko4u4GMcQu12BjNqBWbZdVFJ2fiGLKfcrxiZV8u3gmBCG\",\"alsoKnownAs\":[\"did:ssb:ed25519:lOUVT-Phkvai9a_cCS_RKo-S9hnPAQdVixms_7ldpPA\",\"did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc\"]}", 33 | "didDocumentMetadata": { 34 | "versionId": "%CdDGtStGYtoPVQAlhMwebMMohagJfIfZVregZD3xKFo=.sha256", 35 | "created": "2021-07-24T03:38:45Z", 36 | "updated": "2021-07-24T04:09:03Z" 37 | }, 38 | "didResolutionMetadata": { 39 | "contentType": "application/did+ld+json" 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-vaa.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:vaa", 3 | "implementation": "DID VAA Test Suite", 4 | "implementer": "CAICT", 5 | "supportedContentTypes": [ 6 | "application/did+ld+json" 7 | ], 8 | "dids": [ 9 | "did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ" 10 | ], 11 | "didParameters": {}, 12 | "did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ": { 13 | "didDocumentDataModel": { 14 | "properties": { 15 | "id": "did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ", 16 | "created": "2020-11-25T18:23:33.019Z", 17 | "controller": ["did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ"], 18 | "publicKey": [ 19 | { 20 | "id": "did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ#key1", 21 | "type": "RsaVerificationKey2018", 22 | "controller": ["did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ"], 23 | "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDb/A4iQ0Lq6NU9Q3i91vbqZ8jh\nUj/Hr64683e9NvNkFBeFePp7wfuZJRSTMrllP5LEQwXPmeZzQBJjKkY34iQV7EXA\nARKMisvqUR/ucU1mj7ZCiFM+MNCcxn+eD1WfBsXMYfne/BPJPhIUfjjIzBaTQuhI\ntLhGD6WrDv6fovK/GQIDAQAB\n-----END PUBLIC KEY-----\n" 24 | } 25 | ], 26 | "service": [ 27 | { 28 | "id": "did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ#resolver", 29 | "type": "DIDResolve", 30 | "serviceEndpoint": "https://www.citln.cn" 31 | } 32 | ], 33 | "proof": { 34 | "created": "2020-11-25T18:23:33.019Z", 35 | "signatureValue": "Tov28noNERDLNfvY1QHnS4zUYXJjLy1oiXXYb533wkq77rfdzy77/vRfBKVAt7iNY1GjpL5tytZpmPjYFLDFwz6SOdlsuCrKTM8sIGLybRS12EOWZl7PAfdYPwknpG4aK7Zmvc7u9ORN9o+YLTK3rP9H4GyJpYWUScy3S3YZU6A=", 36 | "type": "RsaSignature2018", 37 | "verificationMethod": "did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ#key1" 38 | }, 39 | "updated": "2020-11-25T18:23:33.019Z" 40 | } 41 | }, 42 | "application/did+ld+json": { 43 | "didDocumentDataModel": { 44 | "representationSpecificEntries": { 45 | "@context": [ 46 | "https://www.w3.org/ns/did/v1" 47 | ] 48 | } 49 | }, 50 | "representation": "{\"@context\":[\"https://www.w3.org/ns/did/v1\"],\"id\":\"did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ\",\"controller\":[\"did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ\"],\"publicKey\":[{\"id\":\"did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ#key1\",\"type\":\"RsaVerificationKey2018\",\"controller\":[\"did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ\"],\"publicKeyPem\":\"-----BEGIN PUBLIC KEY-----\\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDb/A4iQ0Lq6NU9Q3i91vbqZ8jh\\nUj/Hr64683e9NvNkFBeFePp7wfuZJRSTMrllP5LEQwXPmeZzQBJjKkY34iQV7EXA\\nARKMisvqUR/ucU1mj7ZCiFM+MNCcxn+eD1WfBsXMYfne/BPJPhIUfjjIzBaTQuhI\\ntLhGD6WrDv6fovK/GQIDAQAB\\n-----END PUBLIC KEY-----\\n\"}],\"created\":\"2020-11-25T18:23:33.019Z\",\"updated\":\"2020-11-25T18:23:33.019Z\",\"proof\":{\"type\":\"RsaSignature2018\",\"created\":\"2020-11-25T18:23:33.019Z\",\"verificationMethod\":\"did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ#key1\",\"signatureValue\":\"Tov28noNERDLNfvY1QHnS4zUYXJjLy1oiXXYb533wkq77rfdzy77/vRfBKVAt7iNY1GjpL5tytZpmPjYFLDFwz6SOdlsuCrKTM8sIGLybRS12EOWZl7PAfdYPwknpG4aK7Zmvc7u9ORN9o+YLTK3rP9H4GyJpYWUScy3S3YZU6A=\"},\"service\":[{\"id\":\"did:vaa:2H9XwzRXZ1o5ZwSoYDEZn24eHXcQ#resolver\",\"type\":\"DIDResolve\",\"serviceEndpoint\":\"https://www.citln.cn\"}]}", 51 | "didDocumentMetadata": { 52 | }, 53 | "didResolutionMetadata": { 54 | "contentType": "application/did+ld+json" 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/did-web-evernym.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:web", 3 | "implementation": "Evernym DID infrastructure", 4 | "implementer": "Evernym", 5 | "supportedContentTypes": [ 6 | "application/did+ld+json" 7 | ], 8 | "dids": [ 9 | "did:web:evernym.com" 10 | ], 11 | "didParameters": {}, 12 | "did:web:evernym.com": { 13 | "didDocumentDataModel": { 14 | "properties": { 15 | "alsoKnownAs": [ 16 | "http://www.respectnetwork.com/" 17 | ], 18 | "controller": "did:key:z6MksvuoUimiLz49o5AF3MpFMhWW2PMEuQF8MYuDFHXWkeJz", 19 | "id": "did:web:evernym.com" 20 | } 21 | }, 22 | "application/did+ld+json": { 23 | "didDocumentDataModel": { 24 | "representationSpecificEntries": { 25 | "@context": "https://www.w3.org/ns/did/v1" 26 | } 27 | }, 28 | "representation": "{ \"@context\": \"https://www.w3.org/ns/did/v1\", \"alsoKnownAs\": [ \"http://www.respectnetwork.com/\" ], \"controller\": \"did:key:z6MksvuoUimiLz49o5AF3MpFMhWW2PMEuQF8MYuDFHXWkeJz\", \"id\": \"did:web:evernym.com\" }", 29 | "didDocumentMetadata": {}, 30 | "didResolutionMetadata": { 31 | "contentType": "application/did+ld+json" 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/resolver-nft-3box-labs.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "@ceramicnetwork/nft-did-resolver", 3 | "implementer": "3Box Labs", 4 | "didMethod": "did:nft", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 0, 1, 2 ], 7 | "invalidDidErrorOutcome": [ ], 8 | "notFoundErrorOutcome": [ ], 9 | "representationNotSupportedErrorOutcome": [ ], 10 | "deactivatedOutcome": [ ] 11 | }, 12 | "executions": [ 13 | { 14 | "function": "resolve", 15 | "input": { 16 | "did": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 17 | "resolutionOptions": { 18 | } 19 | }, 20 | "output": { 21 | "didResolutionMetadata":{ 22 | }, 23 | "didDocument":{ 24 | "id": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 25 | "controller": "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH", 26 | "verificationMethod": [ 27 | { 28 | "id": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner", 29 | "type": "BlockchainVerificationMethod2021", 30 | "controller": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 31 | "blockchainAccountId": "0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1" 32 | } 33 | ] 34 | }, 35 | "didDocumentMetadata":{ 36 | } 37 | } 38 | }, 39 | { 40 | "function": "resolveRepresentation", 41 | "input": { 42 | "did": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 43 | "resolutionOptions": { 44 | "accept": "application/did+json" 45 | } 46 | }, 47 | "output": { 48 | "didResolutionMetadata": { 49 | "contentType": "application/did+json" 50 | }, 51 | "didDocumentStream": "{\"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"controller\": \"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\", \"verificationMethod\":[{ \"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner\", \"type\":\"BlockchainVerificationMethod2021\", \"controller\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"blockchainAccountId\":\"0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1\"}]}", 52 | "didDocumentMetadata": { 53 | } 54 | } 55 | }, 56 | { 57 | "function": "resolveRepresentation", 58 | "input": { 59 | "did": "did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2", 60 | "resolutionOptions": { 61 | "accept": "application/did+ld+json" 62 | } 63 | }, 64 | "output": { 65 | "didResolutionMetadata": { 66 | "contentType": "application/did+ld+json" 67 | }, 68 | "didDocumentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"controller\": \"did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH\", \"verificationMethod\":[{ \"id\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2#owner\", \"type\":\"BlockchainVerificationMethod2021\", \"controller\":\"did:nft:eip155.1_erc721.0xb300a43751601bd54ffee7de35929537b28e1488_2\", \"blockchainAccountId\":\"0x06eb48572a2ef9a3b230d69ca731330793b65bdc@eip155:1\"}]}", 69 | "didDocumentMetadata": { 70 | } 71 | } 72 | } 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/resolver-polygon-ayanworks.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "https://github.com/ayanworks/polygon-did-resolver", 3 | "implementer": "Ayanworks", 4 | "didMethod": "did:polygon", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [0, 1], 7 | "invalidDidErrorOutcome": [], 8 | "notFoundErrorOutcome": [], 9 | "representationNotSupportedErrorOutcome": [], 10 | "deactivatedOutcome": [] 11 | }, 12 | "executions": [{ 13 | "function": "resolveDid", 14 | "input": { 15 | "did": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 16 | "resolutionOptions": {} 17 | }, 18 | "output": { 19 | "didResolutionMetadata": { 20 | }, 21 | "didDocument": { 22 | "@context": "https://w3id.org/did/v1", 23 | "id": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 24 | "verificationMethod": [{ 25 | "id": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 26 | "type": "EcdsaSecp256k1VerificationKey2019", 27 | "controller": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 28 | "publicKeyBase58": "7Lnm1evgNdC3VNWRea5kMHqMWKDNzTbFjPLV4rtCbPHjDP29xQu58dgS5DRk9kaVzbFxFkbeWVEt5hAd5TPmXx6AHYHDw" 29 | }] 30 | }, 31 | "didDocumentMetadata": {} 32 | } 33 | }, { 34 | "function": "resolveRepresentation", 35 | "input": { 36 | "did": "did:polygon:0xBCFdE12C425E4CbDb45226Fe51F89F2d99667d3E", 37 | "resolutionOptions": {} 38 | }, 39 | "output": { 40 | "didResolutionMetadata": { 41 | "contentType": "" 42 | }, 43 | "didDocumentMetadata": {}, 44 | "didDocumentStream": "" 45 | } 46 | }] 47 | } 48 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/resolver-spruce-pkh.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:pkh", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-pkh", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1 9 | ] 10 | }, 11 | "executions": [ 12 | { 13 | "function": "resolve", 14 | "input": { 15 | "did": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L", 16 | "resolutionOptions": {} 17 | }, 18 | "output": { 19 | "didDocument": { 20 | "@context": [ 21 | "https://www.w3.org/ns/did/v1", 22 | { 23 | "EcdsaSecp256k1RecoveryMethod2020": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoveryMethod2020", 24 | "blockchainAccountId": "https://w3id.org/security#blockchainAccountId" 25 | } 26 | ], 27 | "id": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L", 28 | "verificationMethod": [ 29 | { 30 | "id": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId", 31 | "type": "EcdsaSecp256k1RecoveryMethod2020", 32 | "controller": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L", 33 | "blockchainAccountId": "DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L@bip122:1a91e3dace36e2be3bf030a65679fe82" 34 | } 35 | ], 36 | "authentication": [ 37 | "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId" 38 | ], 39 | "assertionMethod": [ 40 | "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId" 41 | ] 42 | }, 43 | "didResolutionMetadata": {}, 44 | "didDocumentMetadata": {} 45 | } 46 | }, 47 | { 48 | "function": "resolveRepresentation", 49 | "input": { 50 | "did": "did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L", 51 | "resolutionOptions": {} 52 | }, 53 | "output": { 54 | "didDocumentStream": "{\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\",\n {\n \"EcdsaSecp256k1RecoveryMethod2020\": \"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoveryMethod2020\",\n \"blockchainAccountId\": \"https://w3id.org/security#blockchainAccountId\"\n }\n ],\n \"id\": \"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L\",\n \"verificationMethod\": [\n {\n \"id\": \"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\",\n \"type\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"controller\": \"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L\",\n \"blockchainAccountId\": \"DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L@bip122:1a91e3dace36e2be3bf030a65679fe82\"\n }\n ],\n \"authentication\": [\n \"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\"\n ],\n \"assertionMethod\": [\n \"did:pkh:doge:DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L#blockchainAccountId\"\n ]\n}", 55 | "didResolutionMetadata": { 56 | "contentType": "application/did+ld+json" 57 | }, 58 | "didDocumentMetadata": {} 59 | } 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/resolver-spruce-web.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:web", 3 | "implementation": "https://github.com/spruceid/ssi/tree/main/did-web", 4 | "implementer": "Spruce Systems, Inc.", 5 | "expectedOutcomes": { 6 | "notFoundErrorOutcome": [ 7 | 1 8 | ], 9 | "defaultOutcome": [ 10 | 0, 11 | 2 12 | ] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolve", 17 | "input": { 18 | "did": "did:web:identity.foundation", 19 | "resolutionOptions": {} 20 | }, 21 | "output": { 22 | "didDocument": { 23 | "@context": [ 24 | "https://www.w3.org/ns/did/v1" 25 | ], 26 | "id": "did:web:identity.foundation" 27 | }, 28 | "didResolutionMetadata": {}, 29 | "didDocumentMetadata": {} 30 | } 31 | }, 32 | { 33 | "function": "resolve", 34 | "input": { 35 | "did": "did:web:did.actor:nonexistent", 36 | "resolutionOptions": {} 37 | }, 38 | "output": { 39 | "didDocument": null, 40 | "didResolutionMetadata": { 41 | "error": "notFound" 42 | }, 43 | "didDocumentMetadata": {} 44 | } 45 | }, 46 | { 47 | "function": "resolveRepresentation", 48 | "input": { 49 | "did": "did:web:identity.foundation", 50 | "resolutionOptions": {} 51 | }, 52 | "output": { 53 | "didDocumentStream": "{\n \"@context\": [\"https://www.w3.org/ns/did/v1\"],\n \"id\": \"did:web:identity.foundation\"\n}\n", 54 | "didResolutionMetadata": { 55 | "contentType": "application/did+ld+json" 56 | }, 57 | "didDocumentMetadata": {} 58 | } 59 | } 60 | ] 61 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/resolver-ssb.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:ssb", 3 | "implementation": "ssb-did-resolver", 4 | "implementer": "Secure Scuttlebutt Consortium", 5 | "expectedOutcomes": { 6 | "defaultOutcome": [ 7 | 0, 8 | 1, 9 | 2 10 | ] 11 | }, 12 | "executions": [ 13 | { 14 | "function": "resolve", 15 | "input": { 16 | "did": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU", 17 | "resolutionOptions": {} 18 | }, 19 | "output": { 20 | "didResolutionMetadata": {}, 21 | "didDocument": { 22 | "@context": "https://www.w3.org/ns/did/v1", 23 | "id": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU", 24 | "controller": "did:key:z6Mko4u4GMcQu12BjNqBWbZdVFJ2fiGLKfcrxiZV8u3gmBCG", 25 | "alsoKnownAs": [ 26 | "did:ssb:ed25519:lOUVT-Phkvai9a_cCS_RKo-S9hnPAQdVixms_7ldpPA", 27 | "did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc" 28 | ] 29 | }, 30 | "didDocumentMetadata": { 31 | "versionId": "%CdDGtStGYtoPVQAlhMwebMMohagJfIfZVregZD3xKFo=.sha256", 32 | "created": "2021-07-24T03:38:45Z", 33 | "updated": "2021-07-24T04:09:03Z" 34 | } 35 | } 36 | }, 37 | { 38 | "function": "resolveRepresentation", 39 | "input": { 40 | "did": "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU", 41 | "resolutionOptions": {} 42 | }, 43 | "output": { 44 | "didResolutionMetadata": { 45 | "contentType": "application/did+ld+json" 46 | }, 47 | "didDocumentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"id\":\"did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU\",\"controller\":\"did:key:z6Mko4u4GMcQu12BjNqBWbZdVFJ2fiGLKfcrxiZV8u3gmBCG\",\"alsoKnownAs\":[\"did:ssb:ed25519:lOUVT-Phkvai9a_cCS_RKo-S9hnPAQdVixms_7ldpPA\",\"did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc\"]}", 48 | "didDocumentMetadata": { 49 | "versionId": "%CdDGtStGYtoPVQAlhMwebMMohagJfIfZVregZD3xKFo=.sha256", 50 | "created": "2021-07-24T03:38:45Z", 51 | "updated": "2021-07-24T04:09:03Z" 52 | } 53 | } 54 | }, 55 | { 56 | "function": "resolve", 57 | "input": { 58 | "did": "did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc", 59 | "resolutionOptions": {} 60 | }, 61 | "output": { 62 | "didResolutionMetadata": {}, 63 | "didDocument": { 64 | "@context": "https://www.w3.org/ns/did/v1", 65 | "id": "did:ssb:ed25519:6RpN4Ztw3jLwzQtHl8XpnnR58LWZTAjwq2vvfyx7zkc", 66 | "controller": "did:key:z6Mkv9CJWMeyBNaS2BdHHXuwKiSfxi2H3eimi4dpck5PTmXU", 67 | "alsoKnownAs": [ 68 | "did:ssb:ed25519:f_6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU", 69 | "did:ssb:ed25519:lOUVT-Phkvai9a_cCS_RKo-S9hnPAQdVixms_7ldpPA" 70 | ] 71 | }, 72 | "didDocumentMetadata": { 73 | "versionId": "%uvhFPHlfyxBcLxFgatjvolI0pcWEeH2Q4PIOHz48v2A=.sha256", 74 | "created": "2021-07-24T04:23:02Z" 75 | } 76 | } 77 | } 78 | ] 79 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-algo.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:algo", 3 | "implementation": "DID implementation build on top of the Algorand Blockchain and IPFS", 4 | "implementer": "AID:Tech and Algorand Foundation", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:algo:f30304e2-e702-4f47-b242-2e9e064f6eef", 19 | "resolutionOptions": { 20 | "accept": "application/json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "algo", 29 | "methodSpecificId": "f30304e2-e702-4f47-b242-2e9e064f6eef" 30 | }, 31 | "didUrlString": "f30304e2-e702-4f47-b242-2e9e064f6eef", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "https://did-agent.aidtech.network/v1/retrieve/algo/$1", 38 | "duration": 5379, 39 | "identifier": "f30304e2-e702-4f47-b242-2e9e064f6eef" 40 | }, 41 | "didDocumentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",\"https://w3id.org/security/v1\"],\"id\":\"did:algo:f30304e2-e702-4f47-b242-2e9e064f6eef\",\"created\":\"2021-10-20T03:19:33Z\",\"updated\":\"2021-10-20T04:07:55Z\",\"verificationMethod\":[{\"id\":\"did:algo:f30304e2-e702-4f47-b242-2e9e064f6eef#master\",\"type\":\"Ed25519VerificationKey2018\",\"controller\":\"did:algo:f30304e2-e702-4f47-b242-2e9e064f6eef\",\"publicKeyMultibase\":\"zCh9PDTZzeWxk2WdH4M1e8k2951D5D11jz7Uti9HRBGiK\"}],\"authentication\":[\"did:algo:f30304e2-e702-4f47-b242-2e9e064f6eef#master\"],\"service\":[{\"id\":\"did:algo:f30304e2-e702-4f47-b242-2e9e064f6eef#algo-connect\",\"type\":\"did.algorand.foundation.ExternalService\",\"serviceEndpoint\":\"https://did.algorand.foundation\",\"extensions\":[{\"id\":\"algo-address\",\"version\":\"0.1.0\",\"data\":[{\"address\":\"GZAURFQR7VRUL2TRVMUJ3G3IGFYSFXBWHBFFQBEITXWDLFVVHTICFNY2LE\",\"asset\":\"ALGO\",\"network\":\"testnet\"}]}]}]}", 42 | "didDocumentMetadata": {} 43 | } 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-art.json: -------------------------------------------------------------------------------- 1 | { 2 | "didMethod": "did:art", 3 | "implementation": "ArtracID DID Method", 4 | "implementer": "ART GROUP LIMITED ARTRACX.COM", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c", 19 | "resolutionOptions": { 20 | "accept": "application/json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "art", 29 | "methodSpecificId": "f045c5c7d50145b65ca2702c38b4e2d46658293c" 30 | }, 31 | "didUrlString": "f045c5c7d50145b65ca2702c38b4e2d46658293c", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "https://did.artrac.id/$1", 38 | "duration": 5379, 39 | "identifier": "f045c5c7d50145b65ca2702c38b4e2d46658293c" 40 | }, 41 | "didDocumentStream": "{ \"@context\": [ \"https://www.w3.org/ns/did/v1\", \"https://w3c-ccg.github.io/ld-cryptosuite-registry/#ecdsasecp256k1signature2019\" ], \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\", \"verificationMethod\": [ { \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\", \"type\": \"EcdsaSecp256k1VerificationKey2019\", \"controller\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\", \"publicKeyMultibase\": \"fef2823c7d237bd094d633a1765d5896b0f442481a997da2f83d7a928ddce7e65\", \"blockchainAccountId\":\"enq:f045c5c7d50145b65ca2702c38b4e2d46658293c\" } ], \"authentication\": [ \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\" ], \"assertionMethod\": [ \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#masterkey\" ], \"service\": [ { \"id\": \"did:art:enq:f045c5c7d50145b65ca2702c38b4e2d46658293c#service\", \"type\": \"LinkedDomains\", \"serviceEndpoint\": \"https://did.artrac.id\" } ] }", 42 | "didDocumentMetadata": {} 43 | } 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-evan.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:evan", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "evan", 29 | "methodSpecificId": "testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734" 30 | }, 31 | "didUrlString": "did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://evan-did-driver:8080/1.0/identifiers/", 38 | "duration": 911, 39 | "identifier": "did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734", 40 | "pattern": "^(did:evan:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"authentication\":[\"did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734#key-1\"],\"id\":\"did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734\",\"publicKey\":[{\"id\":\"did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734#key-1\",\"publicKeyHex\":\"045adfd502c0bc55f4fcb90eea36368d7e19c5b3045aa6f51dfa3699046e9751251d21bc6bdd06c1ff0014fcbbf9f1d83c714434f2b33d713aaf46760f2d53f10d\",\"type\":[\"Secp256k1SignatureVerificationKey2018\",\"ERC725ManagementKey\"]}],\"service\":[{\"id\":\"did:evan:testcore:0x126E901F6F408f5E260d95c62E7c73D9B60fd734#randomService\",\"serviceEndpoint\":\"https://openid.example.com/770853367\",\"type\":\"randomService-770853367\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-gatc.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:gatc", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "gatc", 29 | "methodSpecificId": "2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7" 30 | }, 31 | "didUrlString": "did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://gataca-did-resolver-driver:8080/1.0/identifiers/", 38 | "duration": 1225, 39 | "identifier": "did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7", 40 | "pattern": "^(did:gatc:.+)$" 41 | }, 42 | "didDocumentStream": "{\"authentication\":[\"did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7#keys-1\"],\"id\":\"did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7\",\"publicKey\":[{\"controller\":\"did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7\",\"id\":\"did:gatc:2xtSori9UQZdTqzxrkp7zqKM4Kj5B4C7#keys-1\",\"publicKeyBase58\":\"B3FBGKFoQtR9zMkTWggev3wHCWueB292Hjui33a67Ysy\",\"type\":\"Ed25519VerificationKey2018\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-hcr.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:hcr", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "hcr", 29 | "methodSpecificId": "0f674e7e-4b49-4898-85f6-96176c1e30de" 30 | }, 31 | "didUrlString": "did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://hacera-did-driver:8080/1.0/identifiers/", 38 | "duration": 991, 39 | "identifier": "did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de", 40 | "pattern": "^(did:hcr:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"authentication\":[{\"publicKey\":\"did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de#ident-key\",\"type\":\"Ed25519SignatureAuthentication2018\"}],\"created\":\"2019-03-03T05:55:26.903077Z\",\"id\":\"did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de\",\"publicKey\":[{\"controller\":\"did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de\",\"id\":\"did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de#ident-key\",\"type\":\"Ed25519VerificationKey2018\"}],\"service\":[{\"id\":\"did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de;social-linkedin\",\"serviceEndpoint\":\"https://linkedin.com/in/levitate\",\"type\":\"SocialLinkService\"},{\"id\":\"did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de;social-unbounded\",\"serviceEndpoint\":\"https://unbounded.network/people/jonathan.levi\",\"type\":\"SocialLinkService\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-icon.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:icon", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:icon:02:6f7a00a29deb82cb36d501d687c18bad79a8f1c154ef0c78", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "icon", 29 | "methodSpecificId": "02:6f7a00a29deb82cb36d501d687c18bad79a8f1c154ef0c78" 30 | }, 31 | "didUrlString": "did:icon:02:6f7a00a29deb82cb36d501d687c18bad79a8f1c154ef0c78", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://driver-did-icon:8080/1.0/identifiers/", 38 | "duration": 1021, 39 | "identifier": "did:icon:02:6f7a00a29deb82cb36d501d687c18bad79a8f1c154ef0c78", 40 | "pattern": "^(did:icon:02:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://www.w3.org/2019/did/v1\",\"authentication\":[{\"publicKey\":[\"MyIdEventVerifier\"]}],\"id\":\"did:icon:02:6f7a00a29deb82cb36d501d687c18bad79a8f1c154ef0c78\",\"publicKey\":[{\"created\":10787133,\"id\":\"MyIdEventVerifier\",\"publicKeyBase64\":\"BNCLnQY+kM6dnIiTWjy+X4IDt5MOGwNofzDCxqVO6ylSLFDTWXJ7iv18GyeJW+L2fCmSqkUIifUuaG23OP0GneU=\",\"revoked\":0,\"type\":\"Secp256k1VerificationKey\"}],\"service\":[]}", 43 | "didDocumentMetadata": { 44 | "nodeUrl": "https://test-ctz.solidwallet.io/api/v3", 45 | "scoreAddress": "cx8b19bdb4e1ad3e10b599d8887dd256e02995f340", 46 | "service": { 47 | "id": "ZZEUNG", 48 | "serviceEndpoint": "https://zzeung.id/#/" 49 | } 50 | } 51 | } 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-io.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:io", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:io:0x476c81C27036D05cB5ebfe30ae58C23351a61C4A", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "io", 29 | "methodSpecificId": "0x476c81C27036D05cB5ebfe30ae58C23351a61C4A" 30 | }, 31 | "didUrlString": "did:io:0x476c81C27036D05cB5ebfe30ae58C23351a61C4A", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://uni-resolver-driver-did-io:8080/1.0/identifiers/", 38 | "duration": 625, 39 | "identifier": "did:io:0x476c81C27036D05cB5ebfe30ae58C23351a61C4A", 40 | "pattern": "^(did:io:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://www.w3.org/ns/did/v1\",\"authentication\":[{\"controller\":\"did:io:0x476c81C27036D05cB5ebfe30ae58C23351a61C4A\",\"id\":\"did:io:0x476c81C27036D05cB5ebfe30ae58C23351a61C4A#owner\",\"publicKeyHex\":\"0355237d4af6afc7f139e396329d56a4d1235c94abde9a25782241774c06cccfb6\",\"type\":\"EcdsaSecp256k1VerificationKey2019\"}],\"id\":\"did:io:0x476c81C27036D05cB5ebfe30ae58C23351a61C4A\",\"proof\":{}}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-ion.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:ion", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:ion:EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "ion", 29 | "methodSpecificId": "EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w" 30 | }, 31 | "didUrlString": "did:ion:EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://driver-did-ion:8080/1.0/identifiers/", 38 | "duration": 913, 39 | "identifier": "did:ion:EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w", 40 | "pattern": "^(did:ion:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":[\"https://www.w3.org/ns/did/v1\",{\"@base\":\"did:ion:EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w\"}],\"authentication\":[\"#someKeyId\"],\"id\":\"did:ion:EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w\",\"service\":[{\"id\":\"#linkedin\",\"serviceEndpoint\":\"linkedin.com/in/henry-tsai-6b884014\",\"type\":\"linkedin\"},{\"id\":\"#github\",\"serviceEndpoint\":\"github.com/thehenrytsai\",\"type\":\"github\"}],\"verificationMethod\":[{\"controller\":\"\",\"id\":\"#someKeyId\",\"publicKeyJwk\":{\"crv\":\"secp256k1\",\"kty\":\"EC\",\"x\":\"WfY7Px6AgH6x-_dgAoRbg8weYRJA36ON-gQiFnETrqw\",\"y\":\"IzFx3BUGztK0cyDStiunXbrZYYTtKbOUzx16SUK0sAY\"},\"type\":\"EcdsaSecp256k1VerificationKey2019\"}]}", 43 | "didDocumentMetadata": { 44 | "canonicalId": "did:ion:EiClkZMDxPKqC9c-umQfTkR8vvZ9JPhl_xLDI9Nfk38w5w", 45 | "method": { 46 | "published": true, 47 | "recoveryCommitment": "EiDKYXZ2MkHRCYDVtXI7ONiTkTdVfs9Tnb-tDDHGXLzmOw", 48 | "updateCommitment": "EiDNk40DUvxCef8_BinU5DDIAhNWE4e7Ea9Q6P7GAbJ6VA" 49 | } 50 | } 51 | } 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-kilt.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:kilt", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "kilt", 29 | "methodSpecificId": "5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx" 30 | }, 31 | "didUrlString": "did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://kilt-did-driver:8080/1.0/identifiers/", 38 | "duration": 638, 39 | "identifier": "did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx", 40 | "pattern": "^(did:kilt:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"authentication\":[{\"publicKey\":[\"did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx#key-1\"],\"type\":\"Ed25519SignatureAuthentication2018\"}],\"id\":\"did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx\",\"publicKey\":[{\"controller\":\"did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx\",\"id\":\"did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx#key-1\",\"publicKeyHex\":\"0x2203a7731f1e4362cb21ff3ef7ce79204e1891fc62c4657040753283a00300d8\",\"type\":\"Ed25519VerificationKey2018\"},{\"controller\":\"did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx\",\"id\":\"did:kilt:5CqJa4Ct7oMeMESzehTiN9fwYdGLd7tqeirRMpGDh2XxYYyx#key-2\",\"publicKeyHex\":\"0xd0a90ed3b87db1ab599bd3cc0c8e0dc7ffcf2347299a6d494567a14f06861952\",\"type\":\"X25519Salsa20Poly1305Key2018\"}],\"service\":[{\"serviceEndpoint\":\"https://services.kilt.io:443/messaging\",\"type\":\"KiltMessagingService\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-nacl.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:nacl", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "nacl", 29 | "methodSpecificId": "Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI" 30 | }, 31 | "didUrlString": "did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://uni-resolver-driver-did-uport:8081/1.0/identifiers/", 38 | "duration": 1745, 39 | "identifier": "did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI", 40 | "pattern": "^(did:nacl:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"authentication\":[{\"publicKey\":\"did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI#key1\",\"type\":\"ED25519SigningAuthentication\"}],\"id\":\"did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI\",\"publicKey\":[{\"id\":\"did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI#key1\",\"owner\":\"did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI\",\"publicKeyBase64\":\"Md8JiMIwsapml/FtQ2ngnGftNP5UmVCAUuhnLyAsPxI=\",\"type\":\"ED25519SignatureVerification\"},{\"id\":\"did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI#key2\",\"owner\":\"did:nacl:Md8JiMIwsapml_FtQ2ngnGftNP5UmVCAUuhnLyAsPxI\",\"publicKeyBase64\":\"OAsnUyuUBISGsOherdxO6rgzUeGe9SnffDXQk6KpkAY=\",\"type\":\"Curve25519EncryptionPublicKey\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-ont.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:ont", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "ont", 29 | "methodSpecificId": "AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH" 30 | }, 31 | "didUrlString": "did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://ontid-driver:8080/1.0/identifiers/", 38 | "duration": 382, 39 | "identifier": "did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH", 40 | "pattern": "^(did:ont:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"authentication\":[\"did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH#keys-1\"],\"controller\":\"\",\"id\":\"did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH\",\"publicKey\":[{\"controller\":\"did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH\",\"id\":\"did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH#keys-1\",\"publicKeyHex\":\"023b041dfc2d00a9846d291dd4bad3f32b8c13a6ad8dc2e97fd711888ed7818c66\",\"type\":\"EcdsaSecp256r1VerificationKey2019\"}],\"recovery\":\"\"}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-sol.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:sol", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "sol", 29 | "methodSpecificId": "ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa" 30 | }, 31 | "didUrlString": "did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://driver-did-sol:8080/1.0/identifiers/", 38 | "duration": 809, 39 | "identifier": "did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa", 40 | "pattern": "^(did:sol:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":[\"https://w3id.org/did/v1.0\",\"https://w3id.org/sol/v1\"],\"assertionMethod\":[],\"authentication\":[],\"capabilityDelegation\":[],\"capabilityInvocation\":[\"did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa#default\"],\"id\":\"did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa\",\"keyAgreement\":[],\"publicKey\":[{\"controller\":\"did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa\",\"id\":\"did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa#default\",\"publicKeyBase58\":\"aAnWKawD4wwWgzhCDUsW7xmxm7KeQo3dFBaedKDBFE1\",\"type\":\"Ed25519VerificationKey2018\"}],\"service\":[],\"verificationMethod\":[{\"controller\":\"did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa\",\"id\":\"did:sol:ygGfLvAyuRymPNv2fJDK1ZMpdy59m8cV5dak6A8uHKa#default\",\"publicKeyBase58\":\"aAnWKawD4wwWgzhCDUsW7xmxm7KeQo3dFBaedKDBFE1\",\"type\":\"Ed25519VerificationKey2018\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-stack.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:stack", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "stack", 29 | "methodSpecificId": "v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0" 30 | }, 31 | "didUrlString": "did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://driver-did-stack:8080/1.0/identifiers/", 38 | "duration": 3377, 39 | "identifier": "did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0", 40 | "pattern": "^(did:stack:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://www.w3.org/2019/did/v1\",\"id\":\"did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0\",\"publicKey\":[{\"id\":\"did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0\",\"publicKeyHex\":\"040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0\",\"type\":\"Secp256k1VerificationKey2018\"}],\"service\":[{\"serviceEndpoint\":\"https://core.blockstack.org\",\"type\":\"blockstack\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-unisot.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:unisot", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:unisot:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "unisot", 29 | "methodSpecificId": "test:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4" 30 | }, 31 | "didUrlString": "did:unisot:test:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://unisot-did-driver:8080/1.0/identifiers/", 38 | "duration": 1608, 39 | "identifier": "did:unisot:test:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4", 40 | "pattern": "^(did:unisot:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"authentication\":[\"did:unisot:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4#key1\"],\"id\":\"did:unisot:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4\",\"publicKey\":[{\"controller\":\"did:unisot:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4\",\"id\":\"did:unisot:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4#key1\",\"publicKeyBase58\":\"KmtFiGC5VCbvM3Hk3ibeZxBN5ZDu8cDRR3QRakRaMqxMUUxK7FKx7TSxYLBJ5WNEntFzNTPdNHVssMfDUE3NJo2971\",\"type\":\"EcdsaSecp256k1VerificationKey2019\"}],\"service\":[{\"id\":\"did:unisot:n1aAmTXAg4o44Z9k8YCQncEY91r3TV7WU4#service\",\"serviceEndpoint\":\"https://service.example.com/vc\",\"type\":\"VerifiableCredentialService\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-vaa.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:vaa", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "vaa", 29 | "methodSpecificId": "3wJVWDQWtDFx27FqvSqyo5xsTsxC" 30 | }, 31 | "didUrlString": "did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://driver-did-vaa:8080/1.0/identifiers/", 38 | "duration": 1104, 39 | "identifier": "did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC", 40 | "pattern": "^(did:vaa:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://w3id.org/did/v1\",\"id\":\"did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC\",\"publicKey\":[{\"id\":\"did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC#key1\",\"publicKeyPem\":\"-----BEGIN PUBLIC KEY-----\\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDb/A4iQ0Lq6NU9Q3i91vbqZ8jh\\nUj/Hr64683e9NvNkFBeFePp7wfuZJRSTMrllP5LEQwXPmeZzQBJjKkY34iQV7EXA\\nARKMisvqUR/ucU1mj7ZCiFM+MNCcxn+eD1WfBsXMYfne/BPJPhIUfjjIzBaTQuhI\\ntLhGD6WrDv6fovK/GQIDAQAB\\n-----END PUBLIC KEY-----\\n\",\"type\":\"RsaVerificationKey2018\"}],\"service\":[{\"id\":\"did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC#resolver\",\"serviceEndpoint\":\"https://www.citln.cn\",\"type\":\"DIDResolve\"}]}", 43 | "didDocumentMetadata": { 44 | "created": "2020-11-25T18:23:33Z", 45 | "proof": { 46 | "created": "2020-11-25T18:23:33Z", 47 | "signatureValue": "Tov28noNERDLNfvY1QHnS4zUYXJjLy1oiXXYb533wkq77rfdzy77/vRfBKVAt7iNY1GjpL5tytZpmPjYFLDFwz6SOdlsuCrKTM8sIGLybRS12EOWZl7PAfdYPwknpG4aK7Zmvc7u9ORN9o+YLTK3rP9H4GyJpYWUScy3S3YZU6A=", 48 | "type": "RsaSignature2018", 49 | "verificationMethod": "did:vaa:3wJVWDQWtDFx27FqvSqyo5xsTsxC#key1" 50 | }, 51 | "updated": "2020-11-25T18:23:33Z" 52 | } 53 | } 54 | } 55 | ] 56 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-did-work.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation": "Universal Resolver", 3 | "implementer": "Decentralized Identity Foundation and Contributors", 4 | "didMethod": "did:work", 5 | "expectedOutcomes": { 6 | "defaultOutcomes": [ 7 | 0 8 | ], 9 | "invalidDidErrorOutcome": [], 10 | "notFoundErrorOutcome": [], 11 | "representationNotSupportedErrorOutcome": [], 12 | "deactivatedOutcome": [] 13 | }, 14 | "executions": [ 15 | { 16 | "function": "resolveRepresentation", 17 | "input": { 18 | "did": "did:work:2UUHQCd4psvkPLZGnWY33L", 19 | "resolutionOptions": { 20 | "accept": "application/did+ld+json" 21 | } 22 | }, 23 | "output": { 24 | "didResolutionMetadata": { 25 | "contentType": "application/did+ld+json", 26 | "didUrl": { 27 | "did": { 28 | "method": "work", 29 | "methodSpecificId": "2UUHQCd4psvkPLZGnWY33L" 30 | }, 31 | "didUrlString": "did:work:2UUHQCd4psvkPLZGnWY33L", 32 | "fragment": null, 33 | "parameters": {}, 34 | "path": "", 35 | "query": null 36 | }, 37 | "driverUrl": "http://work-did-driver:8080/1.0/identifiers/", 38 | "duration": 1786, 39 | "identifier": "did:work:2UUHQCd4psvkPLZGnWY33L", 40 | "pattern": "^(did:work:.+)$" 41 | }, 42 | "didDocumentStream": "{\"@context\":\"https://www.w3.org/2019/did/v1\",\"id\":\"did:work:2UUHQCd4psvkPLZGnWY33L\",\"publicKey\":[{\"controller\":\"did:work:4PUfQhXdyRY4LLNkKUs16S\",\"id\":\"did:work:2UUHQCd4psvkPLZGnWY33L#key-1\",\"publicKeyBase58\":\"oatUtA5A97kQ7mWYK8qHkVFvJKtnhRdBZPSwuC3dADw\",\"type\":\"Ed25519VerificationKey2018\"}],\"service\":[{\"serviceEndpoint\":\"did:work:8RcWPSBtB4QwfC68yneDxC;id=860285e2-183d-4fe3-9767-babc744396b8;version=1.0\",\"type\":\"schema\"}]}", 43 | "didDocumentMetadata": {} 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/implementations/universal-resolver-identifier-tests.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementation" : "Universal Resolver", 3 | "implementer" : "Decentralized Identity Foundation and Contributors", 4 | "didMethod" : "did:sov", 5 | "dids" : [ "did:sov:WRfXPg8dantKVubE3HX8pw" ], 6 | "didParameters" : { 7 | "service" : "did:sov:WRfXPg8dantKVubE3HX8pw?service=files&relativeRef=%2Fmyresume%2Fdoc%3Fversion%3Dlatest%23intro", 8 | "relativeRef" : "did:sov:WRfXPg8dantKVubE3HX8pw?service=files&relativeRef=%2Fmyresume%2Fdoc%3Fversion%3Dlatest%23intro", 9 | "hl" : "did:sov:WRfXPg8dantKVubE3HX8pw?hl=zQmWvQxTqbG2Z9HPJgG57jjwR154cKhbtJenbyYTWkjgF3e", 10 | "versionId" : "did:sov:WRfXPg8dantKVubE3HX8pw?versionId=4", 11 | "versionTime" : "did:sov:WRfXPg8dantKVubE3HX8pw?versionTime=2016-10-17T02:41:00Z" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/resolution-utils.js: -------------------------------------------------------------------------------- 1 | const findExpectedOutcome = ((expectedOutcomes, i) => { 2 | const expectedOutcomesArray = []; 3 | Object.keys(expectedOutcomes).forEach((expectedOutcome) => { 4 | expectedOutcomes[expectedOutcome].forEach((expectedOutcomeIndex) => { 5 | expectedOutcomesArray[expectedOutcomeIndex] = expectedOutcome; 6 | }); 7 | }); 8 | return expectedOutcomesArray[i]; 9 | }); 10 | 11 | const isErrorExpectedOutcome = ((expectedOutcome) => { 12 | return expectedOutcome.endsWith('ErrorOutcome'); 13 | }); 14 | 15 | const findExecutionByDid = ((implementation, did) => { 16 | implementation.executions.forEach((execution) => { 17 | if (execution.input.did == did) { 18 | return execution; 19 | } 20 | }); 21 | }); 22 | 23 | const findExecutionByDidUrl = ((implementation, didUrl) => { 24 | var found; 25 | implementation.executions.forEach((execution) => { 26 | if (execution.input.didUrl === didUrl) { 27 | found = execution; 28 | return; 29 | } 30 | }); 31 | return found; 32 | }); 33 | 34 | const parseDidMethod = (did) => { 35 | var res = did.split(":"); 36 | return res[1]; 37 | }; 38 | 39 | const produceRepresentation = (didDocument, contentType) => { 40 | // TODO: improve this by re-using other test code 41 | if (contentType.startsWith('application/did+json') || 42 | contentType.startsWith('application/did+ld+json')) { 43 | return JSON.stringify(didDocument); 44 | } else if (contentType.startsWith('application/did+cbor')) { 45 | return '00'; 46 | } 47 | }; 48 | 49 | const consumeRepresentation = (representation, contentType) => { 50 | // TODO: improve this by re-using other test code 51 | if (contentType.startsWith('application/did+ld+json')) { 52 | let didDocument = JSON.parse(representation); 53 | expect(Object.keys(didDocument)).toContain('@context'); 54 | return didDocument; 55 | } else if (contentType.startsWith('application/did+json')) { 56 | let didDocument = JSON.parse(representation); 57 | return didDocument; 58 | } else if (contentType.startsWith('application/did+cbor')) { 59 | expect(parseInt('0x' + representation)).not.toBeNaN(); 60 | let didDocument = { 'id': 'did:ex:123' }; 61 | return didDocument; 62 | } 63 | }; 64 | 65 | const expectConformantDidDocument = ((didDocument) => { 66 | // TODO: improve this by re-using other test code 67 | expect(didDocument).toBeInfraMap(); 68 | expect(Object.keys(didDocument)).toContain('id'); 69 | }); 70 | 71 | const expectConformantDidDocumentRepresentation = ((didDocumentStream, contentType) => { 72 | // TODO: improve this by re-using other test code 73 | const didDocument = consumeRepresentation(didDocumentStream, contentType); 74 | expect(didDocument).not.toBeFalsy(); 75 | expectConformantDidDocument(didDocument); 76 | }); 77 | 78 | const expectConformantMetadataStructure = ((metaDataStructure) => { 79 | // TODO: improve this by re-using other test code 80 | expect(metaDataStructure).toBeInfraMap(); 81 | }); 82 | 83 | module.exports = { 84 | findExpectedOutcome, 85 | isErrorExpectedOutcome, 86 | findExecutionByDid, 87 | findExecutionByDidUrl, 88 | parseDidMethod, 89 | produceRepresentation, 90 | consumeRepresentation, 91 | expectConformantDidDocument, 92 | expectConformantDidDocumentRepresentation, 93 | expectConformantMetadataStructure 94 | }; 95 | -------------------------------------------------------------------------------- /packages/did-core-test-server/suites/suite-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "did-core-suites", 3 | 4 | suites: [ 5 | { 6 | suite_name: "did-core-properties" 7 | }, 8 | { 9 | suite_name: "did-identifier" 10 | }, 11 | { 12 | suite_name: "did-production" 13 | }, 14 | { 15 | suite_name: "did-resolution" 16 | }, 17 | { 18 | suite_name: "did-url-dereferencing" 19 | } 20 | ] 21 | }; 22 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/README.md: -------------------------------------------------------------------------------- 1 | # Additional Jest Matchers for Decentralized Identifier specs 2 | 3 | This package helps write tests for Decentralized Identifier (DID). 4 | Developed based on the structure of [jest/community/jest-extended](https://github.com/jest-community/jest-extended) package. 5 | 6 | To use this package, run `npm run prepare` for preparing runtime JavaScripts in `./dist` directory. 7 | You can also prepare by running `npm run prepare` at the top level of `did-test-suite`. 8 | 9 | ## Currently Implemented Matchers and Predicates 10 | 11 | - JavaScript and common types 12 | - toBeAsciiString / isAsciiString 13 | - Generic Web related 14 | - toBeValidUrl / isValidUrl 15 | - toBeValidUri / isValidUri 16 | - INFRA specific tests 17 | - toBeInfraMap / isInfraMap 18 | - toBeInfraString / isInfraString 19 | - DID Core specific tests 20 | - toBeValidDid / isValidDid 21 | - toBeValidDidUrl / isValidDidUrl 22 | - toBeDidCoreDatetime / isDidCoreDatetime 23 | - toBeDidDocumentMap / isDidDocumentMap 24 | - toBeDidDocumentPropertyValueType / isDidDocumentPropertyValueType 25 | - Various encoding formats 26 | - toBeBase58String / isBase58String 27 | 28 | ## Targets 29 | 30 | Since the package relys on Babel, it require build. 31 | If you changed part of the code, build and commit the result in `./dist` 32 | 33 | For the test of this package itself, run `npm test` 34 | 35 | ## Reference from did-core-test-server 36 | 37 | `../did-core-test-server/package.json` contains filesytem relative reference to this package. 38 | 39 | ## Predicates design policy 40 | 41 | Since this is a matcher for testing, all of the predicates are stricter than standard definition. 42 | The following is the list of design choices made. 43 | 44 | - Following predicates check whether the target is string or not, to not allow `NaN` or `undefined` as a value 45 | - toBeAsciiString 46 | - toBeBase58String 47 | - toBeValidUri 48 | - toBeValidUri: not allowing empty URI 49 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jest-did-matcher", 3 | "version": "0.0.1", 4 | "description": "Jest matchers for Decentralized Identity (DID)", 5 | "main": "dist/index.js", 6 | "files": [ 7 | "dist", 8 | "README.md" 9 | ], 10 | "scripts": { 11 | "build": "babel src -d dist --ignore *.test.js", 12 | "prepare": "babel src -d dist --ignore *.test.js", 13 | "test": "jest" 14 | }, 15 | "keywords": [ 16 | "jest", 17 | "matchers", 18 | "did" 19 | ], 20 | "author": "Shigeya Suzuki", 21 | "license": "", 22 | "devDependencies": { 23 | "babel-cli": "^6.18.0", 24 | "babel-core": "^6.26.0", 25 | "babel-jest": "^26.6.3", 26 | "babel-jest-assertions": "^0.1.0", 27 | "babel-plugin-transform-async-to-generator": "^6.24.1", 28 | "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", 29 | "babel-plugin-transform-object-rest-spread": "^6.26.0", 30 | "import-all.macro": "^2.0.3", 31 | "jest": "^23.0.1", 32 | "jest-each": "^0.5.0", 33 | "jest-watch-typeahead": "^0.2.0" 34 | }, 35 | "dependencies": { 36 | "expect": "^26.6.2", 37 | "jest-get-type": "^26.3.0", 38 | "jest-matcher-utils": "^26.6.2" 39 | }, 40 | "babel": { 41 | "plugins": [ 42 | "babel-plugin-transform-es2015-modules-commonjs", 43 | "transform-object-rest-spread", 44 | "transform-async-to-generator", 45 | "macros" 46 | ] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/index.js: -------------------------------------------------------------------------------- 1 | import matchers from './matchers'; 2 | 3 | const jestExpect = global.expect; 4 | 5 | if (jestExpect !== undefined) { 6 | jestExpect.extend(matchers); 7 | } else { 8 | /* eslint-disable no-console */ 9 | console.error( 10 | "Unable to find Jest's global expect." + 11 | '\nPlease check you have added jest-did-matcher correctly to your jest configuration.' 12 | ); 13 | /* eslint-enable no-console */ 14 | } 15 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/index.js: -------------------------------------------------------------------------------- 1 | import importAll from 'import-all.macro'; 2 | 3 | const imports = importAll.sync('./*/index.js'); 4 | 5 | export default Object.keys(imports) 6 | .map(key => imports[key]) 7 | .reduce((acc, matcher) => ({ ...acc, ...matcher.default }), {}); 8 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeAsciiString/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeAsciiString', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of type INFRA string received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeAsciiString', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of type INFRA string, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeAsciiString: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isAsciiString: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeAsciiString/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeAsciiString', () => { 8 | test('passes when given a INFRA String', () => { 9 | for (let i = 0; i <= 0x1F; i++) { 10 | expect(String.fromCharCode(i)).toBeAsciiString(); 11 | } 12 | expect(' !"#$%&\'()*+,-./').toBeAsciiString(); 13 | expect('0123456789:;<=>?').toBeAsciiString(); 14 | expect('@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_').toBeAsciiString(); 15 | expect('`abcdefghijklmnopqrstuvwxyz{|}~\x7F').toBeAsciiString(); 16 | }); 17 | }); 18 | 19 | describe('.not.toBeAsciiString', () => { 20 | each([ 21 | [false], 22 | ["\x80"], 23 | ["\xFf"], 24 | [0], 25 | [{}], 26 | [[]], 27 | [() => {}], 28 | [undefined], 29 | [null], 30 | [NaN] 31 | ]).test('passes when not item is not of type INFRA String: %s', given => { 32 | expect(given).not.toBeAsciiString(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeAsciiString/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | if (! (typeof expected === 'string' || expected instanceof String) ) { 3 | return false; 4 | } 5 | return /^[\x00-\x7F]*$/.test(expected); 6 | }; 7 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeBase58String/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeBase58String', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of a Base58 string received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeBase58String', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of a Base58 string, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeBase58String: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isBase58String: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeBase58String/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeBase58String', () => { 8 | each([ 9 | ["98RNr73hGzPakwdrkjdk7BSn5Xd3ZbaVgJX122hqZAaMv19p"], 10 | ]).test('passes when given the item is Base58 String', given => { 11 | expect(given).toBeBase58String(); 12 | }); 13 | }); 14 | 15 | describe('.not.toBeBase58String', () => { 16 | each([ 17 | [false], 18 | [""], 19 | [0], 20 | [{}], 21 | [[]], 22 | [() => {}], 23 | [null], 24 | [undefined], 25 | [NaN] 26 | ]).test('passes when the item is not a Base58 String: %s', given => { 27 | expect(given).not.toBeBase58String(); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeBase58String/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | const base58Regex = /^[a-km-zA-HJ-NP-Z1-9]+$/; 3 | if (! (typeof expected === 'string' || expected instanceof String) ) { 4 | return false; 5 | } 6 | return base58Regex.test(expected); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidCoreDatetime/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeDidCoreDatetime', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of a valid DID Core Datetime received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeDidCoreDatetime', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of a valid DID Core Datetime, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeDidCoreDatetime: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isDidCoreDatetime: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidCoreDatetime/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeDidCoreDatetime', () => { 8 | each([ 9 | ["2021-03-18T09:30:10Z"], 10 | ["2020-12-20T19:17:47Z"], 11 | ["2021-02-28T09:30:10Z"], 12 | ]).test('passes when given the item is valid DID Core Datetime: %s', given => { 13 | expect(given).toBeDidCoreDatetime(); 14 | }); 15 | }); 16 | 17 | describe('.not.toBeDidCoreDatetime', () => { 18 | each([ 19 | [""], 20 | [false], 21 | [0], 22 | [{}], 23 | [[]], 24 | [() => {}], 25 | [null], 26 | [undefined], 27 | [NaN], 28 | ["2020-12-20T19:17:47.000Z"], 29 | ["2020-12-20T19:17:47.100Z"], 30 | ["2020-12-20T19:17:47+09:00"], 31 | ["2020-12-20T19:17:47+0900"], 32 | ["2020-12-20T19:17:47+09"], 33 | ["2020-12-20T19:17:47I"], 34 | ["2020-20-20T19:17:47Z"], 35 | ["2020-13-20T19:17:47Z"], 36 | ["2020-12-32T19:17:47Z"], 37 | ["2020-12-40T19:17:47Z"], 38 | ["2020-12-20T30:17:47Z"], 39 | ["2020-12-20T25:17:47Z"], 40 | ["2020-12-20T23:61:47Z"], 41 | ["2020-12-20T25:17:61Z"], 42 | ["2021-02-29T23:61:47Z"], 43 | ]).test('passes when the item is not a valid DID Core Datetime: %s', given => { 44 | expect(given).not.toBeDidCoreDatetime(); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidCoreDatetime/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | const regex = /[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]Z/; 3 | let valid = regex.test(expected); 4 | if (valid) { 5 | let milliseconds = Date.parse(expected); 6 | if (isNaN(milliseconds)) { 7 | valid = false; 8 | } 9 | else { 10 | // convert unix_time to ISO8601 string without sub-seconds. 11 | let d = new Date(milliseconds); 12 | let iso_date = d.toISOString(); 13 | let did_date = iso_date.replace('.000Z', 'Z'); // should be zero 14 | valid = did_date == expected; 15 | } 16 | } 17 | return valid; 18 | }; 19 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidDocumentMap/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import { predicate } from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeDidDocumentMap', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be a DID document map:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeDidDocumentMap', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of a DID document map:\n' + 14 | ` ${printExpected('A DID document map')}\n` + 15 | 'Received:\n' + 16 | ` ${printReceived(received)}`; 17 | 18 | export default { 19 | toBeDidDocumentMap: expected => { 20 | const pass = predicate(expected); 21 | if (pass) { 22 | return { pass: true, message: passMessage(expected) }; 23 | } 24 | 25 | return { pass: false, message: failMessage(expected) }; 26 | }, 27 | 28 | isDidDocumentMap: obj => { 29 | return predicate(obj); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidDocumentMap/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from '.'; 4 | 5 | expect.extend(matcher); 6 | 7 | 8 | describe('.toBeDidDocumentMap', () => { 9 | each([ 10 | [ 11 | { 12 | "a": "1" 13 | } 14 | ], 15 | [ 16 | { 17 | "b": [ "1", "2", "3" ] 18 | }, 19 | ], 20 | [ 21 | { 22 | "didDocumentMetadata": { 23 | "canonicalId":"x", 24 | "equivalentId":[ 25 | "x", 26 | "y" 27 | ], 28 | "method":{ 29 | "updateCommitment":"z", 30 | "recoveryCommitment":"t", 31 | "published":true 32 | } 33 | } 34 | }, 35 | ], 36 | [new Map(Object.entries({ a: "1", b: "2", c: {"x": "1", "y": "2"}}))], 37 | [new Set(["1", "2", "3", ["4", "5", "6"], {"x":"1", "y": "2"}])] 38 | ]).test('passes when item is a type allowed in a DID Document map: %s', given => { 39 | expect(given).toBeDidDocumentMap(); 40 | }); 41 | }); 42 | 43 | describe('.not.toBeDidDocumentMap', () => { 44 | each([ 45 | [{ "v" : 0 }], 46 | [{ "v" : undefined }], 47 | [{ "v" : NaN }], 48 | [{"didDocumentMetadata": { 49 | "canonicalId":NaN, 50 | "equivalentId":[ 51 | "x", 52 | "y" 53 | ], 54 | "method":{ 55 | "updateCommitment":"z", 56 | "recoveryCommitment":"t", 57 | "published":true 58 | } 59 | }}], 60 | [{"didDocumentMetadata": { 61 | "canonicalId":"i", 62 | "equivalentId":[ 63 | NaN, 64 | "y" 65 | ], 66 | "method":{ 67 | "updateCommitment":"z", 68 | "recoveryCommitment":"t", 69 | "published":true 70 | } 71 | }}], 72 | [new Map(Object.entries({ a: NaN, b: "2", c: {"x": "1", "y": "2"}}))], 73 | [new Map(Object.entries({ a: "1", b: "2", c: {"x": NaN, "y": "2"}}))], 74 | [new Map(Object.entries({ a: "1", b: undefined, c: {"x": "1", "y": "2"}}))], 75 | [new Map(Object.entries({ a: "1", b: "2", c: {"x": "1", "y": undefined}}))], 76 | [new Set(["1", "2", "3", ["4", NaN, "6"], {"x":"1", "y": "2"}])], 77 | [new Set(["1", "2", "3", ["4", "5", undefined], {"x":"1", "y": "2"}])], 78 | [new Set(["1", "2", "3", ["4", "5", "6"], {"x": undefined, "y": "2"}])], 79 | [new Set(["1", "2", "3", ["4", "5", "6"], {"x": "1", "y": undefined }])] 80 | ]).test('passes when item is not of type DID Document map: %s', given => { 81 | expect(given).not.toBeDidDocumentMap(); 82 | }); 83 | }); 84 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidDocumentMap/predicate.js: -------------------------------------------------------------------------------- 1 | // (DID document) property value MUST be a string, map, list, ordered set, boolean, or null. 2 | 3 | export function predicate(expected) { 4 | if (expected === null) { 5 | return true; 6 | } 7 | 8 | if (Array.isArray(expected)) { 9 | return expected.map(element => predicate(element)).reduce( (p, c) => (p && c), true); 10 | } 11 | 12 | if (expected instanceof Map || expected instanceof Set) { 13 | let r = true; 14 | expected.forEach(v => { r = r && predicate(v); }); 15 | return r; 16 | } 17 | 18 | if (typeof expected == "object") { 19 | return Object.keys(expected).map(key => predicate(expected[key])).reduce( (p, c) => (p && c), true); 20 | } 21 | 22 | switch (typeof expected) { 23 | case 'boolean': 24 | case 'string': 25 | return true; 26 | } 27 | 28 | if (expected instanceof String) { 29 | return true; 30 | } 31 | 32 | return false; 33 | } 34 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidDocumentPropertyValueType/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeDidDocumentPropertyValueType', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of type IFRA map received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeDidDocumentPropertyValueType', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of type allowed in DID Document, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeDidDocumentPropertyValueType: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isDidDocumentPropertyValueType: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidDocumentPropertyValueType/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeDidDocumentPropertyValueType', () => { 8 | each([ 9 | ["String"], 10 | [new String()], 11 | [{}], 12 | [{ a: "1", b: "2", c: {"x": "1", "y": "2"}}], 13 | [new Map()], 14 | [new Map(Object.entries({ a: "1", b: "2", c: {"x": "1", "y": "2"}}))], 15 | [[]], 16 | [new Array(1)], 17 | [new Set()], 18 | [new Set(["1", "2", "3", ["4", "5", "6"], {"x":"1", "y": "2"}])], 19 | [true], 20 | [false], 21 | [null] 22 | ]).test('passes when item is a type allowed in a DID Document map: %s', given => { 23 | expect(given).toBeDidDocumentPropertyValueType(); 24 | }); 25 | }); 26 | 27 | describe('.not.toBeDidDocumentPropertyValueType', () => { 28 | each([ 29 | [0], 30 | [undefined], 31 | [NaN] 32 | ]).test('passes when not item is not of type DID Document map: %s', given => { 33 | expect(given).not.toBeDidDocumentPropertyValueType(); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeDidDocumentPropertyValueType/predicate.js: -------------------------------------------------------------------------------- 1 | // (DID document) property value MUST be a string, map, list, ordered set, boolean, or null. 2 | export default expected => { 3 | if (expected === null) { 4 | return true; 5 | } 6 | 7 | if (Array.isArray(expected)) { // list 8 | return true; 9 | } 10 | 11 | if (expected instanceof Map || expected instanceof Set) { 12 | return true; 13 | } 14 | 15 | switch (typeof expected) { 16 | case 'object': // map and ordered set 17 | case 'boolean': 18 | case 'string': 19 | return true; 20 | } 21 | 22 | if (expected instanceof String) { 23 | return true; 24 | } 25 | 26 | return false; 27 | }; 28 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeInfraMap/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeInfraMap', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of type IFRA map received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeInfraMap', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of type INFRA map, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeInfraMap: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isInfraMap: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeInfraMap/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeInfraMap', () => { 8 | test('passes when given a INFRA map', () => { 9 | expect({}).toBeInfraMap(); 10 | }); 11 | }); 12 | 13 | describe('.not.toBeInfraMap', () => { 14 | each([ 15 | ["STRING"], 16 | [false], 17 | [0], 18 | [undefined], 19 | [null], 20 | [NaN] 21 | ]).test('passes when not item is not of type INFRA Map: %s', given => { 22 | expect(given).not.toBeInfraMap(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeInfraMap/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | return expected instanceof Object == true; 3 | }; 4 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeInfraString/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeInfraString', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of type INFRA string received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeInfraString', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of type INFRA string, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeInfraString: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isInfraString: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeInfraString/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeInfraString', () => { 8 | test('passes when given a INFRA String', () => { 9 | expect("").toBeInfraString(); 10 | expect("ABCDEFGHIJKLMNOPQRSTUVWXYZ").toBeInfraString(); 11 | expect("abcdefghijklmnopqrstuvwxyz").toBeInfraString(); 12 | }); 13 | }); 14 | 15 | describe('.not.toBeInfraString', () => { 16 | each([ 17 | [false], 18 | [0], 19 | [{}], 20 | [[]], 21 | [() => {}], 22 | [undefined], 23 | [null], 24 | [NaN] 25 | ]).test('passes when not item is not of type INFRA String: %s', given => { 26 | expect(given).not.toBeInfraString(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeInfraString/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | // Same as toBeString 3 | return typeof expected === 'string' || expected instanceof String; 4 | }; 5 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeMediaType/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeMediaType', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of a valid Media Type received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeMediaType', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of a valid Media Type, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeMediaType: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isMediaType: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeMediaType/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeMediaType', () => { 8 | each([ 9 | ["application/did+json"], 10 | ["application/did+ld+json"] 11 | ]).test('passes when given the item is valid Media Type: %s', given => { 12 | expect(given).toBeMediaType(); 13 | }); 14 | }); 15 | 16 | describe('.not.toBeMediaType', () => { 17 | each([ 18 | [""], 19 | [false], 20 | [0], 21 | [{}], 22 | [[]], 23 | [() => {}], 24 | [null], 25 | [undefined], 26 | [NaN] 27 | ]).test('passes when the item is not a valid Media Type: %s', given => { 28 | expect(given).not.toBeMediaType(); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeMediaType/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | const regex = /^\w+\/[-+.\w]+/ 3 | return regex.test(expected) 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeMultibaseString/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeMultibaseString', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be a Multibase string received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeMultibaseString', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be a Multibase string, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeMultibaseString: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isMultibaseString: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeMultibaseString/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeMultibaseString', () => { 8 | each([ 9 | ["z98RNr73hGzPakwdrkjdk7BSn5Xd3ZbaVgJX122hqZAaMv19p"], 10 | ]).test('passes when given the item is Multibase String', given => { 11 | expect(given).toBeMultibaseString(); 12 | }); 13 | }); 14 | 15 | describe('.not.toBeMultibaseString', () => { 16 | each([ 17 | [false], 18 | [""], 19 | ["JKJKJK"], 20 | ["5!@)"], 21 | [0], 22 | [{}], 23 | [[]], 24 | [() => {}], 25 | [null], 26 | [undefined], 27 | [NaN] 28 | ]).test('passes when the item is not a Multibase String: %s', given => { 29 | expect(given).not.toBeMultibaseString(); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeMultibaseString/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | const multibaseRegex = /^[079fFvVtTbBcChkKzZmMuUp].+$/; 3 | if (! (typeof expected === 'string' || expected instanceof String) ) { 4 | return false; 5 | } 6 | return multibaseRegex.test(expected); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidDid/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeValidDid', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of valid DID received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeValidDid', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of valid DID, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeValidDid: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isValidDid: string => { 27 | return predicate(expected); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidDid/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeValidDid', () => { 8 | each([ 9 | ["did:example:123"], 10 | ["did:example:123456789abcdefghi"], 11 | ["did:example:123456789-abcdefghi"], 12 | ["did:example:123456789_abcdefghi"], 13 | ["did:example:123456789%20abcdefghi"], 14 | ["did:example:123abc:123456789abcdefghi"], 15 | ["did:example:abc%00"], 16 | ["did:example::::::abc:::123"], 17 | ]).test('passes when the item is a valid DID: %s', given => { 18 | expect(given).toBeValidDid(); 19 | }); 20 | }); 21 | 22 | describe('.not.toBeValidDid', () => { 23 | each([ 24 | ["STRING"], 25 | [false], 26 | [0], 27 | [undefined], 28 | [null], 29 | [NaN], 30 | ["did:"], 31 | ["did:example"], 32 | ["did:example:123#ZC2jXTO6t4R501bfCXv3RxarZyUbdP2w_psLwMuY6ec"], 33 | ["did:example:123#keys-1"], 34 | ["did:example:abc:::"] 35 | ]).test('passes when the item is not a valid DID: %s', given => { 36 | expect(given).not.toBeValidDid(); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidDid/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | const didRegex1 = /^did:(?[a-z0-9]+):(?([a-zA-Z0-9.\-_]|%[0-9a-fA-F]{2}|:)+$)/; 3 | const didRegex2 = /:$/; 4 | return didRegex1.test(expected) && !didRegex2.test(expected); 5 | }; 6 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidDidUrl/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeValidDidUrl', 'received', '') + 6 | '\n\n' + 7 | 'Expected value not to be a valid DID URL received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeValidDidUrl', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be a valid DID URL, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeValidDidUrl: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isValidDidUrl: string => { 27 | return predicate(expected); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidDidUrl/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeValidDidUrl', () => { 8 | each([ 9 | ["did:example:123"], 10 | ["did:example:123456789abcdefghi"], 11 | ["did:example:123#ZC2jXTO6t4R501bfCXv3RxarZyUbdP2w_psLwMuY6ec"], 12 | ["did:example:123#keys-1"], 13 | ["did:example:123456/path"], 14 | ["did:example:123456/path/multiple/path"], 15 | ["did:example:123456/1path/2multiple/3path"], 16 | ["did:example:123456/1-path/2-multiple/3-path"], 17 | ["did:example:123456/path%20with%20space"], 18 | ["did:example:123456?versionId=1"], 19 | ["did:example:123#public-key-0"], 20 | ["did:example:123#sig_064bebcc"], 21 | ["did:example:123?service=agent&relativeRef=/credentials#degree"], 22 | ["did:example:abc:def-hij#klm"], 23 | ["did:orb:bafkreiazah4qrybzyapmrmk2dhldz24vfmavethcrgcoq7qhic63zz55ru:EiAag4cmgxAE2isL5HG3mxjS7WRq4l-xyyTgULCAcEHQQQ#nMef0L2qNWVe8yt97ap0vH7kQK2oFdm4zkQkYL7ymOo"] 24 | ]).test('passes when the item is a valid DID: %s', given => { 25 | expect(given).toBeValidDidUrl(); 26 | }); 27 | }); 28 | 29 | describe('.not.toBeValidDidUrl', () => { 30 | each([ 31 | ["STRING"], 32 | [false], 33 | [0], 34 | [undefined], 35 | [null], 36 | [NaN], 37 | ["did:"], 38 | ["did:example"] 39 | ]).test('passes when the item is not a valid DID: %s', given => { 40 | expect(given).not.toBeValidDidUrl(); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidDidUrl/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | const pchar = "[a-zA-Z0-9\\-\\._~]|%[0-9a-fA-F]{2}|[!$&'()*+,;=:@]"; 3 | const didUrl = 4 | "^" + 5 | "did:" + 6 | "([a-z0-9]+)" + // method_name 7 | "(:" + // method-specific-id 8 | "([a-zA-Z0-9\\.\\-_]|%[0-9a-fA-F]{2})+" + 9 | ")+" + 10 | "((/(" + pchar + ")+)+)?" + // path-abempty 11 | "(\\?(" + pchar + "|/|\\?)+)?" + // [ "?" query ] 12 | "(#(" + pchar + "|/|\\?)+)?" + // [ "#" fragment ] 13 | "$" 14 | ; 15 | return new RegExp(didUrl).test(expected); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidUri/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeValidUri', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of a valid Uri received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeValidUri', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of a valid URI, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeValidUri: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isValidUri: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidUri/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeValidUri', () => { 8 | each([ 9 | ["did:example:123"], 10 | ["did:example:123456789abcdefghi"] 11 | ]).test('passes when given the item is valid URI: %s', given => { 12 | expect(given).toBeValidUri(); 13 | }); 14 | }); 15 | 16 | describe('.not.toBeValidUri', () => { 17 | each([ 18 | [""], 19 | [false], 20 | [0], 21 | [{}], 22 | [[]], 23 | [() => {}], 24 | [null], 25 | [undefined], 26 | [NaN] 27 | ]).test('passes when the item is not a valid URI: %s', given => { 28 | expect(given).not.toBeValidUri(); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidUri/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | // URI Regex is from RFC3986 Appendix B 3 | const uriRegex = 4 | /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; 5 | 6 | if (! (typeof expected === 'string' || expected instanceof String) ) { 7 | return false; 8 | } 9 | if (expected == "") { 10 | return false; 11 | } 12 | return uriRegex.test(expected); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidUrl/index.js: -------------------------------------------------------------------------------- 1 | import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils'; 2 | import predicate from './predicate'; 3 | 4 | const passMessage = received => () => 5 | matcherHint('.not.toBeValidUrl', 'received', '') + 6 | '\n\n' + 7 | 'Expected value to not be of a valid URL received:\n' + 8 | ` ${printReceived(received)}`; 9 | 10 | const failMessage = received => () => 11 | matcherHint('.toBeValidUrl', 'received', '') + 12 | '\n\n' + 13 | 'Expected value to be of a valid URL, but received:\n' + 14 | ` ${printReceived(received)}`; 15 | 16 | export default { 17 | toBeValidUrl: expected => { 18 | const pass = predicate(expected); 19 | if (pass) { 20 | return { pass: true, message: passMessage(expected) }; 21 | } 22 | 23 | return { pass: false, message: failMessage(expected) }; 24 | }, 25 | 26 | isValidUrl: obj => { 27 | return predicate(obj); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidUrl/index.test.js: -------------------------------------------------------------------------------- 1 | import each from 'jest-each'; 2 | 3 | import matcher from './'; 4 | 5 | expect.extend(matcher); 6 | 7 | describe('.toBeValidUrl', () => { 8 | each([ 9 | ["http://www.w3.org/"], 10 | ["https://www.w3.org/"], 11 | ]).test('passes when given the item is valid URL: %s', given => { 12 | expect(given).toBeValidUrl(); 13 | }); 14 | }); 15 | 16 | describe('.not.toBeValidUrl', () => { 17 | each([ 18 | [false], 19 | [""], 20 | [0], 21 | [{}], 22 | [[]], 23 | [() => {}], 24 | [null], 25 | [undefined], 26 | [NaN] 27 | ]).test('passes when the item is not a valid URL: %s', given => { 28 | expect(given).not.toBeValidUrl(); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /packages/jest-did-matcher/src/matchers/toBeValidUrl/predicate.js: -------------------------------------------------------------------------------- 1 | export default expected => { 2 | let valid = false; 3 | try { 4 | new URL(expected); 5 | valid = true; 6 | } catch (error) {} 7 | return valid; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /w3c.json: -------------------------------------------------------------------------------- 1 | { 2 | "group": [117488], 3 | "contacts": ["iherman"], 4 | "repo-type": "note", 5 | "shortName": "did-test-suite" 6 | } 7 | --------------------------------------------------------------------------------