dpgaspar commented on a change in pull request #9396: feat: add SSL certificate
validation for Druid
URL:
https://github.com/apache/incubator-superset/pull/9396#discussion_r398536762
##########
File path: superset/db_engine_specs/druid.py
##########
@@ -47,3 +49,18 @@ class DruidEngineSpec(BaseEngineSpec): # pylint:
disable=abstract-method
def alter_new_orm_column(cls, orm_col: "TableColumn") -> None:
if orm_col.column_name == "__time":
orm_col.is_dttm = True
+
+ @classmethod
+ def mutate_connection_args(
+ cls, database: "Database", connect_args: Dict[str, Any]
+ ) -> None:
+ """
+ Some databases require passing additional non-standard parameters to
database
+ connections, for example client certificates.
+
+ :param database: instance to be mutated
+ """
+ if database.server_cert:
+ connect_args["scheme"] = "https"
+ path = utils.create_temporary_ssl_cert_file(database.server_cert)
+ connect_args["ssl_verify_cert"] = path
Review comment:
Is it ok here to fail with `KeyError` ? If yes, we could create a specific
exception wrap and re-raise then on the "abstract" for `mutate_connection_args`
document `:raises: FooExcetion`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]