yarpc / yarpc-go

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

[7/n] tls: integrate http outbound tls #2177

Closed jronak closed 1 year ago

jronak commented 1 year ago

HTTP outbounds can be configured with client-provided TLS config via the OutboundTLSConfigProvider interface. Services can configure the outbound TLS like:

yarpc:
  outbounds:
    test-svc:
      http:
         url: http://127.0.0.1:5453
         tls:
           mode: enforced
           spiffe-ids:
             - spiffe-id-1

Spiffe-ids provided in the config above are passed to OutboundTLSConfigProvider.ClientTLSConfig to fetch the client TLS config for the outbound. This PR also exposes the following HTTP options:

For reviews, follow this order:

codecov[bot] commented 1 year ago

Codecov Report

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

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #2177 +/- ## ========================================== + Coverage 85.24% 85.29% +0.04% ========================================== Files 269 269 Lines 15353 15397 +44 ========================================== + Hits 13088 13133 +45 + Misses 1845 1843 -2 - Partials 420 421 +1 ``` | [Impacted Files](https://codecov.io/gh/yarpc/yarpc-go/pull/2177?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc) | Coverage Δ | | |---|---|---| | [transport/http/outbound.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2177/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L2h0dHAvb3V0Ym91bmQuZ28=) | `92.03% <92.00%> (-0.06%)` | :arrow_down: | | [transport/http/config.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2177/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L2h0dHAvY29uZmlnLmdv) | `95.74% <100.00%> (+0.93%)` | :arrow_up: | | [transport/http/transport.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2177/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L2h0dHAvdHJhbnNwb3J0Lmdv) | `93.52% <100.00%> (+0.19%)` | :arrow_up: | | [transport/tchannel/peer.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2177/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L3RjaGFubmVsL3BlZXIuZ28=) | `96.05% <0.00%> (-1.32%)` | :arrow_down: | | [transport/http/peer.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2177/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L2h0dHAvcGVlci5nbw==) | `97.14% <0.00%> (+1.90%)` | :arrow_up: | | [transport/internal/tls/muxlistener/listener.go](https://codecov.io/gh/yarpc/yarpc-go/pull/2177/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yarpc#diff-dHJhbnNwb3J0L2ludGVybmFsL3Rscy9tdXhsaXN0ZW5lci9saXN0ZW5lci5nbw==) | `95.91% <0.00%> (+2.04%)` | :arrow_up: | 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.