rusackas commented on code in PR #40654:
URL: https://github.com/apache/superset/pull/40654#discussion_r3364691586


##########
superset/utils/encrypt.py:
##########
@@ -65,6 +78,19 @@
         **kwargs: Optional[dict[str, Any]],
     ) -> TypeDecorator:
         if app_config:
+            # Select the encryption engine from config, defaulting to the
+            # historical AES-CBC engine for backward compatibility. An explicit
+            # ``engine`` kwarg (e.g. from the migrator) always takes 
precedence.
+            if "engine" not in kwargs:
+                engine_name = 
app_config.get("SQLALCHEMY_ENCRYPTED_FIELD_ENGINE", "aes")
+                if engine_name not in ENCRYPTION_ENGINES:
+                    logger.warning(
+                        "Unrecognized SQLALCHEMY_ENCRYPTED_FIELD_ENGINE %r;"
+                        " falling back to AES-CBC. Valid engines: %s",
+                        engine_name,

Review Comment:
   Fixed in 731a476 — the unrecognized-engine warning no longer interpolates 
the config-sourced engine value into the log message; it just lists the valid 
engine names, which is enough to diagnose a typo. That removes the 
tainted-config-value-into-log flow CodeQL traced (the config dict also holds 
SECRET_KEY).



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