github-advanced-security[bot] commented on code in PR #34831:
URL: https://github.com/apache/superset/pull/34831#discussion_r2296881137


##########
docker/pythonpath_dev/superset_config.py:
##########
@@ -49,11 +49,38 @@
     f"{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_DB}"
 )
 
-SQLALCHEMY_EXAMPLES_URI = (
+# Use environment variable if set, otherwise construct from components
+SQLALCHEMY_EXAMPLES_URI = os.getenv(
+    "SUPERSET__SQLALCHEMY_EXAMPLES_URI",
     f"{DATABASE_DIALECT}://"
     f"{EXAMPLES_USER}:{EXAMPLES_PASSWORD}@"
+    f"{EXAMPLES_HOST}:{EXAMPLES_PORT}/{EXAMPLES_DB}",
+)
+
+# SUPERDEBUG: Log the Docker config override for examples URI
+logger = logging.getLogger(__name__)
+logger.warning(
+    "SUPERDEBUG [docker/pythonpath_dev/superset_config.py]: "
+    "Docker config override - examples database configuration:"
+)
+logger.warning(
+    f"SUPERDEBUG [docker/pythonpath_dev/superset_config.py]: "
+    f"Docker SQLALCHEMY_EXAMPLES_URI = {SQLALCHEMY_EXAMPLES_URI}"
+)
+examples_env_var = os.getenv("SUPERSET__SQLALCHEMY_EXAMPLES_URI", "not set")
+logger.warning(
+    f"SUPERDEBUG [docker/pythonpath_dev/superset_config.py]: "
+    f"Docker environment SUPERSET__SQLALCHEMY_EXAMPLES_URI = 
{examples_env_var}"
+)
+fallback_uri = (
+    f"{DATABASE_DIALECT}://{EXAMPLES_USER}:{EXAMPLES_PASSWORD}@"
     f"{EXAMPLES_HOST}:{EXAMPLES_PORT}/{EXAMPLES_DB}"
 )
+logger.warning(
+    f"SUPERDEBUG [docker/pythonpath_dev/superset_config.py]: "
+    f"Docker fallback would be: {fallback_uri}"

Review Comment:
   ## Clear-text logging of sensitive information
   
   This expression logs [sensitive data (password)](1) as clear text.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2041)



##########
docker/pythonpath_dev/superset_config.py:
##########
@@ -49,11 +49,38 @@
     f"{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_DB}"
 )
 
-SQLALCHEMY_EXAMPLES_URI = (
+# Use environment variable if set, otherwise construct from components
+SQLALCHEMY_EXAMPLES_URI = os.getenv(
+    "SUPERSET__SQLALCHEMY_EXAMPLES_URI",
     f"{DATABASE_DIALECT}://"
     f"{EXAMPLES_USER}:{EXAMPLES_PASSWORD}@"
+    f"{EXAMPLES_HOST}:{EXAMPLES_PORT}/{EXAMPLES_DB}",
+)
+
+# SUPERDEBUG: Log the Docker config override for examples URI
+logger = logging.getLogger(__name__)
+logger.warning(
+    "SUPERDEBUG [docker/pythonpath_dev/superset_config.py]: "
+    "Docker config override - examples database configuration:"
+)
+logger.warning(
+    f"SUPERDEBUG [docker/pythonpath_dev/superset_config.py]: "
+    f"Docker SQLALCHEMY_EXAMPLES_URI = {SQLALCHEMY_EXAMPLES_URI}"

Review Comment:
   ## Clear-text logging of sensitive information
   
   This expression logs [sensitive data (password)](1) as clear text.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2040)



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