mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
feat: Trino Authentications (#17593)
* feat: support Trino Authentications Signed-off-by: Đặng Minh Dũng <dungdm93@live.com> * docs: Trino Authentications Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
This commit is contained in:
@@ -1273,6 +1273,26 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
||||
raise ex
|
||||
return extra
|
||||
|
||||
@staticmethod
|
||||
def update_encrypted_extra_params(
|
||||
database: "Database", params: Dict[str, Any]
|
||||
) -> None:
|
||||
"""
|
||||
Some databases require some sensitive information which do not conform to
|
||||
the username:password syntax normally used by SQLAlchemy.
|
||||
|
||||
:param database: database instance from which to extract extras
|
||||
:param params: params to be updated
|
||||
"""
|
||||
if not database.encrypted_extra:
|
||||
return
|
||||
try:
|
||||
encrypted_extra = json.loads(database.encrypted_extra)
|
||||
params.update(encrypted_extra)
|
||||
except json.JSONDecodeError as ex:
|
||||
logger.error(ex, exc_info=True)
|
||||
raise ex
|
||||
|
||||
@classmethod
|
||||
def is_readonly_query(cls, parsed_query: ParsedQuery) -> bool:
|
||||
"""Pessimistic readonly, 100% sure statement won't mutate anything"""
|
||||
|
||||
Reference in New Issue
Block a user