mirror of
https://github.com/certd/certd.git
synced 2026-04-22 19:12:21 +08:00
chore: 敏感数据隐藏输出
This commit is contained in:
@@ -77,6 +77,8 @@ export type ILogger = {
|
||||
fatal(message: any, ...args: any[]): void;
|
||||
|
||||
mark(message: any, ...args: any[]): void;
|
||||
|
||||
addSecret(secret: string): void;
|
||||
};
|
||||
|
||||
const locale = Intl.DateTimeFormat().resolvedOptions().locale;
|
||||
@@ -106,10 +108,14 @@ export class PipelineLogger implements ILogger {
|
||||
|
||||
constructor(name: string, write: (text: string) => void) {
|
||||
this.customWriter = write;
|
||||
//@ts-ignore
|
||||
this.logger = log4js.getLogger(name);
|
||||
}
|
||||
|
||||
addSecret(secret: string) {
|
||||
if (!secret) {
|
||||
return;
|
||||
}
|
||||
this._secrets.push(secret);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
abstract doCertApply(): Promise<CertReader>;
|
||||
|
||||
async execute(): Promise<string | void> {
|
||||
this.logger.addSecret(this.pfxPassword);
|
||||
const oldCert = await this.condition();
|
||||
if (oldCert != null) {
|
||||
await this.output(oldCert, false);
|
||||
|
||||
Reference in New Issue
Block a user