Vitor-Avila commented on code in PR #37398:
URL: https://github.com/apache/superset/pull/37398#discussion_r2748390743
##########
superset/db_engine_specs/gsheets.py:
##########
@@ -335,9 +407,19 @@ def validate_parameters(
return errors
try:
+ url = url.replace('"', '""')
results = conn.execute(f'SELECT * FROM "{url}" LIMIT 1') #
noqa: S608
results.fetchall()
except Exception: # pylint: disable=broad-except
+ # OAuth2 connection check
+ # Check `parameters` first (used by frontend during form
validation)
+ if parameters.get("oauth2_client_info"):
+ continue
+ # Check `masked_encrypted_extra` (for create/update events)
+ encrypted =
json.loads(properties.get("masked_encrypted_extra", "{}"))
Review Comment:
yeah, that's a great catch! Also, now thinking about this, it doesn't really
make sense to validate URL by URL here (the admin could be adding a sheet they
don't have access on behalf of another user that can't edit the connection, or
they don't have the token in which all would fail).
Let's short-circuit!
--
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]