chore: improve schema security (#23385)

This commit is contained in:
Beto Dealmeida
2023-03-17 08:05:50 -07:00
committed by GitHub
parent d4657f6198
commit 42e8d1b498
17 changed files with 346 additions and 26 deletions

View File

@@ -98,7 +98,7 @@ class HiveEngineSpec(PrestoEngineSpec):
allows_alias_to_source_column = True
allows_hidden_orderby_agg = False
dynamic_schema = True
supports_dynamic_schema = True
# When running `SHOW FUNCTIONS`, what is the name of the column with the
# function names?
@@ -268,6 +268,17 @@ class HiveEngineSpec(PrestoEngineSpec):
return uri
@classmethod
def get_schema_from_engine_params(
cls,
sqlalchemy_uri: URL,
connect_args: Dict[str, Any],
) -> Optional[str]:
"""
Return the configured schema.
"""
return parse.unquote(sqlalchemy_uri.database)
@classmethod
def _extract_error_message(cls, ex: Exception) -> str:
msg = str(ex)