-
Notifications
You must be signed in to change notification settings - Fork 312
Add ZMQ Curve for transport encryption #1110
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: main
Are you sure you want to change the base?
Changes from 11 commits
1d2255d
2e84f9c
d2a7b2b
fb28ce5
683aa8e
f73224d
6f06bc5
42420c6
81a2daa
460d7c5
71fdbf9
9dc0b71
7deb5e4
8b5d6d6
68a485a
129fe04
f3a4b97
c8e1b8a
772f4b4
2a5f8ee
242c6b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -392,8 +392,21 @@ def hb_channel(self) -> t.Any: | |
| if self._hb_channel is None: | ||
| url = self._make_url("hb") | ||
| self.log.debug("connecting heartbeat channel to %s", url) | ||
| hb_supports_curve = ( | ||
| "curve_serverkey" in inspect.signature(self.hb_channel_class.__init__).parameters | ||
| ) | ||
| if self._curve_publickey is not None and not hb_supports_curve: | ||
| msg = ( | ||
| f"{self.hb_channel_class.__name__} does not support the " | ||
| "'curve_serverkey' parameter. Upgrade the heartbeat channel " | ||
| "class or disable CurveZMQ encryption." | ||
| ) | ||
| raise RuntimeError(msg) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to inspect for hb_kwargs = {}
if self._curve_publickey:
hb_kwargs["curve_serverkey"] = self._curve_publickey
...
hb_channel_class(...**hb_kwargs)but fine if you want to keep the more detailed error. But if you hit that error, a lot of other things are not going to work before we get to the hb channel, I think.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with both; as long as we know there are some backward compatibility story here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does 8b5d6d6 work? |
||
| self._hb_channel = self.hb_channel_class( # type:ignore[call-arg,abstract] | ||
| self.context, self.session, url | ||
| self.context, | ||
| self.session, | ||
| url, | ||
| **({"curve_serverkey": self._curve_publickey} if hb_supports_curve else {}), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That triggers me to want to resume working on a pep for |
||
| ) | ||
| return self._hb_channel | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.