Hello Alexey Serbin, Jason Fehr, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

    https://gerrit.cloudera.org/25247

to look at the new patch set (#3).

Change subject: IMPALA-14331: Support proxy for JWKS URL download
......................................................................

IMPALA-14331: Support proxy for JWKS URL download

Add an optional jwksProxy field to --oauth_servers entries so the JWKS
can be downloaded from jwksUrl through a proxy, e.g.
"https://proxy.example.com:3128"; or "socks5h://proxy.example.com:1080".
The value is passed to libcurl's CURLOPT_PROXY as is, so any proxy
format libcurl supports can be used, and libcurl validates it when the
JWKS is downloaded. The proxy is used both for the initial download at
startup and for the periodic JWKS refresh.

Previously, the JWKS download could not use a proxy at all: EasyCurl
sets CURLOPT_NOPROXY to "*" by default, so even the http_proxy and
https_proxy environment variables were ignored. EasyCurl now has
set_proxy() and set_proxy_pinned_public_key() setters, and the noproxy
setting is still applied whenever it is not empty. When jwksProxy is
set, the JWKS download clears the noproxy setting, so hosts listed in
the no_proxy environment variable bypass the proxy. The TLS certificate
of an https proxy is verified according to verifyServerCert and
caCertFilePath. Without jwksProxy, the behavior is unchanged.

Add an optional jwksProxyPinnedPublicKey field that sets
CURLOPT_PROXY_PINNEDPUBLICKEY, so the public key of an https proxy can
be pinned with either a PEM/DER public key file or a
"sha256//<base64 hash>" value. It requires jwksProxy.

The startup log line now always reports the JWKS URL being downloaded,
and it and the startup and refresh errors include the proxy URL when
one is used, to ease troubleshooting. Any user name and password in the proxy
URL are removed first using libcurl's URL API.

Testing:
- Added OAuthServerConfigTest cases for parsing jwksProxy and
  jwksProxyPinnedPublicKey.
- Added JwtUtilTest cases that download the JWKS from an unresolvable
  host through a fake HTTP proxy, check that no_proxy is honored, that
  an unreachable proxy fails with a clear error that omits proxy
  credentials, and that proxy environment variables are still ignored
  without jwksProxy.
- Added custom cluster tests to TestImpalaShellOAuthServersAuth that run
  impalad with JWT auth and download the JWKS from an unresolvable host
  through an http proxy (absolute-form and CONNECT tunnel to an https
  JWKS URL), an https proxy with a verified certificate, with and
  without a pinned public key, and a socks5h proxy, and that impalad
  fails to start with an unreachable proxy, an https proxy whose
  certificate is not trusted via caCertFilePath, or a wrong pinned
  public key.
- Linux: be/build/debug/util/oauth-server-config-test (22 passed),
  be/build/debug/util/jwt-util-test (32 passed) and
  be/build/debug/util/oauth-servers-manager-test (10 passed).
- Linux: impala-py.test
  tests/custom_cluster/test_shell_oauth_servers_auth.py (11 passed).
- Linux: impala-py.test tests/custom_cluster/test_shell_jwt_auth.py
  tests/custom_cluster/test_shell_oauth_auth.py (8 passed).

Change-Id: I6741b8e107f707d3fcc0a9e15ac01b5769191924
Assisted-by: Claude Opus 5.5 (Cursor)
---
M be/src/kudu/util/curl_util.cc
M be/src/kudu/util/curl_util.h
M be/src/util/jwt-util-internal.h
M be/src/util/jwt-util-test.cc
M be/src/util/jwt-util.cc
M be/src/util/jwt-util.h
M be/src/util/oauth-server-config-test.cc
M be/src/util/oauth-server-config.cc
M be/src/util/oauth-server-config.h
M be/src/util/oauth-servers-manager.cc
M tests/custom_cluster/test_shell_oauth_servers_auth.py
A tests/util/proxy_servers.py
12 files changed, 855 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/47/25247/3
--
To view, visit https://gerrit.cloudera.org/25247
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6741b8e107f707d3fcc0a9e15ac01b5769191924
Gerrit-Change-Number: 25247
Gerrit-PatchSet: 3
Gerrit-Owner: Anubhav Jindal <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>

Reply via email to