scruz-denodo opened a new pull request, #1538:
URL: https://github.com/apache/arrow-java/pull/1538

   ### Rationale for this change
   
   The Flight SQL JDBC driver cannot be configured to connect through an HTTP 
proxy per connection. Other JDBC drivers expose proxy settings as connection 
properties, so this adds equivalent ones.
   This change completes support added at GH-577
   
   ### What changes are included in this PR?
   
   New connection properties:
   
   | Property        | Description                                              
                |
   
|-----------------|--------------------------------------------------------------------------|
   | `useProxy`      | Enables the proxy. The other proxy properties are 
ignored unless `true`. |
   | `proxyHost`     | Proxy host. Required when `useProxy` is `true`.          
                |
   | `proxyPort`     | Proxy port.                                              
                |
   | `proxyUser`     | Optional user for proxy authentication (Basic).          
                |
   | `proxyPassword` | Optional password for proxy authentication.              
                |
   | `nonProxyHosts` | `\|`-separated host patterns that bypass the proxy. 
Supports `*`.        |
   
   - New `FlightProxyDetector` (gRPC `ProxyDetector`) that tunnels connections 
through the configured HTTP CONNECT proxy, overriding the JVM proxy settings.
   - `ArrowFlightConnectionConfigImpl` defines the properties and builds the 
detector. It throws `SQLException` if `useProxy` is set without a host or with 
an invalid port.
   - `ArrowFlightSqlClientHandler.Builder` accepts the detector and keeps it in 
its copy constructor, so connections to other endpoint locations also use the 
proxy.
   - The properties are built-in, so they are not sent to the server as gRPC 
headers.
   - Docs: new "Connecting Through a Proxy" section in 
`flight_sql_jdbc_driver.rst`.
   
   ### Are these changes tested?
   
   Yes:
   
   - `FlightProxyDetectorTest`: `nonProxyHosts` matching and credentials.
   - `ArrowFlightConnectionConfigImplTest`: detector only created with 
`useProxy`, invalid configuration fails, properties are not sent as headers.
   - `ArrowFlightSqlClientHandlerBuilderTest`: default value and copy 
constructor.
   - `ConnectionProxyTest`: end-to-end tests against a real `FlightServer` 
through a minimal HTTP CONNECT proxy defined in the test (proxy used, direct 
connection, `Proxy-Authorization`, failure cases).
   
   ### Are there any user-facing changes?
   
   Yes: new optional JDBC connection properties, documented in 
`docs/source/flight_sql_jdbc_driver.rst`. Default behavior is unchanged without 
`useProxy=true`.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to