Merge pull request #18595 from erik-krogh/erik-krogh/clear-text-example

JS: fix example in clear-text-logging qhelp to actually be bad
This commit is contained in:
Erik Krogh Kristensen
2025-01-27 11:45:50 +01:00
committed by GitHub
4 changed files with 11 additions and 2 deletions

View File

@@ -1,2 +1,2 @@
// BAD: Logging cleartext sensitive data
console.info(`[INFO] Environment: ${process.env}`);
console.info(`[INFO] Environment: ${JSON.stringify(process.env)}`);

View File

@@ -1,3 +1,3 @@
let not_sensitive_data = { a: 1, b : 2}
// GOOD: it is fine to log data that is not sensitive
console.info(`[INFO] Some object contains: ${not_sensitive_data}`);
console.info(`[INFO] Some object contains: ${JSON.stringify(not_sensitive_data)}`);