yarpc / yarpc-go

A message passing platform for Go
MIT License
401 stars 101 forks source link

[2/n] tchannel-mtls: add outbound channel #2182

Closed jronak closed 1 year ago

jronak commented 1 year ago

Tchannel does not have first-class support for TLS, so we instead pass a custom dialer that internally creates a TLS connection + handshake and returns net.Conn back to tchannel. Each outbound must have a custom dialer with its outbound-specific TLS config. But as tchannel manages outbound connections internally, it's not possible to pass a custom dialer per connection.

To get around it, Yarpc will create a new tchannel.Channel per outbound with a custom dialer and use it for managing outbound level TLS connections.

This pull request adds outbound channel that manages a tchannel.Channel with custom dialer per outbound. It implements peer.Transport used in PeerChooser creation.

Outbound integration will be done in the next pull request.

For reviewers, please review this sequence of files:

codecov[bot] commented 1 year ago

Codecov Report

Base: 85.29% // Head: 85.29% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (ef4a63c) compared to base (b63d183). Patch coverage: 95.34% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #2182 +/- ## ======================================= Coverage 85.29% 85.29% ======================================= Files 269 270 +1 Lines 15397 15433 +36 ======================================= + Hits 13133 13164 +31 - Misses 1844 1847 +3 - Partials 420 422 +2 ``` | [Impacted Files](https://codecov.io/gh/yarpc/yarpc-go/pull/2182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc) | Coverage Δ | | |---|---|---| | [transport/tchannel/transport.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L3RjaGFubmVsL3RyYW5zcG9ydC5nbw==) | `86.48% <88.88%> (+0.02%)` | :arrow_up: | | [transport/tchannel/outbound\_channel.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L3RjaGFubmVsL291dGJvdW5kX2NoYW5uZWwuZ28=) | `100.00% <100.00%> (ø)` | | | [transport/tchannel/peer.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L3RjaGFubmVsL3BlZXIuZ28=) | `97.67% <100.00%> (-1.11%)` | :arrow_down: | | [peer/hashring32/internal/hashring32/hashring32.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-cGVlci9oYXNocmluZzMyL2ludGVybmFsL2hhc2hyaW5nMzIvaGFzaHJpbmczMi5nbw==) | `96.21% <0.00%> (-1.09%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.