New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: centralized sanitation #4446
Conversation
🎉 This PR is included in version 19.39.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
try { | ||
const comments = await getComments(issueNo); | ||
let body: string; | ||
let commentId: number | null = null; | ||
let commentNeedsUpdating = false; | ||
if (topic) { | ||
logger.debug(`Ensuring comment "${topic}" in #${issueNo}`); | ||
body = `### ${topic}\n\n${content}`; | ||
body = hostRules.sanitize(`### ${topic}\n\n${content}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate sanitize?
logger.debug(`updatePr(${prNo}, ${title}, body)`); | ||
const body = rawBody ? hostRules.sanitize(rawBody) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hostRules.sanitize
already checks for null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
body
string should be removed from log.
do we need to rename params? Can we simply move the sanitize to the if below?
secrets.push(secret); | ||
}); | ||
if (params.username && params.password) { | ||
const secret = Buffer.from( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this to a util function, because i've seen this on some more places.
Adds a sanitize function to host-rules that redacts tokens and passwords from issues and PRs.
Closes #4444