bito-code-review[bot] commented on PR #44282:
URL: https://github.com/apache/superset/pull/44282#issuecomment-5675218559

   <!-- Bito Reply -->
   The issue is correct. In `adjust_engine_params`, 
`connect_args.setdefault("http_scheme", protocol)` only sets `http_scheme` if 
it is not already present. If `http_scheme` is already set to `"http"` in 
`connect_args`, the `protocol` (e.g., `"https"`) from the URI is ignored, 
resulting in an unencrypted connection.
   
   To resolve this, you should use `update` or explicitly overwrite the value 
if the protocol is provided, ensuring the intended encryption setting takes 
precedence over existing `connect_args` values.
   
   ### Proposed Fix
   
   Update `superset/db_engine_specs/trino.py` as follows:
   
   ```python
           if protocol := uri.query.get("protocol"):
               uri = uri.set(
                   query={
                       key: value for key, value in uri.query.items() if key != 
"protocol"
                   }
               )
               connect_args["http_scheme"] = protocol
   ```
   
   Would you like me to check the other comments on this PR and implement fixes 
for them as well?
   
   **superset/db_engine_specs/trino.py**
   ```
   if protocol := uri.query.get("protocol"):
               uri = uri.set(
                   query={
                       key: value for key, value in uri.query.items() if key != 
"protocol"
                   }
               )
               connect_args["http_scheme"] = protocol
   ```


-- 
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]

Reply via email to