mirror of https://github.com/certd/certd
perf: 关闭腾讯云证书通知提醒
parent
378c777a38
commit
231a875bb4
|
@ -49,7 +49,7 @@ export class TencentSslClient {
|
||||||
};
|
};
|
||||||
const ret = await client.UploadCertificate(params);
|
const ret = await client.UploadCertificate(params);
|
||||||
this.checkRet(ret);
|
this.checkRet(ret);
|
||||||
this.logger.info("证书上传成功:tencentCertId=", ret.CertificateId);
|
this.logger.info(`证书[${opts.certName}]上传成功:tencentCertId=`, ret.CertificateId);
|
||||||
await this.switchCertNotify([ret.CertificateId], true);
|
await this.switchCertNotify([ret.CertificateId], true);
|
||||||
return ret.CertificateId;
|
return ret.CertificateId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
|
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
||||||
import dayjs from 'dayjs';
|
import dayjs from "dayjs";
|
||||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
|
||||||
|
import { TencentAccess, TencentSslClient } from "@certd/plugin-lib";
|
||||||
|
|
||||||
@IsTaskPlugin({
|
@IsTaskPlugin({
|
||||||
name: 'UploadCertToTencent',
|
name: 'UploadCertToTencent',
|
||||||
title: '腾讯云-上传证书到腾讯云',
|
title: '腾讯云-上传证书到腾讯云',
|
||||||
|
@ -14,8 +16,8 @@ import { CertApplyPluginNames} from '@certd/plugin-cert';
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export class UploadCertToTencent extends AbstractTaskPlugin {
|
export class UploadCertToTencent extends AbstractTaskPlugin {
|
||||||
@TaskInput({ title: '证书名称' })
|
// @TaskInput({ title: '证书名称' })
|
||||||
name!: string;
|
// name!: string;
|
||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: 'Access授权',
|
title: 'Access授权',
|
||||||
|
@ -51,19 +53,19 @@ export class UploadCertToTencent extends AbstractTaskPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const { accessId, name, cert } = this;
|
const access = await this.getAccess<TencentAccess>(this.accessId);
|
||||||
const accessProvider = await this.getAccess(accessId);
|
const sslClient = new TencentSslClient({
|
||||||
const certName = this.appendTimeSuffix(name || cert.domain);
|
access,
|
||||||
const client = this.getClient(accessProvider);
|
logger: this.logger,
|
||||||
|
});
|
||||||
|
|
||||||
const params = {
|
const certReader = new CertReader(this.cert);
|
||||||
CertificatePublicKey: cert.crt,
|
const tencentCertId = await sslClient.uploadToTencent({
|
||||||
CertificatePrivateKey: cert.key,
|
certName: certReader.buildCertName(),
|
||||||
Alias: certName,
|
cert: this.cert,
|
||||||
};
|
});
|
||||||
const ret = await client.UploadCertificate(params);
|
|
||||||
this.checkRet(ret);
|
this.logger.info('证书上传成功:tencentCertId=', tencentCertId);
|
||||||
this.logger.info('证书上传成功:tencentCertId=', ret.CertificateId);
|
|
||||||
|
|
||||||
this.tencentCertId = ret.CertificateId;
|
this.tencentCertId = ret.CertificateId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue