pref: 日志中加密授权信息输出替换成星号

This commit is contained in:
xiaojunnuo
2025-04-12 00:14:55 +08:00
parent 3d9620abb0
commit 759cfdaabd
46 changed files with 122 additions and 88 deletions

View File

@@ -110,7 +110,7 @@ return class DemoTask extends AbstractTaskPlugin {
// 编写执行方法
async execute(){
# 根据accessId获取授权配置
const access = await this.accessService.getById(this.accessId)
const access = await this.getAccess(this.accessId)
//必须使用this.logger打印日志
// this.logger.info("cert:",this.cert);

View File

@@ -108,7 +108,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info(`开始部署证书到阿里云(alb)`);
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const certId = await this.getAliyunCertId(access);
const client = await this.getLBClient(access, this.regionId);
@@ -155,7 +155,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, 'cn-shanghai');
const res = await client.request('DescribeRegions', {});
@@ -180,7 +180,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
if (!this.regionId) {
throw new Error('请先选择地区');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const params = {
@@ -208,7 +208,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
if (!this.regionId) {
throw new Error('请先选择地区');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const params: any = {

View File

@@ -77,7 +77,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云cdn');
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const sslClient = new AliyunSslClient({
access,
logger: this.logger,
@@ -151,7 +151,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getClient(access);

View File

@@ -57,7 +57,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云DCDN');
const access = (await this.accessService.getById(this.accessId)) as AliyunAccess;
const access = (await this.getAccess(this.accessId)) as AliyunAccess;
const client = await this.getClient(access);
const params = await this.buildParams();
await this.doRequest(client, params);

View File

@@ -116,7 +116,7 @@ export class AliyunDeployCertToFC extends AbstractPlusTaskPlugin {
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云');
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
@@ -177,7 +177,7 @@ export class AliyunDeployCertToFC extends AbstractPlusTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
const $OpenApi = await import('@alicloud/openapi-client');

View File

@@ -108,7 +108,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info(`开始部署证书到阿里云(nlb)`);
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const certId = await this.getAliyunCertId(access);
const client = await this.getLBClient(access, this.regionId);
@@ -151,7 +151,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, 'cn-shanghai');
const res = await client.request('DescribeRegions', {});
@@ -176,7 +176,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
if (!this.regionId) {
throw new Error('请先选择地区');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const params = {
@@ -204,7 +204,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
if (!this.regionId) {
throw new Error('请先选择地区');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const params: any = {

View File

@@ -102,7 +102,7 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云OSS');
const access = (await this.accessService.getById(this.accessId)) as AliyunAccess;
const access = (await this.getAccess(this.accessId)) as AliyunAccess;
this.logger.info(`bucket: ${this.bucket}, region: ${this.region}, domainName: ${this.domainName}`);
const client = await this.getClient(access);
await this.doRequest(client, {});

View File

@@ -107,7 +107,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info(`开始部署证书到阿里云(slb)`);
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const aliyunCert = await this.getAliyunCertId(access);
@@ -167,7 +167,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, 'cn-shanghai');
const res = await client.request('DescribeRegions', {});
@@ -192,7 +192,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
if (!this.regionId) {
throw new Error('请先选择地区');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const params = {
@@ -221,7 +221,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
if (!this.regionId) {
throw new Error('请先选择地区');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const params: any = {

View File

@@ -109,7 +109,7 @@ export class AliyunDeployCertToWaf extends AbstractPlusTaskPlugin {
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云');
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
let certId: any = this.cert;
if (typeof this.cert === 'object') {
const sslClient = new AliyunSslClient({
@@ -163,7 +163,7 @@ export class AliyunDeployCertToWaf extends AbstractPlusTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getWafClient(access);
const instanceId = await this.getInstanceId(client);

View File

@@ -83,7 +83,7 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云cdn');
const access: AliyunAccess = await this.accessService.getById(this.accessId);
const access: AliyunAccess = await this.getAccess(this.accessId);
let endpoint = '';
for (const region of regionDict) {

View File

@@ -58,7 +58,7 @@ export class AwsUploadToACM extends AbstractTaskPlugin {
async execute(): Promise<void> {
const { cert, accessId, region } = this;
const access = await this.accessService.getById<AwsAccess>(accessId);
const access = await this.getAccess<AwsAccess>(accessId);
const acmClient = new AwsAcmClient({
access,
region,

View File

@@ -56,7 +56,7 @@ export class CacheFlyPlugin extends AbstractTaskPlugin {
async execute(): Promise<void> {
const { cert, accessId } = this;
const access = (await this.accessService.getById(accessId)) as CacheflyAccess;
const access = (await this.getAccess(accessId)) as CacheflyAccess;
let otp = null;
if (access.otpkey) {
const response = await this.http.request<any, any>({

View File

@@ -140,7 +140,7 @@ export class DemoTest extends AbstractTaskPlugin {
const { select, text, cert, accessId } = this;
try {
const access = await this.accessService.getById(accessId);
const access = await this.getAccess(accessId);
this.logger.debug('access', access);
} catch (e) {
this.logger.error('获取授权失败', e);
@@ -177,7 +177,7 @@ export class DemoTest extends AbstractTaskPlugin {
}
// @ts-ignore
const access = await this.accessService.getById(this.accessId);
const access = await this.getAccess(this.accessId);
// const siteRes = await this.ctx.http.request({
// url: '你的服务端获取选项的请求地址',

View File

@@ -59,7 +59,7 @@ export class DogeCloudDeployToCDNPlugin extends AbstractTaskPlugin {
dogeClient!: DogeClient;
async onInstance() {
const access = await this.accessService.getById(this.accessId);
const access = await this.getAccess(this.accessId);
this.dogeClient = new DogeClient(access, this.ctx.http);
}
async execute(): Promise<void> {

View File

@@ -66,7 +66,7 @@ export class GcoreflushPlugin extends AbstractTaskPlugin {
async execute(): Promise<void> {
const { cert, accessId } = this;
const access = (await this.accessService.getById(accessId)) as GcoreAccess;
const access = (await this.getAccess(accessId)) as GcoreAccess;
let otp = null;
if (access.otpkey) {
const response = await this.http.request<any, any>({

View File

@@ -62,7 +62,7 @@ export class GcoreuploadPlugin extends AbstractTaskPlugin {
async execute(): Promise<void> {
const { cert, accessId } = this;
const access = (await this.accessService.getById(accessId)) as GcoreAccess;
const access = (await this.getAccess(accessId)) as GcoreAccess;
let otp = null;
if (access.otpkey) {
const response = await this.http.request<any, any>({

View File

@@ -41,7 +41,7 @@ export class HostShellExecutePlugin extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
const { script, accessId } = this;
const connectConf = await this.accessService.getById(accessId);
const connectConf = await this.getAccess(accessId);
const sshClient = new SshClient(this.logger);
const scripts = script.split('\n');

View File

@@ -278,7 +278,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
this.logger.error('复制到当前主机功能已迁移到 “复制到本机”插件,请换成复制到本机插件');
return;
}
const connectConf: SshAccess = await this.accessService.getById(accessId);
const connectConf: SshAccess = await this.getAccess(accessId);
const sshClient = new SshClient(this.logger);
if (!accessId) {
@@ -370,7 +370,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
});
if (this.script && this.script?.trim()) {
const connectConf: SshAccess = await this.accessService.getById(accessId);
const connectConf: SshAccess = await this.getAccess(accessId);
const sshClient = new SshClient(this.logger);
this.logger.info('执行脚本命令');

View File

@@ -79,7 +79,7 @@ export class HauweiDeployCertToCDN extends AbstractTaskPlugin {
}
async getCdnClient() {
const access = await this.accessService.getById<HuaweiAccess>(this.accessId);
const access = await this.getAccess<HuaweiAccess>(this.accessId);
const { BasicCredentials } = await import('@huaweicloud/huaweicloud-sdk-core');
const cdn = await import('@huaweicloud/huaweicloud-sdk-cdn/v2/public-api.js');
//恢复华为云把log4j的config改了的问题

View File

@@ -61,7 +61,7 @@ export class JDCloudDeployToCDN extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info("开始部署证书到京东云CDN");
const access = await this.accessService.getById<JDCloudAccess>(this.accessId);
const access = await this.getAccess<JDCloudAccess>(this.accessId);
const service = await this.getClient(access);
let certId = this.cert;
@@ -145,7 +145,7 @@ export class JDCloudDeployToCDN extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error("请选择Access授权");
}
const access = await this.accessService.getById<JDCloudAccess>(this.accessId);
const access = await this.getAccess<JDCloudAccess>(this.accessId);
const service = await this.getClient(access);
/**

View File

@@ -60,7 +60,7 @@ export class JDCloudUpdateCert extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到京东云CDN');
const access = await this.accessService.getById<JDCloudAccess>(this.accessId);
const access = await this.getAccess<JDCloudAccess>(this.accessId);
const service = await this.getClient(access)
// let certId = this.cert
@@ -119,7 +119,7 @@ export class JDCloudUpdateCert extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<JDCloudAccess>(this.accessId);
const access = await this.getAccess<JDCloudAccess>(this.accessId);
const service = await this.getClient(access);
/**

View File

@@ -56,7 +56,7 @@ export class JDCloudUploadCert extends AbstractTaskPlugin {
async execute(): Promise<void> {
this.logger.info("开始上传证书到京东云数字证书中心");
const access = await this.accessService.getById<JDCloudAccess>(this.accessId);
const access = await this.getAccess<JDCloudAccess>(this.accessId);
const service = await this.getClient(access);

View File

@@ -190,7 +190,7 @@ export class DBBackupPlugin extends AbstractPlusTaskPlugin {
}
private async sshBackup(dbPath: string, backupDir: string, backupPath: string) {
const access: SshAccess = await this.ctx.accessService.getById(this.sshAccessId);
const access: SshAccess = await this.getAccess(this.sshAccessId);
const sshClient = new SshClient(this.logger);
this.logger.info('备份目录:', backupPath);
await sshClient.uploadFiles({

View File

@@ -92,7 +92,7 @@ export class ProxmoxUploadCert extends AbstractPlusTaskPlugin {
}
async getClient() {
const access: ProxmoxAccess = await this.accessService.getById<ProxmoxAccess>(this.accessId);
const access: ProxmoxAccess = await this.getAccess<ProxmoxAccess>(this.accessId);
const pve = await import('@corsinvest/cv4pve-api-javascript');
const client = new pve.PveClient(access.host, access.port);
const login = await client.login(access.username, access.password, 'pam');

View File

@@ -55,7 +55,7 @@ export class QiniuDeployCertToCDN extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到七牛云cdn');
const access = await this.accessService.getById<QiniuAccess>(this.accessId);
const access = await this.getAccess<QiniuAccess>(this.accessId);
const qiniuClient = new QiniuClient({
http: this.ctx.http,
access,
@@ -104,7 +104,7 @@ export class QiniuDeployCertToCDN extends AbstractTaskPlugin {
}
async onGetDomainList() {
const access = await this.accessService.getById<QiniuAccess>(this.accessId);
const access = await this.getAccess<QiniuAccess>(this.accessId);
const qiniuClient = new QiniuClient({
http: this.ctx.http,
access,

View File

@@ -51,7 +51,7 @@ export class QiniuCertUpload extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始上传证书到七牛云');
const access = await this.accessService.getById<QiniuAccess>(this.accessId);
const access = await this.getAccess<QiniuAccess>(this.accessId);
const qiniuClient = new QiniuClient({
http: this.ctx.http,
access,

View File

@@ -51,7 +51,7 @@ export class QnapDeploy extends AbstractPlusTaskPlugin {
throw new Error('主机登录授权配置不能为空');
}
const connectConf = await this.ctx.accessService.getById<SshAccess>(accessId);
const connectConf = await this.getAccess<SshAccess>(accessId);
const sshClient = new SshClient(this.logger);
//合并证书
const newCert = cert.key + '\n' + cert.crt;

View File

@@ -79,7 +79,7 @@ export class TencentDeleteExpiringCert extends AbstractPlusTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
const access = await this.accessService.getById<TencentAccess>(this.accessId);
const access = await this.getAccess<TencentAccess>(this.accessId);
const sslClient = new TencentSslClient({
access,
logger: this.logger,

View File

@@ -53,7 +53,7 @@ export class DeployCertToTencentAll extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
const accessProvider = await this.accessService.getById(this.accessId);
const accessProvider = await this.getAccess(this.accessId);
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/ssl/v20191205/index.js');
const Client = sdk.v20191205.Client;

View File

@@ -51,7 +51,7 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
const access = await this.accessService.getById<TencentAccess>(this.accessId);
const access = await this.getAccess<TencentAccess>(this.accessId);
const sslClient = new TencentSslClient({
access,
logger: this.logger,
@@ -82,7 +82,7 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
}
async getCdnClient() {
const accessProvider = await this.accessService.getById<TencentAccess>(this.accessId);
const accessProvider = await this.getAccess<TencentAccess>(this.accessId);
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/cdn/v20180606/index.js');
const CdnClient = sdk.v20180606.Client;

View File

@@ -68,7 +68,7 @@ export class DeployToCdnPlugin extends AbstractTaskPlugin {
}
async getClient() {
const accessProvider: TencentAccess = (await this.accessService.getById(this.accessId)) as TencentAccess;
const accessProvider: TencentAccess = (await this.getAccess(this.accessId)) as TencentAccess;
const CdnClient = this.Client;

View File

@@ -108,7 +108,7 @@ export class DeployCertToTencentCLB extends AbstractTaskPlugin {
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/clb/v20180317/index.js');
const ClbClient = sdk.v20180317.Client;
const accessProvider = (await this.accessService.getById(this.accessId)) as TencentAccess;
const accessProvider = (await this.getAccess(this.accessId)) as TencentAccess;
const region = this.region;
const clientConfig = {

View File

@@ -99,7 +99,7 @@ export class DeployCertToTencentCosPlugin extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
const access = await this.accessService.getById(this.accessId);
const access = await this.getAccess(this.accessId);
const client = new TencentSslClient({
access,
@@ -130,7 +130,7 @@ export class DeployCertToTencentCosPlugin extends AbstractTaskPlugin {
}
async onGetDomainList(data: any) {
const access = await this.accessService.getById(this.accessId);
const access = await this.getAccess(this.accessId);
const cosv5 = await import('cos-nodejs-sdk-v5');
const cos = new cosv5.default({

View File

@@ -80,7 +80,7 @@ export class DeployCertToTencentEO extends AbstractTaskPlugin {
}
async execute(): Promise<void> {
const accessProvider: TencentAccess = (await this.accessService.getById(this.accessId)) as TencentAccess;
const accessProvider: TencentAccess = (await this.getAccess(this.accessId)) as TencentAccess;
const client = this.getClient(accessProvider);
const params = this.buildParams();
await this.doRequest(client, params);

View File

@@ -52,7 +52,7 @@ export class TencentDeployCertToLive extends AbstractPlusTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
const access = await this.accessService.getById<TencentAccess>(this.accessId);
const access = await this.getAccess<TencentAccess>(this.accessId);
let tencentCertId = this.cert as string;
if (typeof this.cert !== 'string') {
@@ -90,7 +90,7 @@ export class TencentDeployCertToLive extends AbstractPlusTaskPlugin {
}
async getLiveClient() {
const accessProvider = await this.accessService.getById<TencentAccess>(this.accessId);
const accessProvider = await this.getAccess<TencentAccess>(this.accessId);
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/live/v20180801/index.js');
const CssClient = sdk.v20180801.Client;

View File

@@ -116,7 +116,7 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractPlusTaskPlugin
this.K8sClient = k8sSdk.K8sClient;
}
async execute(): Promise<void> {
const accessProvider = await this.accessService.getById(this.accessId);
const accessProvider = await this.getAccess(this.accessId);
const tkeClient = await this.getTkeClient(accessProvider, this.region);
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);

View File

@@ -135,7 +135,7 @@ export class TencentActionInstancesPlugin extends AbstractTaskPlugin {
}
async getCvmClient() {
const accessProvider = await this.accessService.getById<TencentAccess>(this.accessId);
const accessProvider = await this.getAccess<TencentAccess>(this.accessId);
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/cvm/v20170312/index.js');
const CvmClient = sdk.v20170312.Client;

View File

@@ -52,7 +52,7 @@ export class UploadCertToTencent extends AbstractTaskPlugin {
async execute(): Promise<void> {
const { accessId, name, cert } = this;
const accessProvider = await this.accessService.getById(accessId);
const accessProvider = await this.getAccess(accessId);
const certName = this.appendTimeSuffix(name || cert.domain);
const client = this.getClient(accessProvider);
@@ -96,7 +96,7 @@ export class UploadCertToTencent extends AbstractTaskPlugin {
// async rollback({ input }) {
// const { accessId } = input;
// const accessProvider = await this.accessService.getById(accessId);
// const accessProvider = await this.getAccess(accessId);
// const client = this.getClient(accessProvider);
//
// const { tencentCertId } = context;

View File

@@ -68,7 +68,7 @@ export class UpyunDeployToCdn extends AbstractPlusTaskPlugin {
//插件执行方法
async execute(): Promise<void> {
const access = await this.accessService.getById<UpyunAccess>(this.accessId);
const access = await this.getAccess<UpyunAccess>(this.accessId);
const upyunClient = new UpyunClient({
access,
@@ -101,7 +101,7 @@ export class UpyunDeployToCdn extends AbstractPlusTaskPlugin {
if (!this.accessId) {
throw new Error("accessId不能为空");
}
const access = await this.accessService.getById<UpyunAccess>(this.accessId);
const access = await this.getAccess<UpyunAccess>(this.accessId);
const upyunClient = new UpyunClient({
access,

View File

@@ -78,7 +78,7 @@ export class VolcengineDeployToCDN extends AbstractTaskPlugin {
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到火山引擎CDN');
const access = await this.accessService.getById<VolcengineAccess>(this.accessId);
const access = await this.getAccess<VolcengineAccess>(this.accessId);
const client = await this.getClient(access)
const service = await client.getCdnClient()
@@ -117,7 +117,7 @@ export class VolcengineDeployToCDN extends AbstractTaskPlugin {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<VolcengineAccess>(this.accessId);
const access = await this.getAccess<VolcengineAccess>(this.accessId);
const client = await this.getClient(access);
const service = await client.getCdnClient()

View File

@@ -71,7 +71,7 @@ export class WoaiCdnPlugin extends AbstractTaskPlugin {
async execute(): Promise<void> {
const { baseApi, certId, cert, accessId } = this;
const access = (await this.accessService.getById(accessId)) as WoaiAccess;
const access = (await this.getAccess(accessId)) as WoaiAccess;
// 使用默认值或用户输入的值
const apiBase = baseApi || 'https://console.edeg.sxhjgy.cn';
// 登录获取token