You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by DanGould June 13, 2024
The payjoin protocol deals with HTTP messages, not ftp/unix/data protocols and so using the lighter weight http::Uri type may be more appropriate than url::Url and give validation control over exactly the types of URLs that we need to deal with.
While these aren't HUGE features for us to make and maintain, Having the experience of doing some tricky parsing for BIP 77 and making mistakes requiring rewrites, I'd rather depend on more vetted work unless an implementer downstream requested explicit removal of this dependency in order for us to limit our maintenance burden. bhttp also already depends on url, so removing the dependency from the default v2 feature set would require a bhttp refactor to remove the url crate as well.
Instead of removing the dependency, I'd still like to remove url::Url from our public API. I like how reqwest::IntoUrl works which does URL validation on strings as arguments into functions like post. Then we can reveal our own public API error variants that also do not explicitly depend on url::Url, and only depend on it internally.
This removes the burden of URL parsing from the downstream implementer and puts it into our core typestate machines.
I'm going to close this issue and open a new on on the IntoUrl approach. (new issue: #513)
Discussed in https://github.com/orgs/payjoin/discussions/288
Originally posted by DanGould June 13, 2024
The payjoin protocol deals with HTTP messages, not ftp/unix/data protocols and so using the lighter weight
http::Uri
type may be more appropriate thanurl::Url
and give validation control over exactly the types of URLs that we need to deal with.The original bip78 crate from Kixunil used url so we just kept with it without thinking through this dependency https://github.com/Kixunil/payjoin/blob/master/bip78/Cargo.toml
The text was updated successfully, but these errors were encountered: