├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── stale.yml └── workflows │ ├── release.yml │ └── test.yml ├── .gitignore ├── .prettierrc ├── .releaserc ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── babel.config.json ├── eslint.config.mjs ├── example └── react-app │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ └── index.html │ └── src │ ├── App.css │ ├── App.js │ ├── index.css │ └── index.js ├── package.json ├── renovate.json ├── src ├── __tests__ │ └── resolver.test.ts └── resolver.ts ├── tsconfig.json └── yarn.lock /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Prerequisites 11 | 12 | Please answer the following questions for yourself before submitting an issue. 13 | 14 | - [ ] I am running the latest version 15 | - [ ] I checked the documentation and found no answer 16 | - [ ] I checked to make sure that this issue has not already been filed 17 | 18 | **YOU MAY DELETE THE PREREQUISITES SECTION** if you're sure you checked all the boxes. 19 | 20 | ### Current Behavior 21 | 22 | What is the current behavior? 23 | 24 | ### Expected Behavior 25 | 26 | Please describe the behavior you are expecting 27 | 28 | ### Failure Information 29 | 30 | Please help provide information about the failure. 31 | 32 | #### Steps to Reproduce 33 | 34 | Please provide detailed steps for reproducing the issue. 35 | 36 | 1. step 1 37 | 2. step 2 38 | 3. you get it... 39 | 40 | #### Environment Details 41 | 42 | Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. 43 | 44 | * node/browser version: 45 | * OS Version: 46 | * Device details: 47 | 48 | #### Failure Logs/Screenshots 49 | 50 | Please include any relevant log snippets or files here. 51 | Create a [GIST](https://gist.github.com) which is a paste of your _full or sanitized_ logs, and link them here. 52 | Please do _NOT_ paste your full logs here, as it will make this issue very long and hard to read! 53 | 54 | #### Alternatives you considered 55 | 56 | Please provide details about an environment where this bug does not occur. 57 | 58 | --- 59 | 60 | > **Don't paste private keys anywhere public!** 61 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '[proposal]' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 70 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 14 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | - in-progress 10 | - planned-feature 11 | - good-first-issue 12 | - triage 13 | # Label to use when marking an issue as stale 14 | staleLabel: stale 15 | # Comment to post when marking an issue as stale. Set to `false` to disable 16 | markComment: > 17 | This issue has been automatically marked as stale because it has not had 18 | recent activity. It will be closed if no further activity occurs. Thank you 19 | for your contributions. 20 | # Comment to post when closing a stale issue. Set to `false` to disable 21 | closeComment: false 22 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Build, Test and Publish 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - 'master' 7 | jobs: 8 | build-test-publish: 9 | runs-on: ubuntu-22.04 10 | steps: 11 | - uses: actions/checkout@v4 12 | with: 13 | fetch-depth: 0 14 | token: ${{ secrets.GH_TOKEN }} 15 | 16 | - name: "Setup node with cache" 17 | uses: actions/setup-node@v4 18 | with: 19 | node-version: 20 20 | cache: 'yarn' 21 | 22 | - run: yarn install --frozen-lockfile 23 | - run: yarn run build 24 | 25 | - name: "Setup git coordinates" 26 | run: | 27 | git config user.name uport-automation-bot 28 | git config user.email devops@uport.me 29 | 30 | - name: "Run semantic-release" 31 | env: 32 | GH_TOKEN: ${{secrets.GH_TOKEN}} 33 | NPM_TOKEN: ${{secrets.NPM_TOKEN}} 34 | if: github.ref == 'refs/heads/master' 35 | run: yarn run release 36 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test NODE 2 | on: [pull_request, workflow_dispatch, push] 3 | jobs: 4 | build-test: 5 | runs-on: ubuntu-22.04 6 | steps: 7 | - uses: actions/checkout@v4 8 | with: 9 | fetch-depth: 0 10 | 11 | - name: "Setup node with cache" 12 | uses: actions/setup-node@v4 13 | with: 14 | node-version: 20 15 | cache: 'yarn' 16 | 17 | - run: yarn install --frozen-lockfile 18 | - run: yarn run build 19 | - run: yarn run lint 20 | - run: yarn run test:ci 21 | 22 | - name: "Upload coverage reports" 23 | uses: codecov/codecov-action@v5 24 | with: 25 | token: ${{ secrets.CODECOV_TOKEN }} 26 | fail_ci_if_error: true 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | coverage 4 | 5 | .DS_Store 6 | 7 | **/.idea/ 8 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsxBracketSameLine": false, 3 | "tabWidth": 2, 4 | "printWidth": 120, 5 | "singleQuote": true, 6 | "trailingComma": "es5", 7 | "semi": false 8 | } 9 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "tagFormat": "${version}", 3 | "plugins": [ 4 | "@semantic-release/commit-analyzer", 5 | "@semantic-release/release-notes-generator", 6 | ["@semantic-release/changelog", { 7 | "changelogFile": "CHANGELOG.md" 8 | }], 9 | "@semantic-release/npm", 10 | ["@semantic-release/git", { 11 | "assets": ["CHANGELOG.md", "docs", "package.json", "yarn.lock"], 12 | "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" 13 | }], 14 | "@semantic-release/github" 15 | ], 16 | "branch": "master" 17 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug Jest Tests", 6 | "type": "node", 7 | "request": "launch", 8 | "runtimeArgs": [ 9 | "--inspect-brk", 10 | "${workspaceRoot}/node_modules/.bin/jest", 11 | "--runInBand", 12 | "--coverage", 13 | "false" 14 | ], 15 | "console": "integratedTerminal", 16 | "internalConsoleOptions": "neverOpen", 17 | "port": 9229 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "./node_modules/typescript/lib", 3 | "tslint.enable": true, 4 | "editor.tabSize": 2, 5 | "editor.detectIndentation": false, 6 | "[typescript]": { 7 | "editor.formatOnSave": true 8 | } 9 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [2.0.30](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.29...2.0.30) (2025-03-29) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **deps:** update all non-major dependencies to v19.1.0 ([d2d3166](https://github.com/decentralized-identity/web-did-resolver/commit/d2d3166dc016b080d2c6891bd8a72c910fc8d54b)) 7 | 8 | ## [2.0.29](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.28...2.0.29) (2025-01-24) 9 | 10 | 11 | ### Bug Fixes 12 | 13 | * **deps:** update dependency cross-fetch to v4.1.0 ([#136](https://github.com/decentralized-identity/web-did-resolver/issues/136)) ([39fc091](https://github.com/decentralized-identity/web-did-resolver/commit/39fc091893d3edc01272c77f9a3b6f6280e9791f)) 14 | 15 | ## [2.0.28](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.27...2.0.28) (2025-01-24) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * **deps:** update react monorepo to v19 ([#135](https://github.com/decentralized-identity/web-did-resolver/issues/135)) ([d37c50d](https://github.com/decentralized-identity/web-did-resolver/commit/d37c50dd750ed1de5b86a47bc81142a0f5e70902)) 21 | 22 | ## [2.0.27](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.26...2.0.27) (2023-07-03) 23 | 24 | 25 | ### Bug Fixes 26 | 27 | * **deps:** update dependency cross-fetch to v4 ([f8adfca](https://github.com/decentralized-identity/web-did-resolver/commit/f8adfca61b1692dfd5a2fccc05e8386724564259)) 28 | 29 | ## [2.0.26](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.25...2.0.26) (2023-07-03) 30 | 31 | 32 | ### Bug Fixes 33 | 34 | * **deps:** update dependency cross-fetch to v3.1.8 ([00834e6](https://github.com/decentralized-identity/web-did-resolver/commit/00834e66dfbfa6775488317c4d691fddfd7406bd)) 35 | 36 | ## [2.0.25](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.24...2.0.25) (2023-07-02) 37 | 38 | 39 | ### Bug Fixes 40 | 41 | * **deps:** update dependency cross-fetch to v3.1.7 ([92f7428](https://github.com/decentralized-identity/web-did-resolver/commit/92f7428b45d48884a9f9a6232e1e83065ebc3f18)) 42 | 43 | ## [2.0.24](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.23...2.0.24) (2023-05-14) 44 | 45 | 46 | ### Bug Fixes 47 | 48 | * **deps:** update dependency cross-fetch to v3.1.6 ([deb19d7](https://github.com/decentralized-identity/web-did-resolver/commit/deb19d790f4a7f734ab146a10d9253b0f9aaf1bb)) 49 | 50 | ## [2.0.23](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.22...2.0.23) (2023-04-03) 51 | 52 | 53 | ### Bug Fixes 54 | 55 | * **build:** publish types in package.json ([174afe8](https://github.com/decentralized-identity/web-did-resolver/commit/174afe8be23fbdd1a3f260ed1ebd20d2416a9abd)) 56 | 57 | ## [2.0.22](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.21...2.0.22) (2023-03-23) 58 | 59 | 60 | ### Bug Fixes 61 | 62 | * **deps:** Update dependency did-resolver to v4.1.0 ([81fa649](https://github.com/decentralized-identity/web-did-resolver/commit/81fa649a7fc0c73daca5effe620baebfb0d60827)) 63 | 64 | ## [2.0.21](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.20...2.0.21) (2022-10-17) 65 | 66 | 67 | ### Bug Fixes 68 | 69 | * **deps:** Update dependency did-resolver to v4.0.1 ([63d7fc2](https://github.com/decentralized-identity/web-did-resolver/commit/63d7fc23ba505e9c31dd97fd7a141d6c892ab7e0)) 70 | 71 | ## [2.0.20](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.19...2.0.20) (2022-08-03) 72 | 73 | 74 | ### Bug Fixes 75 | 76 | * **deps:** Update dependency did-resolver to v4 ([74b825f](https://github.com/decentralized-identity/web-did-resolver/commit/74b825fb88daa17f0f4c195725d38757be9ea5d9)) 77 | 78 | ## [2.0.19](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.18...2.0.19) (2022-06-15) 79 | 80 | 81 | ### Bug Fixes 82 | 83 | * **deps:** update all non-major dependencies to v18.2.0 ([cd99aa3](https://github.com/decentralized-identity/web-did-resolver/commit/cd99aa3f53ab4d1cbfccea8f5ea3a90f31853eca)) 84 | 85 | ## [2.0.18](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.17...2.0.18) (2022-06-07) 86 | 87 | 88 | ### Bug Fixes 89 | 90 | * **deps:** groom the build scripts and dependencies ([#120](https://github.com/decentralized-identity/web-did-resolver/issues/120)) ([757f6ec](https://github.com/decentralized-identity/web-did-resolver/commit/757f6ec1c25ee07321928d02a7bee797b2eaa2fa)) 91 | 92 | ## [2.0.17](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.16...2.0.17) (2022-06-06) 93 | 94 | 95 | ### Bug Fixes 96 | 97 | * **deps:** Update dependency did-resolver to v3.2.2 ([f494fbe](https://github.com/decentralized-identity/web-did-resolver/commit/f494fbe86d87a965c91b7b43479a38a766c522e1)) 98 | 99 | ## [2.0.16](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.15...2.0.16) (2022-04-28) 100 | 101 | 102 | ### Bug Fixes 103 | 104 | * **deps:** update all non-major dependencies to v18.1.0 ([cd3ed19](https://github.com/decentralized-identity/web-did-resolver/commit/cd3ed195dd49b553128bd3d4a7f24224ceff462f)) 105 | 106 | ## [2.0.15](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.14...2.0.15) (2022-04-13) 107 | 108 | 109 | ### Bug Fixes 110 | 111 | * **deps:** update dependency react-scripts to v5.0.1 ([36d0e22](https://github.com/decentralized-identity/web-did-resolver/commit/36d0e22ffd8f207d24a9461227cfac1b736a07d0)) 112 | 113 | ## [2.0.14](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.13...2.0.14) (2022-03-31) 114 | 115 | 116 | ### Bug Fixes 117 | 118 | * **deps:** update react monorepo to v18 ([8f21c88](https://github.com/decentralized-identity/web-did-resolver/commit/8f21c881263c513d98db14670837f980ab1d4e49)) 119 | 120 | ## [2.0.13](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.12...2.0.13) (2022-03-30) 121 | 122 | 123 | ### Bug Fixes 124 | 125 | * **deps:** Update dependency did-resolver to v3.2.0 ([d33f51e](https://github.com/decentralized-identity/web-did-resolver/commit/d33f51ef1298d0d5bd784ea593481e40909e7545)) 126 | 127 | ## [2.0.12](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.11...2.0.12) (2022-01-13) 128 | 129 | 130 | ### Bug Fixes 131 | 132 | * **deps:** update dependencies, remove ts-jest ([789ec69](https://github.com/decentralized-identity/web-did-resolver/commit/789ec6926d57e1d42afebe592d8956dec0513789)) 133 | 134 | ## [2.0.11](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.10...2.0.11) (2021-12-15) 135 | 136 | 137 | ### Bug Fixes 138 | 139 | * **deps:** update dependency react-scripts to v5 ([bbc4b35](https://github.com/decentralized-identity/web-did-resolver/commit/bbc4b351ca349b17373275091653f853031f0634)) 140 | 141 | ## [2.0.10](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.9...2.0.10) (2021-12-10) 142 | 143 | 144 | ### Bug Fixes 145 | 146 | * **deps:** Update dependency did-resolver to v3.1.5 ([0728ffb](https://github.com/decentralized-identity/web-did-resolver/commit/0728ffb91674c4c20a1cf1ad8abf6bbb37908db1)) 147 | 148 | ## [2.0.9](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.8...2.0.9) (2021-12-06) 149 | 150 | 151 | ### Bug Fixes 152 | 153 | * **deps:** Update dependency did-resolver to v3.1.4 ([02d4c7d](https://github.com/decentralized-identity/web-did-resolver/commit/02d4c7d7c76814f03ce96d373fa719ecb2890ff2)) 154 | 155 | ## [2.0.8](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.7...2.0.8) (2021-11-10) 156 | 157 | 158 | ### Bug Fixes 159 | 160 | * **deps:** bump did-resolver to 3.1.3 ([f62af45](https://github.com/decentralized-identity/web-did-resolver/commit/f62af45773bfe9d59ac7019d34cf6af90d3ee97f)) 161 | 162 | ## [2.0.7](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.6...2.0.7) (2021-10-27) 163 | 164 | 165 | ### Bug Fixes 166 | 167 | * **deps:** Update dependency did-resolver to v3.1.3 ([d77839f](https://github.com/decentralized-identity/web-did-resolver/commit/d77839f6a9e49cc8c3bceaad66b6099471586aff)) 168 | 169 | ## [2.0.6](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.5...2.0.6) (2021-09-30) 170 | 171 | 172 | ### Bug Fixes 173 | 174 | * **deps:** Update dependency did-resolver to v3.1.2 ([7902b3f](https://github.com/decentralized-identity/web-did-resolver/commit/7902b3fac8a8f0fae4a001fea9a21ca479732fe6)) 175 | 176 | ## [2.0.5](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.4...2.0.5) (2021-09-28) 177 | 178 | 179 | ### Bug Fixes 180 | 181 | * **deps:** Update dependency did-resolver to v3.1.1 ([91cc1c6](https://github.com/decentralized-identity/web-did-resolver/commit/91cc1c677e696f4e781b8030d48e1aadb6e2d074)) 182 | 183 | ## [2.0.4](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.3...2.0.4) (2021-03-26) 184 | 185 | 186 | ### Bug Fixes 187 | 188 | * **deps:** bump did-resolver to 3.1.0 ([08358ec](https://github.com/decentralized-identity/web-did-resolver/commit/08358ec94ce2d278682e8d65e6bfd2edd8bc0439)) 189 | 190 | ## [2.0.3](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.2...2.0.3) (2021-03-23) 191 | 192 | 193 | ### Bug Fixes 194 | 195 | * **deps:** update all non-major dependencies to v17.0.2 ([0e9e2f0](https://github.com/decentralized-identity/web-did-resolver/commit/0e9e2f0313e13196f91673c42907328bf30c26ae)) 196 | 197 | ## [2.0.2](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.1...2.0.2) (2021-03-15) 198 | 199 | 200 | ### Bug Fixes 201 | 202 | * **deps:** update all non-major dependencies ([#93](https://github.com/decentralized-identity/web-did-resolver/issues/93)) ([13d8f18](https://github.com/decentralized-identity/web-did-resolver/commit/13d8f18f7dd7a6dcd79b19b7f4c6e56bed29c66a)) 203 | 204 | ## [2.0.1](https://github.com/decentralized-identity/web-did-resolver/compare/2.0.0...2.0.1) (2021-03-15) 205 | 206 | 207 | ### Bug Fixes 208 | 209 | * **deps:** update dependency did-resolver to v3 ([#94](https://github.com/decentralized-identity/web-did-resolver/issues/94)) ([18d1a1d](https://github.com/decentralized-identity/web-did-resolver/commit/18d1a1d36ac84de8f128062aa652f7714122e1d3)) 210 | 211 | # [2.0.0](https://github.com/decentralized-identity/web-did-resolver/compare/1.3.5...2.0.0) (2021-03-15) 212 | 213 | 214 | ### Features 215 | 216 | * update to latest did spec ([#92](https://github.com/decentralized-identity/web-did-resolver/issues/92)) ([4779436](https://github.com/decentralized-identity/web-did-resolver/commit/47794360ad7a00cc87958b8c94dc4c1d13354917)), closes [#91](https://github.com/decentralized-identity/web-did-resolver/issues/91) 217 | 218 | 219 | ### BREAKING CHANGES 220 | 221 | * Resolver now returns a `DIDResolutionResult` that wraps a DIDDocument. No errors are thrown, instead returned as `didResolutionMetadata.error/message` 222 | 223 | ## [1.3.5](https://github.com/decentralized-identity/web-did-resolver/compare/1.3.4...1.3.5) (2020-11-09) 224 | 225 | 226 | ### Bug Fixes 227 | 228 | * **deps:** pin dependencies ([#89](https://github.com/decentralized-identity/web-did-resolver/issues/89)) ([926eb1f](https://github.com/decentralized-identity/web-did-resolver/commit/926eb1f037887cb1f409723e8ef3177d5cd41360)) 229 | 230 | ## [1.3.4](https://github.com/decentralized-identity/web-did-resolver/compare/1.3.3...1.3.4) (2020-11-09) 231 | 232 | 233 | ### Bug Fixes 234 | 235 | * CORS bug ([#88](https://github.com/decentralized-identity/web-did-resolver/issues/88)) ([2a5b5d1](https://github.com/decentralized-identity/web-did-resolver/commit/2a5b5d15da51eec74f3fb2a0b6c8ebbbf3a72392)) 236 | 237 | ## [1.3.3](https://github.com/decentralized-identity/web-did-resolver/compare/1.3.2...1.3.3) (2020-08-19) 238 | 239 | 240 | ### Bug Fixes 241 | 242 | * **deps:** update dependency did-resolver to v2.1.1 ([#70](https://github.com/decentralized-identity/web-did-resolver/issues/70)) ([0a0f902](https://github.com/decentralized-identity/web-did-resolver/commit/0a0f902367ee02ce1301432d4c0badeaff2c5837)) 243 | 244 | ## [1.3.2](https://github.com/decentralized-identity/web-did-resolver/compare/1.3.1...1.3.2) (2020-07-21) 245 | 246 | 247 | ### Bug Fixes 248 | 249 | * **deps:** update dependency did-resolver to v2 ([#56](https://github.com/decentralized-identity/web-did-resolver/issues/56)) ([b420866](https://github.com/decentralized-identity/web-did-resolver/commit/b4208663dcb31c3374bc9d61f639b1c7e27c63fa)) 250 | 251 | ## [1.3.1](https://github.com/decentralized-identity/web-did-resolver/compare/1.3.0...1.3.1) (2020-07-20) 252 | 253 | 254 | ### Bug Fixes 255 | 256 | * **deps:** update dependency did-resolver to v1.1.0 ([#39](https://github.com/decentralized-identity/web-did-resolver/issues/39)) ([4ade39d](https://github.com/decentralized-identity/web-did-resolver/commit/4ade39d1ecb38f7170acbd0f9708440d40f3eecb)) 257 | 258 | # [1.3.0](https://github.com/decentralized-identity/web-did-resolver/compare/1.2.1...1.3.0) (2020-05-13) 259 | 260 | 261 | ### Features 262 | 263 | * support for path in the did ([904d88c](https://github.com/decentralized-identity/web-did-resolver/commit/904d88c0babd9bc787390d8bace12435fc391c74)), closes [#32](https://github.com/decentralized-identity/web-did-resolver/issues/32) [#33](https://github.com/decentralized-identity/web-did-resolver/issues/33) 264 | 265 | ## [1.2.1](https://github.com/decentralized-identity/web-did-resolver/compare/1.2.0...1.2.1) (2020-03-12) 266 | 267 | 268 | ### Bug Fixes 269 | 270 | * remove checks for a [@context](https://github.com/context) field ([b814b6c](https://github.com/decentralized-identity/web-did-resolver/commit/b814b6c69721cf3bf2f720d928ca4865ae478b3a)), closes [#26](https://github.com/decentralized-identity/web-did-resolver/issues/26) 271 | 272 | # [1.2.0](https://github.com/decentralized-identity/web-did-resolver/compare/1.1.0...1.2.0) (2019-10-24) 273 | 274 | 275 | ### Features 276 | 277 | * remove default export ([9ef0b37](https://github.com/decentralized-identity/web-did-resolver/commit/9ef0b3793edcf95674b833d8ef4a293f2324c778)) 278 | * use cross-fetch instead of XMLHttpRequest ([#15](https://github.com/decentralized-identity/web-did-resolver/issues/15)) ([4378c71](https://github.com/decentralized-identity/web-did-resolver/commit/4378c71bae383b33d8c567c016c461c181ae1d17)) 279 | 280 | # [1.1.0](https://github.com/decentralized-identity/web-did-resolver/compare/1.0.1...1.1.0) (2019-10-24) 281 | 282 | 283 | ### Features 284 | 285 | * remove default export ([3952bef](https://github.com/decentralized-identity/web-did-resolver/commit/3952bef1dc31142371a3082ec0c2cb0d82ef7ecb)) 286 | * use cross-fetch instead of XMLHttpRequest ([#15](https://github.com/decentralized-identity/web-did-resolver/issues/15)) ([dadf682](https://github.com/decentralized-identity/web-did-resolver/commit/dadf6828a704309022764fe13566bf678ba59bd4)) 287 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2019 Consensys AG 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://www.npmjs.com/package/web-did-resolver) 2 | [](https://www.npmjs.com/package/web-did-resolver) 3 | [](https://codecov.io/gh/decentralized-identity/web-did-resolver) 4 | 5 | # Web DID Resolver 6 | 7 | This library is intended to represent domains accessed through https as 8 | [Decentralized Identifiers](https://w3c.github.io/did-core/#identifier) 9 | and retrieve an associated [DID Document](https://w3c.github.io/did-core/#did-document-properties) 10 | 11 | It supports the proposed [`did:web` method spec](https://w3c-ccg.github.io/did-method-web/) from 12 | the [W3C Credentials Community Group](https://w3c-ccg.github.io). 13 | 14 | It requires the `did-resolver` library, which is the primary interface for resolving DIDs. 15 | 16 | ## DID method 17 | 18 | To encode a DID for an HTTPS domain, simply prepend `did:web:` to domain name. 19 | 20 | eg: `https://example.com -> did:web:example.com` 21 | 22 | ## DID Document 23 | 24 | The DID resolver takes the domain and forms a [well-known URI](https://tools.ietf.org/html/rfc5785) 25 | to access the DID Document. 26 | 27 | For a did `did:web:example.com`, the resolver will attempt to access the document at 28 | `https://example.com/.well-known/did.json` 29 | 30 | A minimal DID Document might contain the following information: 31 | 32 | ```json 33 | { 34 | "@context": "https://w3id.org/did/v1", 35 | "id": "did:web:example.com", 36 | "publicKey": [ 37 | { 38 | "id": "did:web:example.com#owner", 39 | "type": "Secp256k1VerificationKey2018", 40 | "controller": "did:web:example.com", 41 | "publicKeyHex": "04ab0102bcae6c7c3a90b01a3879d9518081bc06123038488db9cb109b082a77d97ea3373e3dfde0eccd9adbdce11d0302ea5c098dbb0b310234c8689501749274" 42 | } 43 | ], 44 | "assertionMethod": [ "did:web:example.com#owner" ], 45 | "authentication": [ "did:web:example.com#owner" ] 46 | } 47 | ``` 48 | 49 | Note: this example uses the `Secp256k1VerificationKey2018` type and an `publicKeyHex` as a publicKey entry, signaling 50 | that this DID is claiming to control the private key associated with that publicKey. 51 | 52 | ## Resolving a DID document 53 | 54 | The resolver presents a simple `resolver()` function that returns a ES6 Promise returning the DID document. 55 | 56 | ```js 57 | import { Resolver } from 'did-resolver' 58 | import { getResolver } from 'web-did-resolver' 59 | 60 | const webResolver = getResolver() 61 | 62 | const didResolver = new Resolver({ 63 | ...webResolver 64 | //...you can flatten multiple resolver methods into the Resolver 65 | }) 66 | 67 | didResolver.resolve('did:web:uport.me').then(doc => console.log(doc)) 68 | 69 | // You can also use ES7 async/await syntax 70 | ;(async () => { 71 | const doc = await didResolver.resolve('did:web:uport.me') 72 | console.log(doc) 73 | })(); 74 | ``` 75 | -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }], "@babel/preset-typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import typescriptEslint from '@typescript-eslint/eslint-plugin' 2 | import jest from 'eslint-plugin-jest' 3 | import globals from 'globals' 4 | import tsParser from '@typescript-eslint/parser' 5 | import path from 'node:path' 6 | import { fileURLToPath } from 'node:url' 7 | import js from '@eslint/js' 8 | import { FlatCompat } from '@eslint/eslintrc' 9 | 10 | const __filename = fileURLToPath(import.meta.url) 11 | const __dirname = path.dirname(__filename) 12 | const compat = new FlatCompat({ 13 | baseDirectory: __dirname, 14 | recommendedConfig: js.configs.recommended, 15 | allConfig: js.configs.all, 16 | }) 17 | 18 | export default [ 19 | ...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'), 20 | { 21 | plugins: { 22 | '@typescript-eslint': typescriptEslint, 23 | jest, 24 | }, 25 | 26 | languageOptions: { 27 | globals: { 28 | ...globals.node, 29 | ...jest.environments.globals.globals, 30 | }, 31 | 32 | parser: tsParser, 33 | ecmaVersion: 2018, 34 | sourceType: 'module', 35 | }, 36 | 37 | rules: {}, 38 | }, 39 | ] 40 | -------------------------------------------------------------------------------- /example/react-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /example/react-app/README.md: -------------------------------------------------------------------------------- 1 | ## Available Scripts 2 | 3 | In the project directory, you can run: 4 | 5 | ### `npm start` 6 | 7 | Runs the app in the development mode.\ 8 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 9 | 10 | The page will reload if you make edits.\ 11 | You will also see any lint errors in the console. 12 | 13 | ### `npm run build` 14 | 15 | Builds the app for production to the `build` folder.\ 16 | It correctly bundles React in production mode and optimizes the build for the best performance. 17 | 18 | The build is minified and the filenames include the hashes.\ 19 | Your app is ready to be deployed! 20 | 21 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 22 | -------------------------------------------------------------------------------- /example/react-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "did-resolver": "4.1.0", 7 | "react": "19.1.0", 8 | "react-dom": "19.1.0", 9 | "react-scripts": "5.0.1", 10 | "web-did-resolver": "../../" 11 | }, 12 | "scripts": { 13 | "start": "SKIP_PREFLIGHT_CHECK=true react-scripts start", 14 | "build": "react-scripts build" 15 | }, 16 | "eslintConfig": { 17 | "extends": [ 18 | "react-app", 19 | "react-app/jest" 20 | ] 21 | }, 22 | "browserslist": { 23 | "production": [ 24 | ">0.2%", 25 | "not dead", 26 | "not op_mini all" 27 | ], 28 | "development": [ 29 | "last 1 chrome version", 30 | "last 1 firefox version", 31 | "last 1 safari version" 32 | ] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /example/react-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 11 |40 | {resolved === true && `resolved ${did}`} 41 | {resolved === false && `failed to resolve ${did}`} 42 |
43 |