GitHub user dosubot[bot] added a comment to the discussion: How to Mask Passwords in Superset Action Log (DatabaseRestApi.import_)
<!-- Answer --> Your masking function works because it checks for sensitive key names (like "passwords") and replaces their values—no matter if they're strings, dicts, or anything else. As long as your function preserves the structure of the payload (including lists under "records"), Superset's logger will not skip any log entries. Removing explicit handling of "records" is safe in this setup. There’s no built-in masking for logs in Superset, so your approach is both effective and efficient for typical payloads. The only caveat is if secrets are deeply nested inside a stringified JSON value (not just as the value of a "passwords" key), those would not be masked unless you add explicit parsing for those cases—but this does not cause skipped logs, just unmasked secrets if present. Your implementation matches what’s needed for Superset event logging and is in line with community recommendations [reference](https://github.com/apache/superset/issues/35355). Let me know if you want to discuss any edge cases or further improve the masking! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c5992247-d2e3-4fc9-af31-8832f67cdc1b?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)& nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/35415) GitHub link: https://github.com/apache/superset/discussions/35415#discussioncomment-14581027 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
