Open
Conversation
…r resolution. DIDWeb struct has an HTTP client to use for DID resolution. It's incredibly slow to create a new reqwest::Client, due to the overhead of loading the system's root certificates. This HTTP client must be specified by constructing the DIDWeb instance using new_with_default_http_client (to use defaults) or DIDWeb::new_with_http_client if there is an specific reqwest::Client that should be reused. Note that this is the recommended approach to using reqwest::Client (see https://docs.rs/reqwest/latest/reqwest/struct.Client.html).
Contributor
Author
|
Same deal here, I sent in a signed CLA Oct 6, 2021, but let me know if you need a new one for whatever reason. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the HTTP client as discussed in #516
Note that this is a breaking change because of the semantics of the DIDWeb struct:
DIDWebby itself (no{}needed), and appears in various places as&DIDWeb.DIDWeb::new_with_default_http_client(this is the drop-in replacement for existing functionality) orDIDWeb::new_with_http_client(if you want to specify your own HTTP client).I altered the various call sites that were using
&DIDWeb, and changed them to use an instance created withDIDWeb::new_with_default_http_client. However, codebases downstream of ssi that use DIDWeb will need to update their uses of DIDWeb (e.g. when constructing a DIDMethods) in order to integrate this change.