-
Notifications
You must be signed in to change notification settings - Fork 191
tor: allow authenticating to control port using hashedpassword auth #1799
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
base: master
Are you sure you want to change the base?
Conversation
fa07bd7 to
a503472
Compare
roshii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: