Skip to content

Commit

Permalink
Merge pull request #134 from Meowhal/hotfix-issue130
Browse files Browse the repository at this point in the history
removed password and token from log
  • Loading branch information
Meowhal authored Jun 3, 2022
2 parents c45c2fa + bfbf318 commit 0a990cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/TypedConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const configLogger = getLogger('cfg');

export const CONFIG_OPTION = {
USE_ENV: false,
PRINT_LOADED_ENV_CONFIG: true,
PRINT_LOADED_ENV_CONFIG: false,
};

export interface IAhrConfig {
Expand Down Expand Up @@ -128,7 +128,11 @@ export function loadEnvConfigWithTypeHint(category: string, hints: ConfigTypeHin
}
if (CONFIG_OPTION.PRINT_LOADED_ENV_CONFIG) {
for (const key in r) {
configLogger.info(`Loaded environment key: ${genEnvKey(category, key)}=${r[key]}`);
if (key.toLocaleLowerCase().match(/(password)|(token)/)) {
configLogger.info(`Loaded environment key: ${genEnvKey(category, key)}=${'*'.repeat(r[key]?.toString().length ?? 3)}`);
} else {
configLogger.info(`Loaded environment key: ${genEnvKey(category, key)}=${r[key]}`);
}
}
}
return r;
Expand Down

0 comments on commit 0a990cd

Please sign in to comment.