You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2024/04/17 13:49:44 UTC

[PR] [improve][broker] Support trusting X-Forwarded-For header for resolving the client IP of http/https requests [pulsar]

lhotari opened a new pull request, #22524:
URL: https://github.com/apache/pulsar/pull/22524

   Fixes #22512
   
   ### Motivation
   
   See #22512. In some environments, there's a HTTP reverse proxy in front of Pulsar Proxy or Pulsar Broker and there's a desire to log the actual client IP addresses instead of the reverse proxy's IP address. For this purpose, it's now possible to configure the broker or proxy to trust the value of the X-Forwarded-For header.
   
   ### Modifications
   
   - Configure [ForwardedRequestCustomizer](https://eclipse.dev/jetty/javadoc/jetty-12/org/eclipse/jetty/server/ForwardedRequestCustomizer.html) for jetty [httpConfiguration](https://github.com/apache/pulsar/blob/20915d1c438783c05778d98a3b77ec485b79d79d/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java#L105) to handle the `X-Forwarded-For` header when `httpServerTrustXForwardedFor=true`.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Support X-Forwarded-For and HA Proxy Protocol for resolving original client IP of http/https requests [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #22524:
URL: https://github.com/apache/pulsar/pull/22524


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Support X-Forwarded-For and HA Proxy Protocol for resolving original client IP of http/https requests [pulsar]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #22524:
URL: https://github.com/apache/pulsar/pull/22524#issuecomment-2064999364

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/22524?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `80.35714%` with `11 lines` in your changes are missing coverage. Please review.
   > Project coverage is 73.86%. Comparing base [(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`62050fd`)](https://app.codecov.io/gh/apache/pulsar/pull/22524?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 165 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/22524/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/22524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #22524      +/-   ##
   ============================================
   + Coverage     73.57%   73.86%   +0.28%     
   - Complexity    32624    33003     +379     
   ============================================
     Files          1877     1885       +8     
     Lines        139502   140185     +683     
     Branches      15299    15379      +80     
   ============================================
   + Hits         102638   103545     +907     
   + Misses        28908    28647     -261     
   - Partials       7956     7993      +37     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/22524/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/22524/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.13% <55.35%> (+2.54%)` | :arrow_up: |
   | [systests](https://app.codecov.io/gh/apache/pulsar/pull/22524/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.42% <37.50%> (+0.09%)` | :arrow_up: |
   | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/22524/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.14% <75.00%> (+0.30%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files](https://app.codecov.io/gh/apache/pulsar/pull/22524?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...org/apache/pulsar/broker/ServiceConfiguration.java](https://app.codecov.io/gh/apache/pulsar/pull/22524?src=pr&el=tree&filepath=pulsar-broker-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2FServiceConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9icm9rZXIvU2VydmljZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `99.39% <100.00%> (+<0.01%)` | :arrow_up: |
   | [...apache/pulsar/proxy/server/ProxyConfiguration.java](https://app.codecov.io/gh/apache/pulsar/pull/22524?src=pr&el=tree&filepath=pulsar-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fproxy%2Fserver%2FProxyConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLXByb3h5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9wdWxzYXIvcHJveHkvc2VydmVyL1Byb3h5Q29uZmlndXJhdGlvbi5qYXZh) | `97.22% <100.00%> (+0.06%)` | :arrow_up: |
   | [.../java/org/apache/pulsar/broker/web/WebService.java](https://app.codecov.io/gh/apache/pulsar/pull/22524?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Fweb%2FWebService.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci93ZWIvV2ViU2VydmljZS5qYXZh) | `94.11% <93.75%> (-0.04%)` | :arrow_down: |
   | [...java/org/apache/pulsar/proxy/server/WebServer.java](https://app.codecov.io/gh/apache/pulsar/pull/22524?src=pr&el=tree&filepath=pulsar-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fproxy%2Fserver%2FWebServer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLXByb3h5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9wdWxzYXIvcHJveHkvc2VydmVyL1dlYlNlcnZlci5qYXZh) | `87.70% <93.75%> (+0.43%)` | :arrow_up: |
   | [...pache/pulsar/proxy/server/ProxyServiceStarter.java](https://app.codecov.io/gh/apache/pulsar/pull/22524?src=pr&el=tree&filepath=pulsar-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fproxy%2Fserver%2FProxyServiceStarter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLXByb3h5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9wdWxzYXIvcHJveHkvc2VydmVyL1Byb3h5U2VydmljZVN0YXJ0ZXIuamF2YQ==) | `68.91% <43.75%> (-1.78%)` | :arrow_down: |
   
   ... and [241 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/22524/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Support X-Forwarded-For and HA Proxy Protocol for resolving original client IP of http/https requests [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #22524:
URL: https://github.com/apache/pulsar/pull/22524#issuecomment-2064489463

   proposal to cherry-pick this to maintenance branches: https://lists.apache.org/thread/9rqh5rmzfcl8lf6rmd1rr6h0t4kp6kpc


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org