Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-introduce resolve Method in DidApi for DID Resolution #267

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

frankhinek
Copy link
Contributor

@frankhinek frankhinek commented Nov 7, 2023

Summary

This PR (re-)introduces the resolve() method to the DidApi class, enabling the resolution of DIDs through web5.dids.resolve(). The method is designed to be a simple interface for resolving a DID to its corresponding DID Resolution Result, which includes the DID Document.

Implementation Details

  • The DidApi class is equipped with a resolve method that takes a DID URL and optional resolution options.
  • The resolution process is carried out by delegating the request to the Web5Agent, which is expected to handle the actual resolution logic.
  • The resolve method returns a promise that resolves with the DidResolutionResult.

Copy link

codesandbox bot commented Nov 7, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@frankhinek frankhinek added the enhancement New feature or request label Nov 7, 2023
Copy link
Contributor

github-actions bot commented Nov 7, 2023

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 23

@web5/api

  • Project entry file: packages/api/src/index.ts
📄 File: node_modules/abstract-level/types/abstract-level.d.ts
⚠️ compiler:TS2304: Cannot find name 'this'. #L143
⚠️ compiler:TS2304: Cannot find name 'this'. #L173
⚠️ compiler:TS2304: Cannot find name 'this'. #L187
⚠️ compiler:TS2304: Cannot find name 'this'. #L201
⚠️ compiler:TS2304: Cannot find name 'this'. #L218
📄 File: packages/api/src/did-api.ts
⚠️ extractor:ae-undocumented: Missing documentation for "agent". #L12
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L13
📄 File: packages/api/src/dwn-api.ts
⚠️ extractor:ae-undocumented: Missing documentation for "agent". #L185
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L186
📄 File: packages/api/src/protocol.ts
⚠️ extractor:ae-undocumented: Missing documentation for "_agent". #L30
⚠️ extractor:ae-undocumented: Missing documentation for "_metadata". #L31
⚠️ extractor:ae-undocumented: Missing documentation for "_protocolsConfigureMessage". #L32
📄 File: packages/api/src/record.ts
⚠️ extractor:ae-undocumented: Missing documentation for "_agent". #L76
⚠️ extractor:ae-undocumented: Missing documentation for "_attestation". #L77
⚠️ extractor:ae-undocumented: Missing documentation for "_contextId". #L78
⚠️ extractor:ae-undocumented: Missing documentation for "_descriptor". #L79
⚠️ extractor:ae-undocumented: Missing documentation for "_encodedData". #L80
⚠️ extractor:ae-undocumented: Missing documentation for "_encryption". #L81
⚠️ extractor:ae-undocumented: Missing documentation for "_readableStream". #L82
⚠️ extractor:ae-undocumented: Missing documentation for "_recordId". #L83
📄 File: packages/api/src/vc-api.ts
⚠️ extractor:ae-undocumented: Missing documentation for "agent". #L9
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L10
📄 File: packages/api/src/web5.ts
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L89

Updated @ 2023-11-09T20:41:16.408Z - Commit: e550297

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #267 (2092049) into main (50be4bd) will decrease coverage by 0.55%.
The diff coverage is 60.28%.

@@            Coverage Diff             @@
##             main     #267      +/-   ##
==========================================
- Coverage   90.87%   90.32%   -0.55%     
==========================================
  Files          74       74              
  Lines       13944    14028      +84     
  Branches     1379     1382       +3     
==========================================
  Hits        12671    12671              
- Misses       1247     1331      +84     
  Partials       26       26              
Components Coverage Δ
api 94.81% <100.00%> (-0.50%) ⬇️
common 95.00% <ø> (ø)
credentials 94.49% <ø> (ø)
crypto 100.00% <ø> (ø)
dids 88.75% <ø> (ø)
agent 87.22% <58.78%> (-0.94%) ⬇️
identity-agent 56.81% <38.88%> (-2.24%) ⬇️
proxy-agent 58.43% <100.00%> (-0.17%) ⬇️
user-agent 55.22% <38.88%> (-2.15%) ⬇️

Copy link
Contributor

@nitro-neal nitro-neal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@frankhinek frankhinek linked an issue Nov 8, 2023 that may be closed by this pull request
@frankhinek frankhinek merged commit 2421b28 into main Nov 9, 2023
22 of 26 checks passed
@frankhinek frankhinek deleted the web5-did-resolve branch November 9, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement processDidRequest() and sendDidRequest()
3 participants