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