EnxDev commented on code in PR #44710:
URL: https://github.com/apache/superset/pull/44710#discussion_r4137502164
##########
superset/models/core.py:
##########
@@ -1515,6 +1515,11 @@ def get_oauth2_config(self) -> OAuth2ClientConfig | None:
logger.error(ex, exc_info=True)
raise SupersetGenericDBErrorException(message=str(ex)) from ex
if oauth2_client_info := encrypted_extra.get("oauth2_client_info"):
+ # Let the engine spec fill values it can derive (e.g. endpoints
from
+ # the connection host) before the schema requires them.
+ oauth2_client_info =
self.db_engine_spec.resolve_oauth2_client_info(
Review Comment:
With the endpoints omitted and no host in the URI, the `OAuth2Error` raised
here goes straight through `is_oauth2_enabled()`, which only catches
`ValidationError`, so it raises where it used to return False.
Some callers run it inside an `except` (`BaseEngineSpec.execute`,
`_handle_oauth2_error`) or during an upgrade
(`migrations/shared/catalogs.py:446`), so those would now blow up instead of
carrying on. Was that intended? If not, catching `OAuth2Error` next to
`ValidationError` there, plus a no-host case for `is_oauth2_enabled`, would
cover it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]