codeant-ai-for-open-source[bot] commented on code in PR #42803:
URL: https://github.com/apache/superset/pull/42803#discussion_r3737917373
##########
superset/models/core.py:
##########
@@ -708,7 +714,14 @@ def _get_sqla_engine( # pylint: disable=too-many-locals
# noqa: C901
if cacheable and self.id is not None:
cache_key = (
self.id,
- str(sqlalchemy_url),
+ # SQLAlchemy 2.0 changed str(URL) to always substitute
+ # "***" for the password rather than rendering the real
+ # value (str(url) under 1.4). Using it here would make
+ # the cache key blind to password rotation - the module
+ # comment above depends on the key changing when the
+ # password does, so render_as_string(hide_password=False)
+ # is required to preserve that behavior.
+ sqlalchemy_url.render_as_string(hide_password=False),
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> Do not flag unmasked SQLAlchemy URLs in the engine cache key when the key
must change on password rotation; the cached Engine already retains the
credential and hashing would not reduce overall exposure.
**Applied to:**
- `superset/models/core.py`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]