<#1340 fix: treat an empty device authorization en...
# flyte-github
a
#1340 fix: treat an empty device authorization endpoint as unavailable (FLYTE-SDK-6P) Pull request opened by EngHabu
RemoteClientConfigStore.get_client_config
fills
device_authorization_endpoint
from the OAuth2 metadata proto. When the auth server does not advertise one, proto3 gives back the default
""
— not
None
.
DeviceCodeAuthenticator._do_refresh_credentials
guarded with
is None
, so the empty string fell straight through to
token_client.get_device_code("")
and httpx raised:
Copy code
UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
which then bubbled up as
RuntimeError: SelectCluster failed for operation=1: Request URL is missing an 'http://' ...
→
RuntimeSystemError: Upload failed for ...
and got crash-reported to Sentry as an SDK bug, instead of hitting the actionable
AuthenticationError
that is already right there. Fix: guard on falsiness. This matches
ClientConfig.merge
, which already uses
or
on the same field, so
""
was always intended to mean "absent". Tests: parametrized regression test over
None
and
""
asserting
get_device_code
is never reached and the actionable
AuthenticationError
is raised. The
""
case fails on
main
. fixes FLYTE-SDK-6P flyteorg/flyte-sdk