scruz-denodo opened a new issue, #1384: URL: https://github.com/apache/arrow-java/issues/1384
### Describe the enhancement requested ### Describe the enhancement requested The Flight SQL JDBC driver can use the JVM proxy settings (https.proxyHost, https.proxyPort, http.nonProxyHosts, …). This support recently added with https://github.com/apache/arrow-java/pull/1027 apply to the whole JVM. They are awkward in these situations: - Several JDBC connections in the same JVM need different proxies, or some need none. - The application runs in a tool or server where the JVM flags can't be changed, such as a BI tool or a JDBC client IDE. - The proxy needs credentials. The JVM properties don't cover proxy authentication for grpc. I propose connection properties that, when enabled, take precedence over the JVM settings. ## Proposed properties | Property | Type | Default | Description | |---|---|---|---| | `useProxy` | boolean | `false` | Enables the proxy properties below. When `false`, they are ignored and the current behavior (JVM settings) is unchanged. | | `proxyHost` | string | none | Proxy host. Required when `useProxy=true`, unless `nonProxyHosts` is `*`. | | `proxyPort` | int | none | Proxy port (1–65535). Required when `proxyHost` is set. | | `proxyUser` | string | none | User for proxy authentication. | | `proxyPassword` | string | none | Password for proxy authentication. It must be set together with `proxyUser`. | | `proxyProtocol` | string | `http` | Protocol used to connect to the proxy. Other values are rejected with a `SQLException`. | | `nonProxyHosts` | string | none | `\|`-separated host patterns that bypass the proxy. `*` is a wildcard and a leading `.` matches subdomains. A value of `*` means direct connections for all hosts. | Example: ``` jdbc:arrow-flight-sql://flight.example.com:443?useEncryption=true&useProxy=true&proxyHost=proxy.corp&proxyPort=3128&proxyUser=me&proxyPassword=secret&nonProxyHosts=localhost|*.internal ``` ## Implementation - Add the properties to ArrowFlightConnectionProperty. They must not be sent as call headers. - Add a FlightProxyDetector that implements gRPC's ProxyDetector. It returns an HttpConnectProxiedSocketAddress, with credentials when they are set, or null for hosts that match nonProxyHosts. - Add ArrowFlightSqlClientHandler.Builder#withProxyDetector. It calls NettyChannelBuilder.proxyDetector(...) only when a detector is set, and it is retained when the builder is copied. - Validate the configuration when the connection is created. Invalid configurations throw SQLException with a clear message. - Add a unit test for the detector. ## Status With the help of Claude we have already implemented this in a fork, including the tests. If the proposal is acceptable, we can open open a PR. We would adjust the property names. -- 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]
