<#1185 test(remote): guard ClusterAwareDataProxy a...
# flyte-github
a
#1185 test(remote): guard ClusterAwareDataProxy against PKCE downgrade at cluster endpoint Pull request opened by pingsutw Why When
ClusterService.SelectCluster
routes a dataproxy call to a per-cluster endpoint,
ClusterAwareDataProxy._select_and_build
rebuilds a
SessionConfig
for that cluster. Before #1121 (first released in v2.3.9) that rebuild forwarded only the
api_key
, so a ClientSecret session configured via
flytectl-union.yaml
(with no api_key to fall back on) silently downgraded to the default
auth_type="Pkce"
— triggering a browser login during code-bundle upload/registration. The fix (forwarding the full
auth_kwargs
snapshot, including
auth_type
) is already in
main
. However, the existing tests only cover the two halves in isolation: • capture —
create_session_config
snapshots
auth_kwargs
(
test_session.py
) • forwarding —
_select_and_build
splats them back, but with
create_session_config
mocked (
test_cluster_aware_dataproxy.py
) Nothing proved the integrated chain, so a rename/refactor of either half could silently reintroduce the PKCE downgrade. What Adds one end-to-end regression test,
test_clientsecret_session_does_not_downgrade_to_pkce_at_cluster_endpoint
, that runs the real
create_session_config
for both the control-plane session and the rebuilt per-cluster session, asserting neither falls back to PKCE (
['ClientSecret', 'ClientSecret']
). Both auth flows are stubbed, so no network or browser interaction occurs. Test plan •
pytest tests/flyte/remote/test_cluster_aware_dataproxy.py
→ 13 passed • Mutation check: removing
**auth_kwargs
forwarding (reverting to the 2.3.6 behavior) makes the new test fail with exactly
['ClientSecret', 'Pkce']
, confirming it guards the regression. Test-only change; no production code touched. flyteorg/flyte-sdk