rad-pat commented on code in PR #28627:
URL: https://github.com/apache/superset/pull/28627#discussion_r1967582437
##########
superset/db_engine_specs/databend.py:
##########
@@ -217,10 +217,11 @@ class DatabendConnectEngineSpec(BasicParametersMixin,
DatabendEngineSpec):
_function_names: list[str] = []
sqlalchemy_uri_placeholder = (
-
"databend://user:password@host[:port][/dbname][?secure=value&=value...]"
+
"databend://user:password@host[:port][/dbname][?sslmode=value&=value...]"
)
parameters_schema = DatabendParametersSchema()
- encryption_parameters = {"secure": "true"}
+ encryption_parameters = {"sslmode": "require"}
+ encryption_disable_parameters = {"sslmode": "disable"}
Review Comment:
@betodealmeida, it seems straightforward to add the
`encryption_disable_parameters` to the mixin, and to use it in
`build_sqlalchemy_uri` based on `encryption` True/False parameter, but I'm not
sure how to use it sensibly in `get_parameters_from_uri` - either encryption
param is True or False determined by if the `encryption_parameters` are set.
Here is where I'm struggling to make sense of it. I'm not sure a separate
parameter makes sense
```
def get_parameters_from_uri( # pylint: disable=unused-argument
cls, uri: str, encrypted_extra: dict[str, Any] | None = None
) -> BasicParametersType:
url = make_url_safe(uri)
query = {
key: value
for (key, value) in url.query.items()
if (key, value) not in cls.encryption_parameters.items()
}
encryption = bool(cls.encryption_parameters) and all(
item in url.query.items() for item in
cls.encryption_parameters.items()
)
# The opposite, does this make sense?
disable_encryption = bool(cls.encryption_disable_parameters) and all(
item in url.query.items()
for item in cls.encryption_disable_parameters.items()
)
return {
"username": url.username,
"password": url.password,
"host": url.host,
"port": url.port,
"database": url.database,
"query": query,
"encryption": encryption # and not disable_encryption,
}
```
--
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]