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

Allow BYO http impl #377

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Allow BYO http impl #377

wants to merge 8 commits into from

Conversation

diehuxx
Copy link
Contributor

@diehuxx diehuxx commented Oct 1, 2024

If you turn on the feature flag "http_reqwest", web5 crate will supply its own http implementation that uses reqwest.

@diehuxx diehuxx changed the title Http feature Allow BYO http impl Oct 1, 2024
@diehuxx diehuxx marked this pull request as ready for review October 1, 2024 21:10
Copy link

github-actions bot commented Oct 1, 2024

TBD Spec Test Vectors Report (web5-rs)

Total Test VectorsTotal Test Cases✅ Passed❌ Failed⚠️ Skipped
185500
ℹ️ 5 out of 18 test vectors passed successfully.

❌ Missing Vectors (13)

These are test vectors without any test cases.
FeatureName
Credentialscreate
CryptoEs256ksign
CryptoEs256kverify
DidDhtcreate
DidWebresolve
PortableDidparse
PresentationExchangecreate_presentation_from_credentials
PresentationExchangeevaluate_presentation
PresentationExchangeselect_credentials
PresentationExchangevalidate_definition
PresentationExchangevalidate_submission
VcJwtdecode
VcJwtverify

Automatically generated at: 2024-10-03T17:03:47.684Z

Copy link

github-actions bot commented Oct 1, 2024

TBD Spec Test Vectors Report (web5-core-kt)

Total Test VectorsTotal Test Cases✅ Passed❌ Failed⚠️ Skipped
183300
ℹ️ 3 out of 18 test vectors passed successfully.

❌ Missing Vectors (15)

These are test vectors without any test cases.
FeatureName
Credentialscreate
Credentialsverify
CryptoEs256ksign
CryptoEs256kverify
DidDhtcreate
DidDhtresolve
DidWebresolve
PortableDidparse
PresentationExchangecreate_presentation_from_credentials
PresentationExchangeevaluate_presentation
PresentationExchangeselect_credentials
PresentationExchangevalidate_definition
PresentationExchangevalidate_submission
VcJwtdecode
VcJwtverify

Automatically generated at: 2024-10-03T17:07:53.362Z

@KendallWeihe
Copy link
Contributor

Looks like you may have accidentally deleted bound/typescript/package-lock.json

pub struct HttpResponse {
pub status_code: u16,
pub headers: HashMap<String, String>,
pub body: Vec<u8>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to pub body: Option<Vec<u8>>?

Comment on lines +51 to +55
let headers: HashMap<String, String> = HashMap::from([
("Host".to_string(), "{}".to_string()),
("Connection".to_string(), "close".to_string()),
("Accept".to_string(), "application/json".to_string()),
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think all of these headers are necessary? I've noticed you have added them throughout the various http calls. I'm guessing it's slightly more proper this way? just checking this isn'y copy/pasta from our roll-our-own http client code

pub mod jose;
pub mod json;

pub use http::set_http_client;
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we also need to expose the HttpClient trait in order for developers to bring their own?

IMO we should simply pub mod http; everything, otherwise in tbdex-rs we're going to have to copy/pasta all the http code for it's own BYO functionality (which over there is where the hard requirement kicks in because we have to implement a foreign fetch over the wasm ffi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants