Skip to content
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

Merged
merged 2 commits into from Sep 7, 2019
Merged

feat: centralized sanitation #4446

merged 2 commits into from Sep 7, 2019

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented Sep 7, 2019

Adds a sanitize function to host-rules that redacts tokens and passwords from issues and PRs.

Closes #4444

Adds a sanitize function to host-rules that redacts tokens and passwords from issues and PRs.

Closes #4444
@rarkins rarkins merged commit 95d54ba into master Sep 7, 2019
@rarkins rarkins deleted the feat/sanitize branch September 7, 2019 12:51
@renovate-bot
Copy link
Collaborator

🎉 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}`);
Copy link
Member

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;
Copy link
Member

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

Copy link
Member

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(
Copy link
Member

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add centralized secret sanitation
3 participants