Skip to content
Snippets Groups Projects
Unverified Commit f630963e authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

logs: hostRules add/clear (#9644)

parent f654f2d9
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,16 @@ export function add(params: HostRule): void { ...@@ -18,6 +18,16 @@ export function add(params: HostRule): void {
} }
hostRules.push(params); hostRules.push(params);
const confidentialFields = ['password', 'token']; const confidentialFields = ['password', 'token'];
const ruleMatch = params.baseUrl || params.hostName || params.domainName;
if (ruleMatch) {
confidentialFields.forEach((field) => {
if (params[field]) {
logger.debug(
`Adding ${field} authentication for ${ruleMatch} to hostRules`
);
}
});
}
confidentialFields.forEach((field) => { confidentialFields.forEach((field) => {
const secret = params[field]; const secret = params[field];
if (secret && secret.length > 3) { if (secret && secret.length > 3) {
...@@ -163,6 +173,7 @@ export function findAll({ hostType }: { hostType: string }): HostRule[] { ...@@ -163,6 +173,7 @@ export function findAll({ hostType }: { hostType: string }): HostRule[] {
} }
export function clear(): void { export function clear(): void {
logger.debug('Clearing hostRules');
hostRules = []; hostRules = [];
sanitize.clear(); sanitize.clear();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment