Rename _danger-local-https to _manual-tls#763
Conversation
|
Taking a look! Let me know if you need any help with making sure rust_fmt is running correctly as I see a lot of formatting changes. |
|
Looking good , Did you run the code formating on rust nightly build, that should help with the many unrelated code changes |
i think the mistake i made was running |
benalleng
left a comment
There was a problem hiding this comment.
Good start! We obviously need to get our formatting worked out but as well just so you are reminded it looks like the test-utils still is looking for the _danger-local-https flag. https://github.com/0xZaddyy/rust-payjoin/blob/935bfbc505d3ee14ccf5eb8fb8cd03ae3178a532/payjoin-test-utils/Cargo.toml#L20-L21
| #[cfg(feature = "_manual-tls")] | ||
| let tls_acceptor = Self::init_tls_acceptor()?; | ||
| while let Ok((stream, _)) = listener.accept().await { | ||
| let app = app.clone(); | ||
| #[cfg(feature = "_danger-local-https")] | ||
| #[cfg(feature = "_manual-tls")] | ||
| let tls_acceptor = tls_acceptor.clone(); | ||
| tokio::spawn(async move { | ||
| #[cfg(feature = "_danger-local-https")] | ||
| #[cfg(feature = "_manual-tls")] |
There was a problem hiding this comment.
I think I'd like to explore moving the init_tls_acceptor() to the e2e tests and add these flags as a feature locked option. This would help to further reduce the amount of feature flagged logic in the source code.
0655d03 to
eb7cfa6
Compare
arminsabouri
left a comment
There was a problem hiding this comment.
Besides the fmt changes and the applying the unrelated files this looks good.
One more thing: do you mind formatting your commits using the following guide:
https://cbea.ms/git-commit/
For your current commits please squash them once we figure out the fmt changes and reword to "Rename _danger-local-https to _manual-tls"
You'll notice that I dropped the "and simplify TLS handling". If you do simplify tls handling please do it in a seperate commit. Commits should do just one thing well. That helps us write our release notes, reduces review burden and allows us to revert specific changes if we need to. Thank you!
| InternalMultipartyError::IdenticalProposals(e) => { | ||
| write!(f, "More than one identical participant: {e}") | ||
| } | ||
| InternalMultipartyError::ProposalVersionNotSupported(v) => { | ||
| write!(f, "Proposal version not supported: {v}") | ||
| } | ||
| InternalMultipartyError::OptimisticMergeNotSupported => { | ||
| write!(f, "Optimistic merge not supported") | ||
| } | ||
| InternalMultipartyError::BitcoinExtractTxError(e) => { | ||
| write!(f, "Bitcoin extract tx error: {e:?}") | ||
| } | ||
| InternalMultipartyError::InputMissingWitnessOrScriptSig => { | ||
| write!(f, "Input in Finalized Proposal is missing witness or script_sig") | ||
| } | ||
| InternalMultipartyError::FailedToCombinePsbts(e) => { | ||
| write!(f, "Failed to combine psbts: {e:?}") |
There was a problem hiding this comment.
Looks like some unrelated formatting changes were applied.
payjoin/src/receive/v2/persist.rs
Outdated
| @@ -0,0 +1,35 @@ | |||
| use std::fmt::{self, Display}; | |||
There was a problem hiding this comment.
This file was removed in favor of session.rs. Looks like you need to rebase against master.
fbf5d4a to
2ec825d
Compare
Pull Request Test Coverage Report for Build 17130350626Details
💛 - Coveralls |
9f7308c to
57f3292
Compare
nothingmuch
left a comment
There was a problem hiding this comment.
ACK, but this PR can be trivial if rebased on #913 which introduces certificate fields to the app config & cli params
i think we can also consider making this manual_tls not _manual_tls, supporting this as feature in payjoin-cli for people who want to run v1 receivers manually provided certificates (--certificate-key seems generally useful, but not sure what value --root-certificate or more generally self signed certificaes have outside of testing). @DanGould thoughts?
| #[cfg(feature = "_manual-tls")] | ||
| fn http_agent(cert: Option<Vec<u8>>) -> Result<reqwest::Client> { | ||
| match cert { | ||
| Some(cert_der) => build_http_agent_with_cert(&cert_der), | ||
| None => | ||
| if let Ok(base64_cert) = std::env::var("MANUAL_TLS_CERT") { | ||
| let cert_der = base64::decode(base64_cert)?; | ||
| build_http_agent_with_cert(&cert_der) | ||
| } else { | ||
| Err(anyhow::anyhow!("No certificate provided for manual TLS mode")) | ||
| }, | ||
| } | ||
| } |
There was a problem hiding this comment.
i think the #913 approach is a bit cleaner since http_agent just accepts the config regardless of feature flags, so if you agree i would prefer if this PR was rebased on top of it, at which point it should be a trivial change that just renames the feature flag and does not introduce new logic
There was a problem hiding this comment.
Alright sounds good :)
I’ll drop the new logic and just go with the feature flag rename so it aligns with #913
04b0aa5 to
d79884f
Compare
a31ab51 to
2f58524
Compare
1eb9d29 to
3faff3a
Compare
This change updates the feature flag `_danger-local-https` to `_manual-tls` to better reflect the actual behavior and reduce misleading implications about its risk level. The new name clarifies that TLS certificates are only accepted manually and not validated by default.
3faff3a to
594a00b
Compare
|
@spacebear21 all set |
This PR updates the feature flag name
_danger-local-httpsto_manual-tlsfor improved clarity and consistency.What’s Changed
closes #729