tor: allow authenticating to control port using hashedpassword auth#1799
tor: allow authenticating to control port using hashedpassword auth#17993nprob wants to merge 4 commits intoJoinMarket-Org:masterfrom
Conversation
fa07bd7 to
a503472
Compare
roshii
left a comment
There was a problem hiding this comment.
Suggesting a few changes before merging. New functionality should be covered by unit tests too.
b7dd40e to
b320752
Compare
| if self.tor_control_password is None: | ||
| d = txtorcon.connect(reactor, control_endpoint) | ||
| else: | ||
| d = txtorcon.connect(reactor, control_endpoint, password_function=lambda : self.tor_control_password) |
There was a problem hiding this comment.
| if self.tor_control_password is None: | |
| d = txtorcon.connect(reactor, control_endpoint) | |
| else: | |
| d = txtorcon.connect(reactor, control_endpoint, password_function=lambda : self.tor_control_password) | |
| password_function = lambda : self.tor_control_password if self.tor_control_password else None | |
| d = txtorcon.connect(reactor, control_endpoint, password_function=password_function) |
There was a problem hiding this comment.
I find the former more readable. If maintainer prefer we can go with suggestion.
3c21795 to
6a8db20
Compare
- add configuration for tor_control_password for onion services
Co-authored-by: roshii <6266997+roshii@users.noreply.github.com>
Co-authored-by: roshii <6266997+roshii@users.noreply.github.com>
6a8db20 to
408124a
Compare
roshii
left a comment
There was a problem hiding this comment.
this looks overall ok, but needs to be covered by unit tests. we want to assess whether it behaves as intended: authenticating via password when provided in config, and via cookie when not.
That sounds more like an integration test than a unit test? Currently AFAICT no part of the tor configuration (including host and port) are currently tested this way and while I agree testing for all of them would be good, it requires significant new testing setup that IMO should be done separately and hopefully not be a blocker for supporting remote tor node. |
should be unit tests.
|
tor_control_passwordfor onion servicesResolves: